Commit 36497e75 by Owo Sugiana

Discount pokok Kota Cimahi

1 parent cad610e1
0.4.3 2026-09-01
----------------
- Discount pokok Kota Cimahi
0.4.2 2026-08-31 0.4.2 2026-08-31
---------------- ----------------
- Discount denda Kota Bogor - Discount denda Kota Bogor
......
...@@ -3,7 +3,7 @@ requires = ['setuptools >= 64'] ...@@ -3,7 +3,7 @@ requires = ['setuptools >= 64']
[project] [project]
name = 'sismiop-models' name = 'sismiop-models'
version = '0.4.2' version = '0.4.3'
dependencies = [ dependencies = [
'sqlalchemy', 'sqlalchemy',
'zope.sqlalchemy', 'zope.sqlalchemy',
......
...@@ -15,6 +15,7 @@ def get_option(argv): ...@@ -15,6 +15,7 @@ def get_option(argv):
pars.add_argument('--min-nominal', type=int) pars.add_argument('--min-nominal', type=int)
pars.add_argument('--max-nominal', type=int) pars.add_argument('--max-nominal', type=int)
pars.add_argument('--faktor-pengurang', action='store_true') pars.add_argument('--faktor-pengurang', action='store_true')
pars.add_argument('--status-tagihan', type=int)
pars.add_argument( pars.add_argument(
'--count', type=int, default=default_count, help=help_count) '--count', type=int, default=default_count, help=help_count)
return pars.parse_args(argv) return pars.parse_args(argv)
......
...@@ -83,6 +83,7 @@ def show_inquiry(inq): ...@@ -83,6 +83,7 @@ def show_inquiry(inq):
show_rp('Total Bayar Sebelumnya', inq.total_bayar) show_rp('Total Bayar Sebelumnya', inq.total_bayar)
show_rp('Total Tagihan', inq.total) show_rp('Total Tagihan', inq.total)
show_field(inq.invoice, 'status_pembayaran_sppt') show_field(inq.invoice, 'status_pembayaran_sppt')
show_field(inq.invoice, 'status_tagihan_sppt')
show_field(inq.invoice, 'pbb_yg_harus_dibayar_sppt') show_field(inq.invoice, 'pbb_yg_harus_dibayar_sppt')
show_field(inq.invoice, 'pbb_terhutang_sppt') show_field(inq.invoice, 'pbb_terhutang_sppt')
show_field(inq.invoice, 'faktor_pengurang_sppt') show_field(inq.invoice, 'faktor_pengurang_sppt')
......
...@@ -401,6 +401,9 @@ class AvailableInvoice(Query): ...@@ -401,6 +401,9 @@ class AvailableInvoice(Query):
self.option.max_nominal) self.option.max_nominal)
if self.option.faktor_pengurang: if self.option.faktor_pengurang:
q = q.filter(Invoice.faktor_pengurang_sppt > 0) q = q.filter(Invoice.faktor_pengurang_sppt > 0)
if self.option.status_tagihan is not None:
q = q.filter(
Invoice.status_tagihan_sppt == self.option.status_tagihan)
return q return q
def show(self): def show(self):
......
...@@ -6,16 +6,32 @@ from .sumedang import ( ...@@ -6,16 +6,32 @@ from .sumedang import (
) )
AWAL_DISC = date(2026, 8, 1) AWAL_DISC_DENDA = date(2026, 8, 1)
AKHIR_DISC = date(2026, 9, 30) AKHIR_DISC_DENDA = date(2026, 9, 30)
AWAL_DISC_POKOK = date(2026, 9, 1)
AKHIR_DISC_POKOK = date(2026, 9, 30)
class Inquiry(BaseInquiry): class Inquiry(BaseInquiry):
def hitung_discount(self): # Override def hitung_discount(self): # Override
self.discount_pokok = self.discount_denda = 0 self.discount_pokok = self.discount_denda = 0
if AWAL_DISC <= self.tgl_bayar <= AKHIR_DISC: self.hitung_discount_pokok()
self.hitung_discount_denda()
self.discount = self.discount_pokok + self.discount_denda
def hitung_discount_pokok(self):
if self.invoice.thn_pajak_sppt != '2026':
return
if self.invoice.status_tagihan_sppt in ('5', '6', '7', '9'):
return
if AWAL_DISC_POKOK <= self.tgl_bayar <= AKHIR_DISC_POKOK:
self.discount_pokok = int(0.05 * self.tagihan)
def hitung_discount_denda(self):
if AWAL_DISC_DENDA <= self.tgl_bayar <= AKHIR_DISC_DENDA:
if '2013' <= self.invoice.thn_pajak_sppt <= '2025': if '2013' <= self.invoice.thn_pajak_sppt <= '2025':
self.discount_denda = self.discount = self.denda self.discount_denda = self.denda
def before_save(self, pay): # Override def before_save(self, pay): # Override
pay.denda_sppt = self.denda - self.discount_denda pay.denda_sppt = self.denda - self.discount_denda
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!