Commit 607ef627 by Owo Sugiana

Opsen pada Kabupaten Magelang

1 parent cfcf914b
......@@ -371,6 +371,8 @@ class Payment(Base):
denda = Column(Integer)
jml_bayar = Column(Integer)
is_valid = Column(Integer)
opsen_pokok = Column(Float)
opsen_denda = Column(Float)
__table_args__ = (
UniqueConstraint('tahun', 'sspdno'),
dict(schema='pad'))
......
......@@ -302,6 +302,7 @@ class Inquiry(BaseInquiry):
def hitung_tagihan(self):
self.pokok = self.invoice.pajak_terhutang - self.invoice.bunga
self.pokok = round_up(self.pokok)
self.total_pokok = self.pokok + self.invoice.opsen_pokok
self.total_pokok = round_up(self.total_pokok)
self.opsen_pokok = round_up(self.invoice.opsen_pokok)
......@@ -315,6 +316,7 @@ class Inquiry(BaseInquiry):
if self.invoice.status_pembayaran == 0:
self.hitung_denda_waktu()
self.denda_pokok += self.invoice.bunga
self.denda_pokok = round_up(self.denda_pokok)
else:
self.bln_tunggakan = self.denda_pokok = self.opsen_denda = 0
self.discount_denda_pokok, self.discount_opsen_denda = \
......
......@@ -28,16 +28,12 @@ AWAL_BAYAR_DENDA_1_PERSEN = date(2025, 2, 1)
class Inquiry(BaseInquiry):
invoice_id_structure = INVOICE_ID
def hitung_denda_waktu(self): # Override
def get_persen_denda(self): # Override
tgl_terbit = self.get_jatuh_tempo()
if tgl_terbit >= AWAL_MASA_DENDA_1_PERSEN and \
self.tgl_bayar.date() >= AWAL_BAYAR_DENDA_1_PERSEN:
persen_denda = 1
else:
persen_denda = 2
self.bln_tunggakan, self.denda_waktu = hitung_denda(
self.tagihan, self.invoice.jatuhtempotgl, persen_denda,
self.tgl_bayar.date())
return 1
return 2
def get_kohir_model(self): # Override
return Kohir
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!