Commit d639c18e by Owo Sugiana

Discount 2023 Tangerang Selatan

1 parent 26a92aea
0.1.41 2022-12-30
-----------------
- Discount 2023 untuk Tangerang Selatan
0.1.40 2022-8-6 0.1.40 2022-8-6
--------------- ---------------
- Di Tangerang Selatan discount pokok tidak perlu memperhatikan nilai - Di Tangerang Selatan discount pokok tidak perlu memperhatikan nilai
......
...@@ -22,8 +22,13 @@ from .default import ( ...@@ -22,8 +22,13 @@ from .default import (
from ..models.tangsel import PembayaranSppt from ..models.tangsel import PembayaranSppt
AWAL_DISC = date(2022, 8, 1) AKHIR_DISC_2022 = date(2022, 12, 31)
AKHIR_DISC = date(2022, 12, 31)
AWAL_DISC_PERIODE_1 = date(2023, 1, 1)
AKHIR_DISC_PERIODE_1 = date(2023, 4, 30)
AWAL_DISC_PERIODE_2 = date(2023, 5, 1)
AKHIR_DISC_PERIODE_2 = date(2023, 6, 30)
class Inquiry(BaseInquiry): class Inquiry(BaseInquiry):
...@@ -81,14 +86,47 @@ class Inquiry(BaseInquiry): ...@@ -81,14 +86,47 @@ class Inquiry(BaseInquiry):
disc = 0 disc = 0
return int(disc * self.tagihan) return int(disc * self.tagihan)
def hitung_discount(self): # Override def hitung_discount_2022(self):
self.discount_pokok = self.discount_denda = 0 if self.tgl_bayar > AKHIR_DISC_2022:
if self.tgl_bayar < AWAL_DISC or self.tgl_bayar > AKHIR_DISC:
return return
if self.tahun_2022_belum_lunas(): if self.tahun_2022_belum_lunas():
return return
self.discount_denda = self.hitung_discount_denda() self.discount_denda = self.hitung_discount_denda()
self.discount_pokok = self.hitung_discount_pokok() self.discount_pokok = self.hitung_discount_pokok()
return True
def hitung_discount_denda_periode_1(self):
if self.invoice.thn_pajak_sppt < '2023':
return self.denda # discount 100%
return 0
def hitung_discount_pokok_periode_1(self):
if self.invoice.thn_pajak_sppt == '2023':
disc = 0.1
elif self.invoice.thn_pajak_sppt >= '2014' and \
self.invoice.thn_pajak_sppt <= '2022':
disc = 0.3
else:
disc = 0.75
return int(disc * self.tagihan)
def hitung_discount_pokok_periode_2(self):
if self.invoice.thn_pajak_sppt == '2023':
disc = 0.05
return int(disc * self.tagihan)
return 0
def hitung_discount(self): # Override
self.discount_pokok = self.discount_denda = 0
if self.hitung_discount_2022():
return
if self.tgl_bayar >= AWAL_DISC_PERIODE_1 and \
self.tgl_bayar <= AKHIR_DISC_PERIODE_1:
self.discount_denda = self.hitung_discount_denda_periode_1()
self.discount_pokok = self.hitung_discount_pokok_periode_1()
elif self.tgl_bayar >= AWAL_DISC_PERIODE_2 and \
self.tgl_bayar <= AKHIR_DISC_PERIODE_2:
self.discount_pokok = self.hitung_discount_pokok_periode_2()
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!