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
-----------------
- Penambahan Kota Binjai
......
......@@ -138,6 +138,7 @@ class Inquiry(Query):
self, invoice_id=None, persen_denda=2, invoice=None,
tgl_bayar=None, debug=False):
Query.__init__(self, invoice_id, invoice)
self.debug_invoice = None
if not self.invoice:
return
if debug:
......
......@@ -8,35 +8,16 @@ from .tangsel import (
from ..models.tangsel import PembayaranSppt
AWAL_DISC = date(2020, 10, 1)
AKHIR_DISC = date(2020, 12, 23)
AWAL_DISC = date(2021, 3, 22)
AKHIR_DISC = date(2021, 6, 30)
TAHUN_PAJAK_DISC_POKOK = ['2020']
PERIODE_DISC_POKOK = {
2020: {
7: [
(100000, 1),
TAHUN_PAJAK_DISC_POKOK = '2021'
BUKU_DISC_POKOK = [
(100000, 0),
(500000, 0.2),
(2000000, 0.15),
(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),
],
},
}
(None, 0.05)]
class Inquiry(BaseInquiry):
......@@ -46,42 +27,16 @@ class Inquiry(BaseInquiry):
def hitung_discount(self): # Override
self.denda_sblm_diskon = self.denda
self.discount_denda = self.discount_pokok = 0
if self.tgl_bayar > AKHIR_DISC:
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
self.discount = self.discount_pokok = self.hitung_discount_pokok()
def hitung_discount_denda(self):
if self.invoice.thn_pajak_sppt > '2020':
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:
def hitung_discount_pokok(self):
if self.tgl_bayar > AKHIR_DISC:
return 0
if self.tgl_bayar.year not in PERIODE_DISC_POKOK:
if self.tgl_bayar < AWAL_DISC:
return 0
bulan_disc = PERIODE_DISC_POKOK[self.tgl_bayar.year]
if self.tgl_bayar.month not in bulan_disc:
if self.invoice.thn_pajak_sppt != TAHUN_PAJAK_DISC_POKOK:
return 0
disc_list = bulan_disc[self.tgl_bayar.month]
for max_tagihan, disc in disc_list:
for max_tagihan, disc in BUKU_DISC_POKOK:
if max_tagihan is None:
break
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!