Commit 41c09004 by Owo Sugiana

Discount Kota Bekasi

1 parent ce6dc266
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
----------------- -----------------
- Discount Kota Tangerang Selatan - Discount Kota Tangerang Selatan
- Discount Kota Sukabumi - Discount Kota Sukabumi
- Discount Kota Bekasi
0.3.39 2025-09-21 0.3.39 2025-09-21
----------------- -----------------
......
...@@ -23,8 +23,8 @@ from .binjai import ( ...@@ -23,8 +23,8 @@ from .binjai import (
MAX_BULAN_DENDA = 24 MAX_BULAN_DENDA = 24
AWAL_DISC_DENDA = date(2025, 2, 1) AWAL_DISC = date(2025, 10, 1)
AKHIR_DISC_DENDA = date(2025, 5, 31) AKHIR_DISC = date(2025, 11, 30)
def hitung_denda(tagihan, jatuh_tempo, tgl_hitung): def hitung_denda(tagihan, jatuh_tempo, tgl_hitung):
...@@ -72,40 +72,31 @@ class Inquiry(BaseInquiry): ...@@ -72,40 +72,31 @@ class Inquiry(BaseInquiry):
self.denda = round_up(denda) self.denda = round_up(denda)
def hitung_discount_pokok(self): def hitung_discount_pokok(self):
if self.tgl_bayar.year != 2025:
return
if self.invoice.faktor_pengurang_sppt: if self.invoice.faktor_pengurang_sppt:
return return
thn = self.invoice.thn_pajak_sppt thn = self.invoice.thn_pajak_sppt
disc = 0 if thn == '2024':
if thn == '2025': disc = 0.1
if 2 <= self.tgl_bayar.month <= 3: elif '2020' <= thn <= '2023':
disc = 0.15 disc = 0.25
elif 4 <= self.tgl_bayar.month <= 5: elif '2013' <= thn <= '2019':
disc = 0.1 disc = 0.5
elif '2019' <= thn <= '2024':
if 2 <= self.tgl_bayar.month <= 5:
disc = 0.1
elif '2013' <= thn <= '2018':
if 2 <= self.tgl_bayar.month <= 5:
disc = 0.2
elif thn < '2013': elif thn < '2013':
if 2 <= self.tgl_bayar.month <= 3: disc = 0.75
disc = 0.5 else:
elif 4 <= self.tgl_bayar.month <= 5: disc = 0
disc = 0.4
if disc: if disc:
self.discount_pokok = disc * self.tagihan self.discount_pokok = disc * self.tagihan
self.discount_pokok = int(self.discount_pokok) self.discount_pokok = int(self.discount_pokok)
def hitung_discount_denda(self): def hitung_discount_denda(self):
if AWAL_DISC_DENDA <= self.tgl_bayar <= AKHIR_DISC_DENDA: self.discount_denda = self.denda
self.discount_denda = self.denda
def hitung_discount(self): # Override def hitung_discount(self): # Override
self.discount_denda = self.discount_pokok = 0 self.discount_denda = self.discount_pokok = 0
self.hitung_discount_pokok() if AWAL_DISC <= self.tgl_bayar <= AKHIR_DISC:
self.hitung_discount_denda() self.hitung_discount_pokok()
self.hitung_discount_denda()
self.discount = self.discount_denda + self.discount_pokok self.discount = self.discount_denda + self.discount_pokok
def before_save(self, payment): # Override 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!