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