Commit 079efc8f by Owo Sugiana

Discount Kota Bekasi

1 parent 70e85ff5
0.3.48 2026-02-11
-----------------
- Discount Kota Bekasi
0.3.47 2026-01-15 0.3.47 2026-01-15
----------------- -----------------
- Discount pokok Kabupaten Cirebon untuk tahun pajak 2026 - Discount pokok Kabupaten Cirebon untuk tahun pajak 2026
......
...@@ -3,7 +3,7 @@ requires = ['setuptools >= 64'] ...@@ -3,7 +3,7 @@ requires = ['setuptools >= 64']
[project] [project]
name = 'sismiop-models' name = 'sismiop-models'
version = '0.3.47' version = '0.3.48'
dependencies = [ dependencies = [
'sqlalchemy', 'sqlalchemy',
'zope.sqlalchemy', 'zope.sqlalchemy',
......
...@@ -14,7 +14,10 @@ from ..models.bekasi_kota import ( ...@@ -14,7 +14,10 @@ from ..models.bekasi_kota import (
Kecamatan, Kecamatan,
Propinsi, Propinsi,
) )
from .base import Query from .base import (
Query,
get_db_session,
)
from .binjai import ( from .binjai import (
AvailableInvoice as BaseAvailableInvoice, AvailableInvoice as BaseAvailableInvoice,
Inquiry as BaseInquiry, Inquiry as BaseInquiry,
...@@ -23,8 +26,18 @@ from .binjai import ( ...@@ -23,8 +26,18 @@ from .binjai import (
MAX_BULAN_DENDA = 24 MAX_BULAN_DENDA = 24
AWAL_DISC = date(2025, 12, 8)
AKHIR_DISC = date(2025, 12, 30) AWAL_DISC = date(2026, 2, 20)
AKHIR_DISC = date(2026, 4, 30)
TAHUN_PAJAK_DISC_POKOK = '2026'
BUKU_DISC_POKOK = [
(100000, 0.29),
(500000, 0.1),
(2000000, 0.05),
(5000000, 0.03),
(None, 0.02)]
TAHUN_LUNAS = [str(x) for x in range(2021, 2027)]
def hitung_denda(tagihan, jatuh_tempo, tgl_hitung): def hitung_denda(tagihan, jatuh_tempo, tgl_hitung):
...@@ -62,6 +75,15 @@ class Inquiry(BaseInquiry): ...@@ -62,6 +75,15 @@ class Inquiry(BaseInquiry):
if self.invoice and self.invoice.status_pembayaran_sppt == '1': if self.invoice and self.invoice.status_pembayaran_sppt == '1':
self.tagihan = self.denda = self.discount = self.total = 0 self.tagihan = self.denda = self.discount = self.total = 0
def tahun_lunas(self, tahun):
db_session = get_db_session()
Sppt = self.get_invoice_model()
q = db_session.query(Sppt)
q = self.get_filter_op(q)
q = q.filter_by(thn_pajak_sppt=tahun)
row = q.first()
return row and row.status_pembayaran_sppt == '1'
def hitung_denda(self): # Override def hitung_denda(self): # Override
if isinstance(self.tgl_bayar, datetime): if isinstance(self.tgl_bayar, datetime):
tgl_bayar = self.tgl_bayar.date() tgl_bayar = self.tgl_bayar.date()
...@@ -74,17 +96,24 @@ class Inquiry(BaseInquiry): ...@@ -74,17 +96,24 @@ class Inquiry(BaseInquiry):
def hitung_discount_pokok(self): def hitung_discount_pokok(self):
if self.invoice.faktor_pengurang_sppt: if self.invoice.faktor_pengurang_sppt:
return return
thn = self.invoice.thn_pajak_sppt
if '2024' <= thn <= '2025':
disc = 0.1
elif '2020' <= thn <= '2023':
disc = 0.25
elif '2013' <= thn <= '2019':
disc = 0.5
elif thn < '2013':
disc = 0.75
else:
disc = 0 disc = 0
if self.invoice.thn_pajak_sppt == '2026':
for max_tagihan, disc in BUKU_DISC_POKOK:
if max_tagihan is None:
break
if self.invoice.pbb_yg_harus_dibayar_sppt <= max_tagihan:
break
elif self.invoice.thn_pajak_sppt <= '2020':
lunas = True
for th in TAHUN_LUNAS:
if self.tahun_lunas(th):
print(f'Tahun {th} lunas')
else:
print(f'Tahun {th} belum lunas')
lunas = False
break
if lunas:
disc = 0.87
if disc: if disc:
self.discount_pokok = disc * self.tagihan self.discount_pokok = disc * self.tagihan
self.discount_pokok = int(self.discount_pokok) self.discount_pokok = int(self.discount_pokok)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!