Commit 83f7f41f by Owo Sugiana

Rumus Kota Bekasi

1 parent 5616f4b1
0.3.10 2024-07-07
-----------------
- Rumus Kota Bekasi
0.3.9 2024-05-31
----------------
- Kota Tangerang berbasis bulan dalam menghitung denda, tidak lagi tanggal.
......
......@@ -15,7 +15,7 @@ line = CHANGES.splitlines()[0]
version = line.split()[0]
requires = [
'sqlalchemy < 2',
'sqlalchemy',
'transaction',
'zope.sqlalchemy',
'psycopg2-binary',
......
......@@ -14,6 +14,7 @@ def get_option(argv):
pars.add_argument('--tahun')
pars.add_argument('--min-nominal', type=int)
pars.add_argument('--max-nominal', type=int)
pars.add_argument('--faktor-pengurang', action='store_true')
pars.add_argument(
'--count', type=int, default=default_count, help=help_count)
return pars.parse_args(argv)
......
......@@ -395,6 +395,8 @@ class AvailableInvoice(Query):
q = q.filter(
Invoice.pbb_yg_harus_dibayar_sppt <=
self.option.max_nominal)
if self.option.faktor_pengurang:
q = q.filter(Invoice.faktor_pengurang_sppt > 0)
return q
def show(self):
......
......@@ -22,8 +22,12 @@ from .binjai import (
)
AWAL_DISC_DENDA = date(2023, 12, 4)
AKHIR_DISC_DENDA = date(2023, 12, 26)
DISC_POKOK = [
(date(2024, 7, 8), date(2024, 8, 18), 0.1),
(date(2024, 8, 19), date(2024, 9, 30), 0.05),
]
AWAL_DISC_DENDA = date(2024, 7, 8)
AKHIR_DISC_DENDA = date(2024, 9, 30)
def hitung_denda(tagihan, jatuh_tempo, tgl_hitung):
......@@ -58,7 +62,17 @@ class Inquiry(BaseInquiry):
self.denda = round_up(denda)
def hitung_discount(self): # Override
if self.tgl_bayar.year != 2024:
return
self.discount_denda = self.discount_pokok = 0
if self.invoice.thn_pajak_sppt == '2024':
if not self.invoice.faktor_pengurang_sppt:
for awal, akhir, potongan in DISC_POKOK:
if awal <= self.tgl_bayar <= akhir:
self.discount_pokok = potongan * self.tagihan
self.discount_pokok = int(self.discount_pokok)
break
elif self.invoice.thn_pajak_sppt < '2024':
if AWAL_DISC_DENDA <= self.tgl_bayar <= AKHIR_DISC_DENDA:
self.discount_denda = self.denda
self.discount = self.discount_denda + self.discount_pokok
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!