1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# https://git.opensipkd.com/sugiana/sismiop-models/blob/master/sismiop/services/cirebon_kab.py
from ..models.kuningan import PembayaranSppt
from .default import Inquiry as BaseInquiry
AKHIR_DISC_DENDA = date(2022, 3, 31)
# Discount pokok berdasarkan bulan
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.07,
9: 0.07,
10: 0.07}
class Inquiry(BaseInquiry):
def get_payment_model(self): # Override
return PembayaranSppt
def hitung_discount(self): # Override
self.discount_pokok = self.discount_denda = 0
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_pokok
payment.discount_denda = self.discount_denda