Commit 3be9b74a by h2h

Discount pokok Kota Tangerang

1 parent 039e7ce7
0.1.21 2021-02-07
-----------------
- Discount pokok Kota Tangerang
0.1.20 2021-02-07 0.1.20 2021-02-07
----------------- -----------------
- Penambahan Kota Binjai - Penambahan Kota Binjai
......
...@@ -138,6 +138,7 @@ class Inquiry(Query): ...@@ -138,6 +138,7 @@ class Inquiry(Query):
self, invoice_id=None, persen_denda=2, invoice=None, self, invoice_id=None, persen_denda=2, invoice=None,
tgl_bayar=None, debug=False): tgl_bayar=None, debug=False):
Query.__init__(self, invoice_id, invoice) Query.__init__(self, invoice_id, invoice)
self.debug_invoice = None
if not self.invoice: if not self.invoice:
return return
if debug: if debug:
......
...@@ -8,35 +8,16 @@ from .tangsel import ( ...@@ -8,35 +8,16 @@ from .tangsel import (
from ..models.tangsel import PembayaranSppt from ..models.tangsel import PembayaranSppt
AWAL_DISC = date(2020, 10, 1) AWAL_DISC = date(2021, 3, 22)
AKHIR_DISC = date(2020, 12, 23) AKHIR_DISC = date(2021, 6, 30)
TAHUN_PAJAK_DISC_POKOK = ['2020'] TAHUN_PAJAK_DISC_POKOK = '2021'
PERIODE_DISC_POKOK = { BUKU_DISC_POKOK = [
2020: { (100000, 0),
7: [ (500000, 0.2),
(100000, 1), (2000000, 0.15),
(500000, 0.2), (5000000, 0.1),
(2000000, 0.15), (None, 0.05)]
(5000000, 0.1),
(None, 0.05),
],
8: [
(100000, 1),
(500000, 0.15),
(2000000, 0.1),
(5000000, 0.05),
(None, 0.03),
],
9: [
(100000, 1),
(500000, 0.1),
(2000000, 0.05),
(5000000, 0.03),
(None, 0),
],
},
}
class Inquiry(BaseInquiry): class Inquiry(BaseInquiry):
...@@ -46,42 +27,16 @@ class Inquiry(BaseInquiry): ...@@ -46,42 +27,16 @@ class Inquiry(BaseInquiry):
def hitung_discount(self): # Override def hitung_discount(self): # Override
self.denda_sblm_diskon = self.denda self.denda_sblm_diskon = self.denda
self.discount_denda = self.discount_pokok = 0 self.discount_denda = self.discount_pokok = 0
if self.tgl_bayar > AKHIR_DISC: self.discount = self.discount_pokok = self.hitung_discount_pokok()
return
if self.tgl_bayar < AWAL_DISC:
self.discount_pokok = self.hitung_discount_pokok_2020_07_09()
else:
self.discount_denda = self.hitung_discount_denda()
self.discount_pokok = self.hitung_discount_pokok_2020_10_12()
self.discount = self.discount_denda + self.discount_pokok
def hitung_discount_denda(self): def hitung_discount_pokok(self):
if self.invoice.thn_pajak_sppt > '2020': if self.tgl_bayar > AKHIR_DISC:
return 0
return self.denda
def hitung_discount_pokok_2020_10_12(self):
thn = self.invoice.thn_pajak_sppt
if thn > '2019':
return 0
if thn < '2010':
disc = 0.2
elif thn < '2015':
disc = 0.15
else:
disc = 0.1
return int(disc * self.tagihan)
def hitung_discount_pokok_2020_07_09(self):
if self.invoice.thn_pajak_sppt not in TAHUN_PAJAK_DISC_POKOK:
return 0 return 0
if self.tgl_bayar.year not in PERIODE_DISC_POKOK: if self.tgl_bayar < AWAL_DISC:
return 0 return 0
bulan_disc = PERIODE_DISC_POKOK[self.tgl_bayar.year] if self.invoice.thn_pajak_sppt != TAHUN_PAJAK_DISC_POKOK:
if self.tgl_bayar.month not in bulan_disc:
return 0 return 0
disc_list = bulan_disc[self.tgl_bayar.month] for max_tagihan, disc in BUKU_DISC_POKOK:
for max_tagihan, disc in disc_list:
if max_tagihan is None: if max_tagihan is None:
break break
if self.invoice.pbb_yg_harus_dibayar_sppt <= max_tagihan: if self.invoice.pbb_yg_harus_dibayar_sppt <= max_tagihan:
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!