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 0.1.44 2022-10-1
---------------- ----------------
- Tambah Kabupaten Bandung - Tambah Kabupaten Bandung
......
...@@ -15,9 +15,8 @@ from .default import ( ...@@ -15,9 +15,8 @@ from .default import (
) )
# Discount pokok berdasarkan bulan AWAL_DISC = date(2022, 10, 10)
DISC_POKOK_2022 = {2: 0.15, 3: 0.1, 4: 0.05} AKHIR_DISC = date(2022, 12, 23)
DISC_POKOK_MAX_2017 = {2: 0.2, 3: 0.2, 4: 0.2}
class Common(Query): class Common(Query):
...@@ -59,31 +58,25 @@ class Inquiry(BaseInquiry, Common): ...@@ -59,31 +58,25 @@ 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_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): 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 def hitung_discount(self): # Override
self.discount_pokok = self.discount_denda = 0 self.discount_pokok = self.discount_denda = 0
if self.tgl_bayar.year > 2022: if self.tgl_bayar < AWAL_DISC:
return 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 return
if not self.is_e_sppt(): if not self.is_e_sppt():
return return
if self.denda: if self.denda:
self.hitung_discount_denda() self.hitung_discount_denda()
if not self.is_pst(): # if not self.is_pst(): # Sertakan ini bila ada discount pokok
self.hitung_discount_pokok() # 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!