Commit 0c8a3d1b by Owo Sugiana

Discount pokok dan denda Kota Bekasi

1 parent a069c21b
0.3.27 2025-01-30
-----------------
- Discount pokok dan denda Kota Bekasi
0.3.26 2025-01-03
-----------------
- Discount pokok Kota Tangerang Selatan
......
......@@ -3,7 +3,7 @@ requires = ['setuptools >= 64']
[project]
name = 'sismiop-models'
version = '0.3.26'
version = '0.3.27'
dependencies = [
'sqlalchemy',
'zope.sqlalchemy',
......
......@@ -22,12 +22,8 @@ from .binjai import (
)
DISC_POKOK = [
(date(2024, 7, 8), date(2024, 8, 18), 0.1),
(date(2024, 8, 19), date(2024, 9, 30), 0.05),
]
AWAL_DISC_DENDA = date(2024, 7, 8)
AKHIR_DISC_DENDA = date(2024, 9, 30)
AWAL_DISC_DENDA = date(2025, 2, 1)
AKHIR_DISC_DENDA = date(2025, 5, 31)
def hitung_denda(tagihan, jatuh_tempo, tgl_hitung):
......@@ -65,20 +61,42 @@ class Inquiry(BaseInquiry):
self.tagihan, self.get_jatuh_tempo(), tgl_bayar)
self.denda = round_up(denda)
def hitung_discount(self): # Override
self.discount_denda = self.discount_pokok = 0
if self.tgl_bayar.year != 2024:
def hitung_discount_pokok(self):
if self.tgl_bayar.year != 2025:
return
if self.invoice.thn_pajak_sppt == '2024':
if not self.invoice.faktor_pengurang_sppt:
for awal, akhir, potongan in DISC_POKOK:
if awal <= self.tgl_bayar <= akhir:
self.discount_pokok = potongan * self.tagihan
if self.invoice.faktor_pengurang_sppt:
return
thn = self.invoice.thn_pajak_sppt
disc = 0
if thn == '2025':
if 2 <= self.tgl_bayar.month <= 3:
disc = 0.15
elif 4 <= self.tgl_bayar.month <= 5:
disc = 0.1
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':
if 2 <= self.tgl_bayar.month <= 3:
disc = 0.5
elif 4 <= self.tgl_bayar.month <= 5:
disc = 0.4
if disc:
self.discount_pokok = disc * self.tagihan
self.discount_pokok = int(self.discount_pokok)
break
def hitung_discount_denda(self):
if self.invoice.thn_pajak_sppt <= '2024':
if AWAL_DISC_DENDA <= self.tgl_bayar <= AKHIR_DISC_DENDA:
self.discount_denda = self.denda
def hitung_discount(self): # Override
self.discount_denda = self.discount_pokok = 0
self.hitung_discount_pokok()
self.hitung_discount_denda()
self.discount = self.discount_denda + self.discount_pokok
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!