Commit aaf48853 by Owo Sugiana

Discount Pokok di Kota Bogor

1 parent 508d4d3a
0.3.4 2024-01-31
----------------
- Discount Pokok di Kota Bogor
0.3.3 2024-01-30 0.3.3 2024-01-30
---------------- ----------------
- Kota Tangerang berlaku denda surut yaitu seluruh tahun pajak sebesar 1% - Kota Tangerang berlaku denda surut yaitu seluruh tahun pajak sebesar 1%
......
...@@ -15,8 +15,11 @@ from .default import ( ...@@ -15,8 +15,11 @@ from .default import (
) )
AWAL_DISC = date(2022, 10, 10) DISC = {
AKHIR_DISC = date(2022, 12, 23) 2: 0.15,
3: 0.1,
4: 0.05,
}
class Common(Query): class Common(Query):
...@@ -58,25 +61,23 @@ class Inquiry(BaseInquiry, Common): ...@@ -58,25 +61,23 @@ class Inquiry(BaseInquiry, Common):
pst = q.first() pst = q.first()
return pst and pst.no_sk and pst.status_sk_peng_pst != '2' return pst and pst.no_sk and pst.status_sk_peng_pst != '2'
def hitung_discount_denda(self): def hitung_discount_pokok(self):
self.discount_denda = self.denda if not self.is_e_sppt():
def hitung_discount(self): # Override
self.discount_pokok = self.discount_denda = 0
if self.tgl_bayar < AWAL_DISC:
return return
if self.tgl_bayar > AKHIR_DISC: if self.is_pst():
return return
if self.invoice.thn_pajak_sppt > '2022': if self.invoice.thn_pajak_sppt != '2024':
return return
if self.tgl_bayar.year > 2022: if self.tgl_bayar.year != 2024:
return return
if not self.is_e_sppt(): potongan = DISC.get(self.tgl_bayar.month)
if not potongan:
return return
if self.denda: self.discount_pokok = int(self.tagihan * potongan)
self.hitung_discount_denda()
# if not self.is_pst(): # Sertakan ini bila ada discount pokok def hitung_discount(self): # Override
# self.hitung_discount_pokok() self.discount_pokok = self.discount_denda = 0
self.hitung_discount_pokok()
self.discount = self.discount_pokok + self.discount_denda self.discount = self.discount_pokok + self.discount_denda
def before_save(self, bayar): # Override def before_save(self, bayar): # Override
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!