Commit 510885b7 by Owo Sugiana

Discount Kota Bogor

1 parent 4c5ea6f2
0.3.29 2025-04-27
-----------------
- Discount Kota Bogor
0.3.28 2025-02-20
-----------------
- Discount Kota Tangerang menggunakan round() ketimbang int() sesuai rumus
......
......@@ -3,7 +3,7 @@ requires = ['setuptools >= 64']
[project]
name = 'sismiop-models'
version = '0.3.27'
version = '0.3.29'
dependencies = [
'sqlalchemy',
'zope.sqlalchemy',
......
......@@ -15,11 +15,13 @@ from .default import (
)
DISC = {
2: 0.15,
3: 0.1,
4: 0.05,
}
DISC_POKOK = [
(date(2025, 4, 28), date(2025, 5, 27), 0.1),
(date(2025, 5, 28), date(2025, 6, 28), 0.05),
]
DISC_DENDA_AWAL = date(2025, 4, 28)
DISC_DENDA_AKHIR = date(2025, 6, 28)
class Common(Query):
......@@ -66,18 +68,25 @@ class Inquiry(BaseInquiry, Common):
return
if self.is_pst():
return
if self.invoice.thn_pajak_sppt != '2024':
if self.invoice.thn_pajak_sppt != '2025':
return
if self.tgl_bayar.year != 2024:
for awal, akhir, potongan in DISC_POKOK:
if awal <= self.tgl_bayar <= akhir:
self.discount_pokok = int(self.tagihan * potongan)
return
def hitung_discount_denda(self):
if not self.is_e_sppt():
return
potongan = DISC.get(self.tgl_bayar.month)
if not potongan:
if self.invoice.thn_pajak_sppt > '2024':
return
self.discount_pokok = int(self.tagihan * potongan)
if DISC_DENDA_AWAL <= self.tgl_bayar <= DISC_DENDA_AKHIR:
self.discount_denda = self.denda
def hitung_discount(self): # Override
self.discount_pokok = self.discount_denda = 0
self.hitung_discount_pokok()
self.hitung_discount_denda()
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!