Commit 91bf4c9a by sugiana

Rumus discount Kabupaten Cirebon

1 parent 24be694c
0.1.32 2022-1-20
----------------
- Rumus discount pokok dan discount denda Kabupaten Cirebon
0.1.31 2022-1-9
---------------
- Perubahan rumus discount denda untuk Kota Tasik
......
......@@ -11,19 +11,20 @@ from .default import (
)
AKHIR_DISC = date(2021, 10, 31)
AKHIR_DISC_DENDA = date(2022, 3, 31)
# Discount pokok berdasarkan bulan
NILAI_DISC = {
2: 0.1,
3: 0.1,
4: 0.1,
NILAI_DISC_POKOK = {
1: 0.12,
2: 0.12,
3: 0.12,
4: 0.12,
5: 0.1,
6: 0.1,
7: 0.1,
8: 0.08,
9: 0.08,
10: 0.05}
8: 0.07,
9: 0.07,
10: 0.07}
class Inquiry(BaseInquiry):
......@@ -32,16 +33,22 @@ class Inquiry(BaseInquiry):
def hitung_discount(self): # Override
self.discount_pokok = self.discount_denda = 0
if self.invoice.thn_pajak_sppt != '2021'\
or self.tgl_bayar > AKHIR_DISC:
return
potongan = NILAI_DISC[self.tgl_bayar.month]
if self.invoice.thn_pajak_sppt >= '2009' \
and self.invoice.thn_pajak_sppt <= '2021':
if self.tgl_bayar <= AKHIR_DISC_DENDA:
self.discount = self.discount_denda = self.denda
elif self.invoice.thn_pajak_sppt == '2022' \
and self.tgl_bayar.year == 2022 \
and self.tgl_bayar.month in NILAI_DISC_POKOK:
potongan = NILAI_DISC_POKOK[self.tgl_bayar.month]
self.discount = self.discount_pokok = int(potongan * self.tagihan)
def before_save(self, payment): # Override
# Catat sebagai bruto, ujar Gilang
payment.jml_sppt_yg_dibayar = self.tagihan + self.denda
payment.denda_sblm_diskon = self.denda
payment.discount_pokok = self.discount
payment.discount_denda = 0
payment.discount_pokok = self.discount_pokok
payment.discount_denda = self.discount_denda
class Reversal(BaseReversal):
......@@ -49,7 +56,8 @@ class Reversal(BaseReversal):
return PembayaranSppt
def before_save(self): # Override
self.payment.discount_pokok = 0
self.payment.discount_pokok = self.payment.discount_denda = \
self.payment.denda_sblm_diskon = 0
class AvailableInvoice(BaseAvailableInvoice):
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!