Commit 70f63f3a by Owo Sugiana

Discount pokok Kabupaten Cirebon 7,9% 1 Agustus - 31 Oktober

1 parent 83f7f41f
0.3.11 2024-07-28
-----------------
- Kabupaten Cirebon discount pokok 7,9% periode 1 Agustus - 31 Oktober 2024.
0.3.10 2024-07-07
-----------------
- Rumus Kota Bekasi
......
......@@ -416,7 +416,7 @@ class AvailableInvoice(Query):
if not inv:
continue
inq = inq_cls(invoice=inv)
if inq.total < 1:
if not inq.invoice or inq.total < 1:
continue
no += 1
msg = self.get_msg(inq)
......
......@@ -10,20 +10,8 @@ from .default import (
)
AKHIR_DISC_DENDA = date(2022, 12, 31)
# Discount pokok berdasarkan bulan
NILAI_DISC_POKOK = {
1: 0.12,
2: 0.12,
3: 0.12,
4: 0.12,
5: 0.1,
6: 0.1,
7: 0.1,
8: 0.07,
9: 0.07,
10: 0.07}
AWAL_DISC_POKOK = date(2024, 8, 1)
AKHIR_DISC_POKOK = date(2024, 10, 31)
class Inquiry(BaseInquiry):
......@@ -53,14 +41,11 @@ class Inquiry(BaseInquiry):
def hitung_discount(self): # Override
self.discount_pokok = self.discount_denda = 0
if self.invoice.thn_pajak_sppt >= '2009' \
and self.invoice.thn_pajak_sppt <= '2021':
if self.tgl_bayar <= AKHIR_DISC_DENDA:
self.discount = self.discount_denda = self.denda
elif self.invoice.thn_pajak_sppt == '2022' \
and self.tgl_bayar.year == 2022 \
and self.tgl_bayar.month in NILAI_DISC_POKOK:
potongan = NILAI_DISC_POKOK[self.tgl_bayar.month]
if self.invoice.thn_pajak_sppt == '2024':
if AWAL_DISC_POKOK <= self.tgl_bayar <= AKHIR_DISC_POKOK:
potongan = 0.079
else:
return
self.discount = self.discount_pokok = int(potongan * self.tagihan)
def before_save(self, payment): # Override
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!