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 601f0ca5
authored
Dec 07, 2022
by
aagusti
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
https://git.opensipkd.com/taufik/esipkd
2 parents
05c46ef9
715562db
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
99 additions
and
14 deletions
esipkd/reports/skrd.odt
esipkd/views/arinvoice_b.py
esipkd/views/bjb_qris.py
esipkd/views/bjb_va.py
esipkd/views/templates/arinvoice/list_b.pt
esipkd/views/templates/bjbva/add-edit.pt
esipkd/reports/skrd.odt
View file @
601f0ca
No preview for this file type
esipkd/views/arinvoice_b.py
View file @
601f0ca
...
@@ -51,6 +51,9 @@ from daftar import (STATUS, deferred_status,
...
@@ -51,6 +51,9 @@ from daftar import (STATUS, deferred_status,
)
)
from
..models.bjb_qris
import
BJBQRIS
from
..models.bjb_va
import
BJBVA
SESS_ADD_FAILED
=
'Gagal tambah Tagihan'
SESS_ADD_FAILED
=
'Gagal tambah Tagihan'
SESS_EDIT_FAILED
=
'Gagal edit Tagihan'
SESS_EDIT_FAILED
=
'Gagal edit Tagihan'
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
...
@@ -915,6 +918,30 @@ def view_pdf(request):
...
@@ -915,6 +918,30 @@ def view_pdf(request):
imgqrcode
.
save
(
path
,
'PNG'
)
imgqrcode
.
save
(
path
,
'PNG'
)
item
.
qrcode
=
open
(
path
,
'rb'
)
.
read
()
item
.
qrcode
=
open
(
path
,
'rb'
)
.
read
()
# ---------------------------- untuk tambah qris---------------------
no_bayar
=
row
.
kode
qris
=
DBSession
.
query
(
BJBQRIS
)
.
join
(
ARInvoice
,
ARInvoice
.
kode
==
BJBQRIS
.
invoice_no
)
.
\
filter
(
BJBQRIS
.
invoice_no
==
no_bayar
)
.
first
()
from
..tools
import
get_tmp
if
qris
:
img_qr
=
qrcode
.
make
(
str
(
qris
.
qrcode
))
path
=
get_tmp
()
+
str
(
qris
.
va_number
)
img_qr
.
save
(
path
,
'PNG'
)
item
.
qris
=
open
(
path
,
'rb'
)
.
read
()
else
:
item
.
qris
=
''
# -----------------------------------------------------------------------
# ---------------------------- untuk tambah va---------------------
qva
=
DBSession
.
query
(
BJBVA
)
.
join
(
ARInvoice
,
ARInvoice
.
kode
==
BJBVA
.
invoice_no
)
.
\
filter
(
BJBVA
.
invoice_no
==
no_bayar
)
.
first
()
if
qva
:
item
.
qva
=
qva
.
va_number
else
:
item
.
qva
=
''
# -----------------------------------------------------------------------
data
=
{}
data
=
{}
data
[
'item'
]
=
item
data
[
'item'
]
=
item
template
.
render
(
data
)
template
.
render
(
data
)
...
...
esipkd/views/bjb_qris.py
View file @
601f0ca
...
@@ -247,7 +247,9 @@ class view(object):
...
@@ -247,7 +247,9 @@ class view(object):
@view_config
(
route_name
=
'bjbqris-add'
,
renderer
=
'templates/bjbqris/add-edit.pt'
,
permission
=
'add'
)
@view_config
(
route_name
=
'bjbqris-add'
,
renderer
=
'templates/bjbqris/add-edit.pt'
,
permission
=
'add'
)
def
view_add
(
self
):
def
view_add
(
self
):
request
=
self
.
req
request
=
self
.
req
params
=
request
.
params
form
=
get_form
(
request
,
AddSchema
)
form
=
get_form
(
request
,
AddSchema
)
row_invoice
=
q_inv
(
params
[
'no_invoice'
])
.
first
()
if
request
.
POST
:
if
request
.
POST
:
if
'simpan'
in
request
.
POST
:
if
'simpan'
in
request
.
POST
:
...
@@ -270,7 +272,20 @@ class view(object):
...
@@ -270,7 +272,20 @@ class view(object):
return
route_list
(
request
)
return
route_list
(
request
)
elif
SESS_ADD_FAILED
in
request
.
session
:
elif
SESS_ADD_FAILED
in
request
.
session
:
return
session_failed
(
request
,
SESS_ADD_FAILED
)
return
session_failed
(
request
,
SESS_ADD_FAILED
)
if
row_invoice
:
pokok
,
denda
=
calculate_tagihan
(
dict
(
pokok
=
row_invoice
.
jumlah
,
jatuh_tempo
=
row_invoice
.
jatuh_tempo
))
values
=
{}
values
=
{}
values
[
'invoice_no'
]
=
row_invoice
.
kode
values
[
'description'
]
=
row_invoice
.
description
values
[
'customer_name'
]
=
row_invoice
.
subjek_nama
values
[
'customer_email'
]
=
row_invoice
.
subjek_email
and
row_invoice
.
subjek_email
or
'-'
values
[
'customer_phone'
]
=
row_invoice
.
subjek_phone
and
row_invoice
.
subjek_phone
or
'-'
values
[
'expired_date'
]
=
ymdhms
(
datetime
.
combine
(
date
.
today
(),
time
(
23
,
59
,
59
)))
values
[
'amount'
]
=
(
pokok
+
denda
)
else
:
alues
=
{}
form
.
set_appstruct
(
values
)
form
.
set_appstruct
(
values
)
return
dict
(
form
=
form
)
return
dict
(
form
=
form
)
...
...
esipkd/views/bjb_va.py
View file @
601f0ca
...
@@ -92,6 +92,7 @@ class AddSchema(colander.Schema):
...
@@ -92,6 +92,7 @@ class AddSchema(colander.Schema):
oid
=
"amount"
,
oid
=
"amount"
,
title
=
"Amount"
)
title
=
"Amount"
)
class
EditSchema
(
AddSchema
):
class
EditSchema
(
AddSchema
):
invoice_no
=
colander
.
SchemaNode
(
invoice_no
=
colander
.
SchemaNode
(
colander
.
String
(),
colander
.
String
(),
...
@@ -246,7 +247,11 @@ class view(object):
...
@@ -246,7 +247,11 @@ class view(object):
@view_config
(
route_name
=
'bjbva-add'
,
renderer
=
'templates/bjbva/add-edit.pt'
,
permission
=
'read'
)
@view_config
(
route_name
=
'bjbva-add'
,
renderer
=
'templates/bjbva/add-edit.pt'
,
permission
=
'read'
)
def
view_add
(
self
):
def
view_add
(
self
):
request
=
self
.
req
request
=
self
.
req
params
=
request
.
params
form
=
get_form
(
request
,
AddSchema
)
form
=
get_form
(
request
,
AddSchema
)
row_invoice
=
q_inv
(
params
[
'no_invoice'
])
.
first
()
# ArInvoice.departemen_id==request.session['departemen_id'])
if
request
.
POST
:
if
request
.
POST
:
if
'simpan'
in
request
.
POST
:
if
'simpan'
in
request
.
POST
:
...
@@ -271,6 +276,23 @@ class view(object):
...
@@ -271,6 +276,23 @@ class view(object):
return
route_list
(
request
)
return
route_list
(
request
)
elif
SESS_ADD_FAILED
in
request
.
session
:
elif
SESS_ADD_FAILED
in
request
.
session
:
return
session_failed
(
request
,
SESS_ADD_FAILED
)
return
session_failed
(
request
,
SESS_ADD_FAILED
)
if
row_invoice
:
pokok
,
denda
=
calculate_tagihan
(
dict
(
pokok
=
row_invoice
.
jumlah
,
jatuh_tempo
=
row_invoice
.
jatuh_tempo
))
print
(
"++++++++++++++++++++++++++"
,
str
(
row_invoice
.
description
))
values
=
{}
values
[
'invoice_no'
]
=
str
(
row_invoice
.
kode
)
values
[
'description'
]
=
str
(
row_invoice
.
description
)
values
[
'customer_name'
]
=
row_invoice
.
subjek_nama
values
[
'customer_email'
]
=
row_invoice
.
subjek_email
and
row_invoice
.
subjek_email
or
'-'
values
[
'customer_phone'
]
=
row_invoice
.
subjek_phone
and
row_invoice
.
subjek_phone
or
'-'
values
[
'expired_date'
]
=
ymdhms
(
datetime
.
combine
(
date
.
today
(),
time
(
23
,
59
,
59
)))
values
[
'amount'
]
=
(
pokok
+
denda
)
print
(
'---------------------------------'
,
values
)
form
.
set_appstruct
(
values
)
return
dict
(
form
=
form
,
invoice_no
=
params
[
'no_invoice'
])
else
:
values
=
{}
values
=
{}
form
.
set_appstruct
(
values
)
form
.
set_appstruct
(
values
)
return
dict
(
form
=
form
)
return
dict
(
form
=
form
)
...
...
esipkd/views/templates/arinvoice/list_b.pt
View file @
601f0ca
...
@@ -43,9 +43,11 @@
...
@@ -43,9 +43,11 @@
<script
src=
"/static/datatables/media/js/dataTables.bootstrap.js"
></script>
<script
src=
"/static/datatables/media/js/dataTables.bootstrap.js"
></script>
<script>
<script>
var
mID
;
var
mID
;
var
mKD
;
var
oTable
;
var
oTable
;
var
iPos
;
var
iPos
;
var
oFormUrl
=
"/arinvoiceb/"
;
var
oFormUrl
=
"/arinvoiceb/"
;
var
oFormUrli
=
"/"
;
var
oTableUrl
=
oFormUrl
+
"grid/act"
;
var
oTableUrl
=
oFormUrl
+
"grid/act"
;
$
.
fn
.
dataTable
.
ext
.
search
.
push
(
$
.
fn
.
dataTable
.
ext
.
search
.
push
(
function
(
oSettings
,
aData
,
iDataIndex
)
{
function
(
oSettings
,
aData
,
iDataIndex
)
{
...
@@ -173,23 +175,19 @@
...
@@ -173,23 +175,19 @@
' <button id="btn_print1" class="btn btn btn-info pull-left" type="button">Kwitansi</button>'
,
' <button id="btn_print1" class="btn btn btn-info pull-left" type="button">Kwitansi</button>'
,
' <button id="btn_posting" class="btn btn btn-success pull-left" type="button">Posting</button>'
,
' <button id="btn_posting" class="btn btn btn-success pull-left" type="button">Posting</button>'
,
' <button id="btn_close" class="btn btn btn-warning" type="button">Tutup</button>'
,
' <button id="btn_close" class="btn btn btn-warning" type="button">Tutup</button>'
,
' <label class="pull-left">Periode'
,
' <input id="awal" class="input-sm " type="text" value="${rows.awal}">'
,
' s.d <input id="akhir" class="input-sm " type="text" value="${rows.akhir}">'
,
' </label>'
,
' <button id="btn_pdf" class="btn btn btn-success pull-left" type="button">PDF</button>'
,
' <button id="btn_pdf" class="btn btn btn-success pull-left" type="button">PDF</button>'
,
' <button id="btn_csv" class="btn btn btn-info pull-left" type="button">CSV</button>'
,
' <button id="btn_csv" class="btn btn btn-info pull-left" type="button">CSV</button>'
,
'<div class="dropdown">'
,
' <button id="btn_va" class="btn btn btn-success pull-left" type="button">CREATE VA</button>'
,
'<button class="btn btn btn-danger pull-left" type="button" id="bjb_va_qris" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">BJB VA / QRIS'
,
' <button id="btn_qris" class="btn btn btn-info pull-left" type="button">CREATE QRIS</button>'
,
'</button>'
,
' '
,
'<div class="dropdown-menu" aria-labelledby="bjb_va_qris">'
,
'<li><a href="/bjbva">BJB VA</a></li>'
,
'<li><a href="/bjbqris">BJB QRIS</a></li>'
,
'</div>'
,
'</div>'
,
'<div class="btn-group pull-left">'
,
'</div>'
,
'</div>'
,
'<div class="btn-group pull-left">'
,
' <label class="pull-left">Periode'
,
' '
,
' <input id="awal" class="input-sm " type="text" value="${rows.awal}">'
,
' s.d <input id="akhir" class="input-sm " type="text" value="${rows.akhir}">'
,
' </label>'
,
'</div>'
,
'</div>'
,
];
];
...
@@ -226,6 +224,7 @@
...
@@ -226,6 +224,7 @@
//var aData = oTable.fnGetData(iPos);
//var aData = oTable.fnGetData(iPos);
var
aData
=
oTable
.
row
(
this
).
data
();
var
aData
=
oTable
.
row
(
this
).
data
();
mID
=
aData
[
0
];
mID
=
aData
[
0
];
mKD
=
aData
[
1
];
oTable
.
$
(
'tr.selected'
).
removeClass
(
'selected'
);
oTable
.
$
(
'tr.selected'
).
removeClass
(
'selected'
);
$
(
this
).
addClass
(
'selected'
);
$
(
this
).
addClass
(
'selected'
);
}
}
...
@@ -243,6 +242,23 @@
...
@@ -243,6 +242,23 @@
}
}
});
});
$
(
'#btn_va'
).
click
(
function
()
{
if
(
mKD
)
{
window
.
location
=
oFormUrli
+
'bjbva/add?no_invoice='
+
mKD
;
}
else
{
alert
(
'Silahkan pilih data yang akan tambah Va'
);
}
});
$
(
'#btn_qris'
).
click
(
function
()
{
if
(
mKD
)
{
window
.
location
=
oFormUrli
+
'/bjbqris/add?no_invoice='
+
mKD
;
}
else
{
alert
(
'Silahkan pilih data yang akan tambah QRIS'
);
}
});
$
(
'#btn_posting'
).
click
(
function
()
{
$
(
'#btn_posting'
).
click
(
function
()
{
url
=
oFormUrl
+
'posting?awal='
+
$
(
'#awal'
).
val
()
+
"&akhir="
+
$
(
'#akhir'
).
val
();
url
=
oFormUrl
+
'posting?awal='
+
$
(
'#awal'
).
val
()
+
"&akhir="
+
$
(
'#akhir'
).
val
();
window
.
location
=
url
;
window
.
location
=
url
;
...
...
esipkd/views/templates/bjbva/add-edit.pt
View file @
601f0ca
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
$
(
'.input-date'
).
datetimepicker
({
$
(
'.input-date'
).
datetimepicker
({
format
:
"yyyy-mm-dd hh:ii:ss"
format
:
"yyyy-mm-dd hh:ii:ss"
});
});
<
tal
:
block
tal
:
condition
=
"not 'id' in request.matchdict"
>
<
tal
:
block
tal
:
condition
=
"not 'id' in request.matchdict
and not 'no_invoice' in request.params
"
>
$
(
'#invoice_no'
).
select2
({
$
(
'#invoice_no'
).
select2
({
ajax
:
{
ajax
:
{
url
:
'/bjbva/kodebayar/act'
,
url
:
'/bjbva/kodebayar/act'
,
...
@@ -101,6 +101,11 @@
...
@@ -101,6 +101,11 @@
$
(
'#response_code'
).
prop
(
'readonly'
,
true
);
$
(
'#response_code'
).
prop
(
'readonly'
,
true
);
$
(
'#response_message'
).
prop
(
'readonly'
,
true
);
$
(
'#response_message'
).
prop
(
'readonly'
,
true
);
<
/tal:block
>
<
/tal:block
>
<
tal
:
block
tal
:
condition
=
"'no_invoice' in request.params and request.params['no_invoice']"
>
$
(
'#invoice_no'
).
select2
(
'data'
,
{
id
:
{
invoice_no
},
value
:
{
invoice_no
}});
<
/tal:block
>
});
});
</script>
</script>
</div>
<!-- /metal:script -->
</div>
<!-- /metal:script -->
...
...
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