Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
opensipkd-bphtb-models
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d03bc5f1
authored
Sep 24, 2019
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bug fixed available_invoice.py
1 parent
f983816b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
opensipkd/bphtb/cilegon/scripts/available_invoice.py
opensipkd/bphtb/cilegon/scripts/available_invoice.py
View file @
d03bc5f
...
...
@@ -27,35 +27,32 @@ class AvailableInvoice:
self
.
count
=
count
def
run
(
self
):
q_inv
=
DBSession
.
query
(
Spt
)
.
filter
(
Spt
.
t_totalspt
>
0
)
.
\
order_by
(
Spt
.
t_periodespt
.
desc
(),
Spt
.
t_totalspt
,
Spt
.
t_idspt
)
q_pay
=
DBSession
.
query
(
Pembayaran
)
.
\
filter
(
Pembayaran
.
t_statusbayarspt
==
None
)
.
\
order_by
(
Pembayaran
.
t_idpembayaranspt
.
desc
())
offset
=
-
1
self
.
no
=
0
awal
=
time
()
while
True
:
offset
+=
1
inv
=
q_inv
.
offset
(
offset
)
.
limit
(
1
)
.
first
()
if
not
inv
:
pay
=
q_pay
.
offset
(
offset
)
.
limit
(
1
)
.
first
()
if
not
pay
:
break
self
.
row_handler
(
inv
)
self
.
row_handler
(
pay
)
if
time
()
-
awal
>
10
:
break
if
self
.
no
==
self
.
count
:
break
def
row_handler
(
self
,
inv
):
q
=
DBSession
.
query
(
Pembayaran
)
.
filter_by
(
t_idspt
=
inv
.
t_idspt
)
pay
=
q
.
first
()
def
row_handler
(
self
,
pay
):
inq
=
Inquiry
(
pay
.
t_kodebayarbanksppt
,
registry
[
'persen_denda'
])
if
not
inq
.
total
:
return
self
.
no
+=
1
nominal
=
thousand
(
inq
.
total
)
q
=
DBSession
.
query
(
DetailSpt
)
.
filter_by
(
t_idspt
=
inv
.
t_idspt
)
op
=
q
.
first
()
msg
=
'#{} {} {} {} {} Rp {}'
.
format
(
self
.
no
,
pay
.
t_kodebayarbanksppt
,
inv
.
t_periodespt
,
inv
.
t_nopbphtbsppt
,
op
.
t_namawppembeli
,
nominal
)
self
.
no
,
inq
.
invoice_id
,
inq
.
get_tahun
(),
inq
.
get_nop
()
,
inq
.
get_nama
()
,
nominal
)
print
(
msg
)
...
...
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