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 1c0d1eaa
authored
May 19, 2025
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Tambah pengenalan tabel gw_payment di PBB
1 parent
7c8c468c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
8 deletions
CHANGES.txt
payment_report/models.py
payment_report/pbb/default.py
CHANGES.txt
View file @
1c0d1ea
3.1.8 2025-05-19
----------------
- Tambah pengenalan tabel gw_payment di PBB
3.1.7 2025-02-27
----------------
- Tambah PKB
...
...
payment_report/models.py
View file @
1c0d1ea
...
...
@@ -198,6 +198,10 @@ class Pbb(Base, Common):
user_id
=
Column
(
String
(
16
))
# Bit 32
bank_id
=
Column
(
String
(
4
))
# pembayaran_sppt.kd_tp
kd_tp
=
Column
(
String
(
2
))
# NOP + tahun
sppt_id
=
Column
(
String
(
22
),
nullable
=
False
)
tgl_batal
=
Column
(
DateTime
(
timezone
=
True
))
__table_args__
=
(
UniqueConstraint
(
...
...
payment_report/pbb/default.py
View file @
1c0d1ea
...
...
@@ -6,6 +6,8 @@ from sqlalchemy import (
Column
,
Integer
,
String
,
DateTime
,
Text
,
UniqueConstraint
,
func
,
)
...
...
@@ -36,6 +38,7 @@ from ..common import (
VaPayment
,
InvalidSource
,
str2dict
,
BIT_18_NAMES
,
)
...
...
@@ -89,6 +92,19 @@ class JsonLog(Base):
dict
(
schema
=
'public'
))
class
ApiLog
(
Base
):
__tablename__
=
'gw_payment'
id
=
Column
(
Integer
,
primary_key
=
True
)
tgl
=
Column
(
DateTime
(
timezone
=
True
),
nullable
=
True
)
bit_004
=
Column
(
Text
,
nullable
=
False
)
# Nilai transaksi
bit_011
=
Column
(
Text
,
nullable
=
False
)
# STAN
bit_018
=
Column
(
Text
,
nullable
=
False
)
# Channel
bit_032
=
Column
(
Text
,
nullable
=
False
)
# Bank
bit_037
=
Column
(
Text
,
nullable
=
False
)
# NTB
bit_047
=
Column
(
Text
,
nullable
=
False
)
# NTP
bit_061
=
Column
(
Text
,
nullable
=
False
)
# Invoice ID
class
App
(
BaseApp
):
conf_name
=
'pbb payment last date'
report_orm
=
Pbb
...
...
@@ -140,6 +156,12 @@ class App(BaseApp):
self
.
base_q_json
=
self
.
json_session
.
query
(
JsonLog
)
else
:
self
.
json_session
=
None
if
'api_db_url'
in
self
.
conf
:
factory
=
self
.
get_factory
(
'api_db_url'
)
self
.
api_session
=
factory
()
self
.
base_q_api
=
self
.
api_session
.
query
(
ApiLog
)
else
:
self
.
api_session
=
None
def
get_log_model
(
self
):
return
self
.
is_universal_log
and
UniversalLog
or
Log
...
...
@@ -205,7 +227,7 @@ class App(BaseApp):
self
.
warning_date
(
psppt
)
return
row_pay
,
row_inq
=
row
iso
=
get_iso
(
row_pay
.
iso_request
,
Doc
,
self
.
option
.
debug
)
iso
=
get_iso
(
row_pay
.
iso_request
,
Doc
)
info
=
get_channel_info_by_iso
(
iso
)
try
:
user_id
=
iso
.
getBit
(
107
)
...
...
@@ -264,6 +286,17 @@ class App(BaseApp):
nama
=
get_channel_name_by_dict
(
d
)
return
kode
,
nama
,
d
[
'bit_011'
],
row
.
ntb
,
kode
def
get_api
(
self
,
psppt
):
if
not
self
.
api_session
:
return
q
=
self
.
base_q_api
.
filter_by
(
bit_059
=
'4'
,
bit_061
=
self
.
invoice_id
)
q
=
q
.
order_by
(
ApiLog
.
id
.
desc
())
row
=
q
.
first
()
if
not
row
:
return
channel_nama
=
BIT_18_NAMES
[
row
.
bit_018
]
return
row
.
bit_018
,
channel_nama
,
row
.
bit_011
,
row
.
bit_037
,
row
.
bit_032
def
get_source
(
self
,
psppt
):
source
=
self
.
get_iso_v2
()
tgl_inquiry
=
user_id
=
stan
=
ntb
=
bank_id
=
None
...
...
@@ -279,12 +312,16 @@ class App(BaseApp):
if
source
:
channel_kode
,
channel_nama
,
stan
,
ntb
,
bank_id
=
source
else
:
channel_kode
=
'0000'
tgl
=
psppt
.
tgl_rekam_byr_sppt
.
date
()
channel_nama
=
self
.
get_va_channel
(
tgl
)
if
not
channel_nama
:
kd_tp
=
psppt
.
kd_tp
.
strip
()
channel_nama
=
self
.
kd_tp
.
get
(
kd_tp
,
'MANUAL'
)
source
=
self
.
get_api
(
psppt
)
if
source
:
channel_kode
,
channel_nama
,
stan
,
ntb
,
bank_id
=
source
else
:
channel_kode
=
'0000'
tgl
=
psppt
.
tgl_rekam_byr_sppt
.
date
()
channel_nama
=
self
.
get_va_channel
(
tgl
)
if
not
channel_nama
:
kd_tp
=
psppt
.
kd_tp
.
strip
()
channel_nama
=
self
.
kd_tp
.
get
(
kd_tp
,
'MANUAL'
)
return
channel_kode
,
channel_nama
,
stan
,
ntb
,
bank_id
,
user_id
,
\
tgl_inquiry
...
...
@@ -320,7 +357,8 @@ class App(BaseApp):
tgl_rekam_byr_sppt
=
psppt
.
tgl_rekam_byr_sppt
,
nm_wp_sppt
=
sppt
.
nm_wp_sppt
,
channel_kode
=
channel_kode
,
channel_nama
=
channel_nama
,
bank_id
=
bank_id
,
user_id
=
user_id
,
pbb_yg_harus_dibayar_sppt
=
pokok
)
pbb_yg_harus_dibayar_sppt
=
pokok
,
kd_tp
=
psppt
.
kd_tp
,
sppt_id
=
self
.
invoice_id
)
def
get_report
(
self
,
psppt
):
# Override
q
=
self
.
rpt_session
.
query
(
Pbb
)
.
filter_by
(
...
...
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