Commit 9cab1ca6 by iwan

Discount denda di Kabupaten Kuningan

1 parent 43daf2a5
0.5.13 2024-09-05
-----------------
- Kabupaten Kuningan discount denda 100% periode 5 - 30 September
0.5.12 2024-08-29
-----------------
- Kota Tangerang Selatan discount denda periode 1 September - 28 Desember
......
from datetime import date
from .subang import (
INVOICE_ID, # Dipakai payment-report
Inquiry,
Inquiry as BaseInquiry,
Reversal,
AvailableInvoice as BaseAvailableInvoice,
)
......@@ -8,6 +9,16 @@ from .subang import (
PREFIX = '3210'
AWAL_DISC = date(2024, 9, 5)
AKHIR_DISC = date(2024, 9, 30)
class Inquiry(BaseInquiry):
def get_discount_denda(self): # Override
if AWAL_DISC <= self.tgl_bayar.date() <= AKHIR_DISC:
return self.denda
return 0
class AvailableInvoice(BaseAvailableInvoice):
def get_invoice_id(self, row): # Override
......
......@@ -5,7 +5,7 @@ from .banjar import (
Reversal as BaseReversal,
AvailableInvoice as BaseAvailableInvoice,
)
from opensipkd.hitung import hitung_denda
PREFIX = '3215'
INVOICE_ID = [('Prefix', 4, 'N')] + INVOICE_ID
......@@ -14,6 +14,22 @@ INVOICE_ID = [('Prefix', 4, 'N')] + INVOICE_ID
class Inquiry(BaseInquiry):
invoice_id_structure = INVOICE_ID
def hitung_denda_waktu(self): # Override
tgl_kohir = self.get_tgl_kohir()
if tgl_kohir:
tahun_terbit = tgl_kohir.year
else:
tahun_terbit = self.invoice.masadari.year
if tahun_terbit > 2023:
persen_denda = 1
if self.get_type_name().strip() in ('SSPD', 'SELF'):
persen_denda = 1
else:
persen_denda = self.conf['persen_denda']
self.bln_tunggakan, self.denda_waktu = hitung_denda(
self.tagihan, self.invoice.jatuhtempotgl, persen_denda,
self.tgl_bayar.date())
def get_kohir_model(self):
return Kohir
......
......@@ -3,7 +3,7 @@ requires = ['setuptools >= 64']
[project]
name = 'opensipkd-pad-models'
version = '0.5.12'
version = '0.5.13'
dependencies = [
'sqlalchemy',
'zope.sqlalchemy',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!