Commit 40c8ebec by Owo Sugiana

Rumus discount denda Kota Bogor

1 parent 60e48289
0.1.45 2022-10-9
----------------
- Rumus discount denda Kota Bogor
0.1.44 2022-10-1
----------------
- Tambah Kabupaten Bandung
......
......@@ -15,9 +15,8 @@ from .default import (
)
# Discount pokok berdasarkan bulan
DISC_POKOK_2022 = {2: 0.15, 3: 0.1, 4: 0.05}
DISC_POKOK_MAX_2017 = {2: 0.2, 3: 0.2, 4: 0.2}
AWAL_DISC = date(2022, 10, 10)
AKHIR_DISC = date(2022, 12, 23)
class Common(Query):
......@@ -59,31 +58,25 @@ class Inquiry(BaseInquiry, Common):
pst = q.first()
return pst and pst.no_sk and pst.status_sk_peng_pst != '2'
def hitung_discount_pokok(self):
if self.invoice.thn_pajak_sppt == '2022':
potongan = DISC_POKOK_2022[self.tgl_bayar.month]
elif self.invoice.thn_pajak_sppt <= '2017':
potongan = DISC_POKOK_MAX_2017[self.tgl_bayar.month]
else:
return
self.discount_pokok = int(potongan * self.tagihan)
def hitung_discount_denda(self):
if self.invoice.thn_pajak_sppt <= '2021':
self.discount_denda = self.denda
self.discount_denda = self.denda
def hitung_discount(self): # Override
self.discount_pokok = self.discount_denda = 0
if self.tgl_bayar.year > 2022:
if self.tgl_bayar < AWAL_DISC:
return
if self.tgl_bayar.month not in (2, 3, 4):
if self.tgl_bayar > AKHIR_DISC:
return
if self.invoice.thn_pajak_sppt > '2022':
return
if self.tgl_bayar.year > 2022:
return
if not self.is_e_sppt():
return
if self.denda:
self.hitung_discount_denda()
if not self.is_pst():
self.hitung_discount_pokok()
# if not self.is_pst(): # Sertakan ini bila ada discount pokok
# 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!