Commit 03381fd4 by iWan Mustaqim

Discount Kabupaten Kuningan berdasarkan tempat pembayaran

1 parent dfb49827
0.4 2026-08-03
--------------
- Discount Kabupaten Kuningan berdasarkan tempat pembayaran
0.3.62 2026-08-02 0.3.62 2026-08-02
----------------- -----------------
- Discount Kota Tangerang - Discount Kota Tangerang
......
...@@ -3,7 +3,7 @@ requires = ['setuptools >= 64'] ...@@ -3,7 +3,7 @@ requires = ['setuptools >= 64']
[project] [project]
name = 'sismiop-models' name = 'sismiop-models'
version = '0.3.62' version = '0.4'
dependencies = [ dependencies = [
'sqlalchemy', 'sqlalchemy',
'zope.sqlalchemy', 'zope.sqlalchemy',
......
...@@ -258,9 +258,11 @@ def main(argv=sys.argv): ...@@ -258,9 +258,11 @@ def main(argv=sys.argv):
ket = 'berhasil dibayar' ket = 'berhasil dibayar'
print(f'{invoice_id} {ket}') print(f'{invoice_id} {ket}')
return return
tp = get_tp(cf)
with transaction.manager: with transaction.manager:
inq = Inquiry( inq = Inquiry(
invoice_id, persen_denda, tgl_bayar=tgl_bayar, debug=True) invoice_id, persen_denda, tgl_bayar=tgl_bayar, debug=True,
tp=tp)
if not inq.invoice: if not inq.invoice:
print(f'Invoice ID {invoice_id} tidak ada.') print(f'Invoice ID {invoice_id} tidak ada.')
if inq.debug_invoice and tgl_bayar: if inq.debug_invoice and tgl_bayar:
...@@ -279,7 +281,6 @@ def main(argv=sys.argv): ...@@ -279,7 +281,6 @@ def main(argv=sys.argv):
if not inq.is_available(): if not inq.is_available():
print('Tagihan tidak diperkenankan dibayar melalui jalur ini.') print('Tagihan tidak diperkenankan dibayar melalui jalur ini.')
return return
tp = get_tp(cf)
pay = inq.do_payment(tp, cf['nip_pencatat'], option.nominal) pay = inq.do_payment(tp, cf['nip_pencatat'], option.nominal)
show_payment(inq, pay) show_payment(inq, pay)
if option.reversal: if option.reversal:
......
...@@ -142,7 +142,7 @@ class Query: ...@@ -142,7 +142,7 @@ class Query:
class Inquiry(Query): class Inquiry(Query):
def __init__( def __init__(
self, invoice_id=None, persen_denda=2, invoice=None, self, invoice_id=None, persen_denda=2, invoice=None,
tgl_bayar=None, debug=False): tgl_bayar=None, debug=False, tp=dict()):
Query.__init__(self, invoice_id, invoice) Query.__init__(self, invoice_id, invoice)
self.debug_invoice = None self.debug_invoice = None
if not self.invoice: if not self.invoice:
...@@ -158,6 +158,7 @@ class Inquiry(Query): ...@@ -158,6 +158,7 @@ class Inquiry(Query):
if not self.is_available(): if not self.is_available():
self.invoice = None self.invoice = None
return return
self.tp = tp
self.persen_denda = self.get_persen_denda() self.persen_denda = self.get_persen_denda()
# Digunakan untuk ISO8583 # Digunakan untuk ISO8583
self.tagihan = self.denda = self.discount = self.total = 0 self.tagihan = self.denda = self.discount = self.total = 0
......
...@@ -10,8 +10,8 @@ from .cilegon import ( ...@@ -10,8 +10,8 @@ from .cilegon import (
from .base import get_db_session from .base import get_db_session
AWAL_DISC = date(2026, 2, 14) AWAL_DISC = date(2026, 8, 1)
AKHIR_DISC = date(2026, 4, 30) AKHIR_DISC = date(2026, 10, 31)
class Inquiry(BaseInquiry): class Inquiry(BaseInquiry):
...@@ -49,6 +49,7 @@ class Inquiry(BaseInquiry): ...@@ -49,6 +49,7 @@ class Inquiry(BaseInquiry):
return 0 return 0
if AWAL_DISC <= self.tgl_bayar <= AKHIR_DISC: if AWAL_DISC <= self.tgl_bayar <= AKHIR_DISC:
if '2014' <= self.invoice.thn_pajak_sppt <= '2025': if '2014' <= self.invoice.thn_pajak_sppt <= '2025':
if self.tp['kd_tp'] == '49': # BJB MOBILE ?
return self.denda return self.denda
return 0 return 0
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!