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
----------------
- Kota Tangerang berlaku denda surut yaitu seluruh tahun pajak sebesar 1%
......
......@@ -15,8 +15,11 @@ from .default import (
)
AWAL_DISC = date(2022, 10, 10)
AKHIR_DISC = date(2022, 12, 23)
DISC = {
2: 0.15,
3: 0.1,
4: 0.05,
}
class Common(Query):
......@@ -58,25 +61,23 @@ class Inquiry(BaseInquiry, Common):
pst = q.first()
return pst and pst.no_sk and pst.status_sk_peng_pst != '2'
def hitung_discount_denda(self):
self.discount_denda = self.denda
def hitung_discount(self): # Override
self.discount_pokok = self.discount_denda = 0
if self.tgl_bayar < AWAL_DISC:
def hitung_discount_pokok(self):
if not self.is_e_sppt():
return
if self.tgl_bayar > AKHIR_DISC:
if self.is_pst():
return
if self.invoice.thn_pajak_sppt > '2022':
if self.invoice.thn_pajak_sppt != '2024':
return
if self.tgl_bayar.year > 2022:
if self.tgl_bayar.year != 2024:
return
if not self.is_e_sppt():
potongan = DISC.get(self.tgl_bayar.month)
if not potongan:
return
if self.denda:
self.hitung_discount_denda()
# if not self.is_pst(): # Sertakan ini bila ada discount pokok
# self.hitung_discount_pokok()
self.discount_pokok = int(self.tagihan * potongan)
def hitung_discount(self): # Override
self.discount_pokok = self.discount_denda = 0
self.hitung_discount_pokok()
self.discount = self.discount_pokok + self.discount_denda
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!