Commit c9ec8726 by Owo Sugiana

Jatuh tempo 2024 ke atas dendanya 1%

1 parent 45d884ac
0.5.1 2024-01-07
----------------
- Jatuh tempo 2024 ke atas dendanya 1%, tidak lagi berdasarkan field masadari
atau tanggal kohir, kecuali Kota Tangerang Selatan.
0.5 2024-01-03
--------------
- Tahun Terbit 2024 ke atas dendanya 1%
......
......@@ -59,11 +59,6 @@ class BaseInquiry:
self.invoice = self.get_invoice()
if not self.invoice:
return
tgl_kohir = self.get_tgl_kohir()
if tgl_kohir:
self.tahun_terbit = tgl_kohir.year
else:
self.tahun_terbit = self.invoice.masadari.year
if not self.is_available():
self.invoice = None
......@@ -323,7 +318,8 @@ class Inquiry(BaseInquiry):
self.denda -= self.discount_denda
def hitung_denda_waktu(self):
if self.tahun_terbit > 2023:
tahun_terbit = self.get_jatuh_tempo().year
if tahun_terbit > 2023:
persen_denda = 1
else:
persen_denda = self.conf['persen_denda']
......
......@@ -71,6 +71,20 @@ class Inquiry(BaseInquiry):
return self.denda
return 0
def hitung_denda_waktu(self): # Override
tgl_kohir = self.get_tgl_kohir()
if tgl_kohir:
tahun_terbit = tgl_kohir.year
else:
tahun_terbit = self.invoice.masadari.year
if tahun_terbit > 2023:
persen_denda = 1
else:
persen_denda = self.conf['persen_denda']
self.bln_tunggakan, self.denda_waktu = hitung_denda(
self.tagihan, self.invoice.jatuhtempotgl, persen_denda,
self.tgl_bayar.date())
def before_save(self, pay): # Override
pay.discount_denda = self.discount_denda
if self.notes:
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!