Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
payment-report
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 93ebd05d
authored
Sep 02, 2022
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Paham WEBR yang hanya ada tabel log_iso
1 parent
47a8792a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
7 deletions
CHANGES.txt
payment_report/scripts/data/conf.csv
payment_report/scripts/webr.py
CHANGES.txt
View file @
93ebd05
2.1 2022-09-0
1
2.1 2022-09-0
2
--------------
- Memahami BPHTB JSON (Tangsel - PT POS)
- Memahami WEBR yang hanya punya tabel ISO8583 (Tangsel)
2.0 2022-08-02
--------------
...
...
payment_report/scripts/data/conf.csv
View file @
93ebd05
...
...
@@ -2,4 +2,4 @@ nama,nilai,keterangan
pad payment last date,1-1-2000 00:00:00,pad.pad_sspd.sspdtgl terakhir yang diproses
webr payment last date,1-1-2000 00:00:00,webr.ar_payment.created terakhir yang diproses
bphtb payment last date,01-01-2000 00:00:00,bphtb.bphtb_bank.tanggal terakhir yang diproses
pbb payment last date,1-1-2000,pembayaran_sppt.tgl_rekam_byr_sppt terakhir yang diproses
pbb payment last date,1-1-2000
00:00:00
,pembayaran_sppt.tgl_rekam_byr_sppt terakhir yang diproses
payment_report/scripts/webr.py
View file @
93ebd05
...
...
@@ -44,7 +44,12 @@ class App(BaseApp):
if
not
self
.
pid
:
return
self
.
base_q_pay
=
self
.
prod_session
.
query
(
Payment
)
self
.
base_q_inv
=
self
.
prod_session
.
query
(
Invoice
)
try
:
self
.
base_q_pay
.
first
()
self
.
base_q_inv
=
self
.
prod_session
.
query
(
Invoice
)
except
ProgrammingError
:
self
.
prod_session
.
rollback
()
self
.
base_q_pay
=
None
self
.
base_q_iso
=
self
.
prod_session
.
query
(
Log
)
try
:
self
.
base_q_iso
.
first
()
...
...
@@ -61,6 +66,11 @@ class App(BaseApp):
return
q
.
first
()
def
create_data
(
self
,
pay
):
# Override
if
self
.
base_q_pay
:
return
self
.
create_data_from_prod
(
pay
)
return
self
.
create_data_from_h2h
(
pay
)
def
create_data_from_prod
(
self
,
pay
):
q
=
self
.
base_q_inv
.
filter_by
(
id
=
pay
.
ar_invoice_id
)
inv
=
q
.
first
()
self
.
invoice_id
=
inv
.
kode
...
...
@@ -83,13 +93,26 @@ class App(BaseApp):
denda
=
pay
.
bunga
,
jml_bayar
=
pay
.
bayar
,
channel_id
=
channel_id
,
channel_name
=
channel_name
)
def
create_data_from_h2h
(
self
,
row
):
self
.
invoice_id
=
row
.
bit_061
.
strip
()
channel_name
=
get_channel_name_by_row
(
row
)
return
dict
(
id
=
row
.
id
,
stan
=
row
.
bit_011
,
ntb
=
row
.
bit_048
,
tgl
=
row
.
created
.
date
(),
jam
=
row
.
created
.
time
(),
nomor_bayar
=
self
.
invoice_id
,
nama_wp
=
row
.
bit_062_data
[
'Nama Penyetor'
],
pokok
=
row
.
bit_062_data
[
'Tagihan'
],
denda
=
row
.
bit_062_data
[
'Denda'
],
jml_bayar
=
int
(
row
.
bit_004
),
channel_id
=
row
.
bit_018
,
channel_name
=
channel_name
)
def
get_last_time
(
self
):
# Override
return
dmyhms
(
self
.
last_pay
.
created
)
def
get_filter_query
(
self
,
q
):
orm
=
self
.
base_q_pay
and
Payment
or
self
.
IsoLog
return
q
.
filter
(
Payment
.
created
>=
self
.
tgl_awal
,
Payment
.
created
<
self
.
tgl_akhir
+
one_day
)
orm
.
created
>=
self
.
tgl_awal
,
orm
.
created
<
self
.
tgl_akhir
+
one_day
)
def
get_count
(
self
):
# Override
q
=
self
.
prod_session
.
query
(
func
.
count
())
...
...
@@ -97,8 +120,14 @@ class App(BaseApp):
return
q
.
scalar
()
def
get_payment_query
(
self
):
# Override
q
=
self
.
get_filter_query
(
self
.
base_q_pay
)
return
q
.
order_by
(
Payment
.
created
)
if
self
.
base_q_pay
:
q
=
self
.
base_q_pay
orm
=
Payment
else
:
q
=
self
.
base_q_iso
orm
=
self
.
IsoLog
q
=
self
.
get_filter_query
(
q
)
return
q
.
order_by
(
orm
.
created
)
def
main
(
argv
=
sys
.
argv
[
1
:]):
...
...
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