Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Taufik Yulianto
/
esipkd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0faaaeb8
authored
Oct 25, 2022
by
taufikyu
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan create va / qris
1 parent
a65073ed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
19 deletions
esipkd/models/isipkd.py
esipkd/views/pap.py
esipkd/views/templates/pap/edit.pt
esipkd/models/isipkd.py
View file @
0faaaeb
...
...
@@ -84,6 +84,9 @@ class Pap(DefaultModel,Base):
tgl_tetap
=
Column
(
Date
)
tgl_jt_tempo
=
Column
(
Date
)
keterangan
=
Column
(
String
(
255
))
va_number
=
Column
(
String
(
32
))
qris_number
=
Column
(
String
(
32
))
qrcode
=
Column
(
Text
)
class
Unit
(
NamaModel
,
Base
):
__tablename__
=
'units'
...
...
esipkd/views/pap.py
View file @
0faaaeb
...
...
@@ -181,6 +181,21 @@ class AddSchema(colander.Schema):
title
=
'Keterangan'
,
oid
=
"keterangan"
)
class
VASchema
(
AddSchema
):
va
=
colander
.
SchemaNode
(
colander
.
String
(),
missing
=
colander
.
drop
,
title
=
'VA'
,
oid
=
"va"
)
class
QRISSchema
(
AddSchema
):
qris
=
colander
.
SchemaNode
(
colander
.
String
(),
missing
=
colander
.
drop
,
title
=
'QRIS'
,
oid
=
"qris"
)
class
EditSchema
(
AddSchema
):
nr
=
colander
.
SchemaNode
(
...
...
@@ -215,9 +230,12 @@ def save(request, values, row=None):
#kd_status = 2)
p
=
engInformix
.
fetchone
(
sql_result
)
print
'----------------P Hasil Select----------------------'
,
p
#
print '----------------P Hasil Select----------------------',p
return
p
class
Item
():
pass
def
save_request
(
values
,
request
,
row
=
None
):
values
[
'npwpd'
]
=
values
[
'npwpd'
]
values
[
'm_pjk_bln'
]
=
values
[
'm_pjk_bln'
]
...
...
@@ -301,7 +319,7 @@ def query_id(request):
#kd_status = 2)
x
=
engInformix
.
fetchone
(
sql_result1
)
print
'----------------X Hasil Select----------------------'
,
x
#
print '----------------X Hasil Select----------------------',x
return
x
@view_config
(
route_name
=
'pap-edit'
,
renderer
=
'templates/pap/edit.pt'
,
...
...
@@ -310,10 +328,10 @@ def view_edit(request):
req
=
request
found
=
0
row
=
query_id
(
request
)
print
'----------------Row Hasil Params--------------------'
,
row
#
print '----------------Row Hasil Params--------------------',row
settings
=
get_settings
()
print
'X--------_______SETTING INFORMIX______--------X'
,
settings
#
print 'X--------_______SETTING INFORMIX______--------X',settings
private_key
=
settings
[
'recaptcha.private_key'
]
data_key
=
settings
[
'recaptcha.data_key'
]
...
...
@@ -349,7 +367,7 @@ def view_edit(request):
else
:
request
.
session
.
flash
(
'Data PAP ditemukan.'
)
found
=
1
print
'----------------Row Hasil Select--------------------'
,
row
#
print '----------------Row Hasil Select--------------------',row
return
HTTPFound
(
location
=
request
.
route_url
(
'pap-edit'
,
nr
=
row
.
npwpd
,
nk
=
row
.
m_pjk_bln
,
em
=
row
.
m_pjk_thn
))
...
...
@@ -381,6 +399,14 @@ def view_edit(request):
request
.
session
.
flash
(
'BJBVA No.
%
s sudah ditambahkan.'
%
row
.
va_number
)
else
:
request
.
session
.
flash
(
'BJBVA gagal ditambahkan.'
)
form
=
get_form
(
request
,
VASchema
)
val
[
'va'
]
=
row
.
va_number
form
.
set_appstruct
(
val
)
return
HTTPFound
(
location
=
request
.
route_url
(
'pap-edit'
,
nr
=
val
[
'npwpd'
],
nk
=
val
[
'm_pjk_bln'
],
em
=
val
[
'm_pjk_thn'
]))
elif
'createqris'
in
request
.
POST
:
val
=
dict
(
request
.
POST
.
items
())
...
...
@@ -408,6 +434,13 @@ def view_edit(request):
request
.
session
.
flash
(
'BJBQRIS No.
%
s sudah ditambahkan.'
%
row
.
va_number
)
else
:
request
.
session
.
flash
(
'BJBQRIS gagal ditambahkan.'
)
form
=
get_form
(
request
,
QRISSchema
)
val
[
'qris'
]
=
row
.
va_number
form
.
set_appstruct
(
val
)
return
HTTPFound
(
location
=
request
.
route_url
(
'pap-edit'
,
nr
=
val
[
'npwpd'
],
nk
=
val
[
'm_pjk_bln'
],
em
=
val
[
'm_pjk_thn'
]))
return
route_list
(
request
)
elif
SESS_EDIT_FAILED
in
request
.
session
:
return
session_failed
(
request
,
SESS_EDIT_FAILED
)
...
...
esipkd/views/templates/pap/edit.pt
View file @
0faaaeb
...
...
@@ -296,6 +296,34 @@
</div>
</div>
<div
class=
"form-group"
tal:condition=
"'va' in form"
>
<label
for=
"va"
class=
"control-label col-md-3"
id=
"req-va"
>
VA
</label>
<div
class=
"col-md-9"
tal:define=
"field form['va']"
id=
"item-${field.oid}"
>
${structure:field.serialize()}
<script>
$
(
"#${field.oid}"
).
attr
(
"readonly"
,
true
);
</script>
<p
id=
"error-${field.oid}"
class=
"help-block"
tal:condition=
"field.error"
tal:repeat=
"error field.error.messages()"
>
${error}
</p>
</div>
</div>
<div
class=
"form-group"
tal:condition=
"'qris' in form"
>
<label
for=
"qris"
class=
"control-label col-md-3"
id=
"req-qris"
>
QRIS
</label>
<div
class=
"col-md-9"
tal:define=
"field form['qris']"
id=
"item-${field.oid}"
>
${structure:field.serialize()}
<script>
$
(
"#${field.oid}"
).
attr
(
"readonly"
,
true
);
</script>
<p
id=
"error-${field.oid}"
class=
"help-block"
tal:condition=
"field.error"
tal:repeat=
"error field.error.messages()"
>
${error}
</p>
</div>
</div>
<!--Button -->
<div
class=
"form-group"
>
<label
class=
"control-label col-md-3"
>
...
...
@@ -310,22 +338,11 @@
window
.
open
(
url
+
data
);
});
</script>
<button
id=
"btn_va"
name=
"createva"
type=
"
button
"
class=
"btn btn-danger "
<button
id=
"btn_va"
name=
"createva"
type=
"
submit
"
class=
"btn btn-danger "
value=
"createva"
>
Create VA
</button>
<button
id=
"btn_qris"
name=
"createqris"
type=
"
button
"
class=
"btn btn-warning "
<button
id=
"btn_qris"
name=
"createqris"
type=
"
submit
"
class=
"btn btn-warning "
value=
"createqris"
>
Create QRIS
</button>
<script>
$
(
'#btn_va, #btn_qris'
).
click
(
function
()
{
$
.
ajax
({
type
:
"POST"
,
url
:
""
,
data
:
{
'form'
:
$
(
"#deform"
).
serialize
(),
$
(
this
).
val
():
True
},
success
:
function
(
msg
)
{
window
.
location
.
reload
();
}
});
});
</script>
</div>
</div><hr>
</div>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment