Commit 0a978197 by Owo Sugiana

Discount Kota Bekasi

1 parent d9b16af5
0.2.8 2023-08-06
----------------
- Discount Kota Bekasi
0.2.7 2023-07-31 0.2.7 2023-07-31
---------------- ----------------
- Discount Kota Tangerang - Discount Kota Tangerang
......
...@@ -14,8 +14,8 @@ from .binjai import ( ...@@ -14,8 +14,8 @@ from .binjai import (
) )
AWAL_DISC = date(2022, 10, 28) AWAL_DISC_DENDA = date(2023, 8, 7)
AKHIR_DISC = date(2022, 11, 28) AKHIR_DISC_DENDA = date(2023, 9, 30)
class Inquiry(BaseInquiry): class Inquiry(BaseInquiry):
...@@ -25,9 +25,16 @@ class Inquiry(BaseInquiry): ...@@ -25,9 +25,16 @@ class Inquiry(BaseInquiry):
self.tagihan = self.denda = self.discount = self.total = 0 self.tagihan = self.denda = self.discount = self.total = 0
def hitung_discount(self): # Override def hitung_discount(self): # Override
if self.tgl_bayar < AWAL_DISC or self.tgl_bayar > AKHIR_DISC: discount_denda = discount_pokok = 0
return if AWAL_DISC_DENDA <= self.tgl_bayar <= AKHIR_DISC_DENDA:
self.discount = self.denda discount_denda = self.denda
if self.tgl_bayar.year == 2023:
if self.tgl_bayar.month == 8 and self.tgl_bayar.day >= 7:
discount_pokok = 0.17 * self.tagihan
elif self.tgl_bayar.month == 9:
discount_pokok = 0.1 * self.tagihan
discount_pokok = int(discount_pokok)
self.discount = discount_denda + discount_pokok
def before_save(self, payment): # Override def before_save(self, payment): # Override
payment.denda_sppt = self.denda - self.discount payment.denda_sppt = self.denda - self.discount
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!