Commit cb80ff9c by Owo Sugiana

Tambah Kabupaten Subang

1 parent c7b126f9
0.4.9 2024-04-20
----------------
- Tambah Kabupaten Subang
0.4.8 2024-01-21 0.4.8 2024-01-21
---------------- ----------------
- Di Kabupaten Kuningan jenis kurang bayar 2024 ke atas didenda 1,8% - Di Kabupaten Kuningan jenis kurang bayar 2024 ke atas didenda 1,8%
...@@ -18,7 +22,7 @@ ...@@ -18,7 +22,7 @@
0.4.4 2022-12-22 0.4.4 2022-12-22
---------------- ----------------
- Tambah Kabupaten Serang - Tambah Kabupaten Serang
- bin/inquiry tambah --ntp dan --tgl-bayar bisa ada jam - bin/bphtb_inquiry tambah --ntb dan --tgl-bayar bisa ada jam
0.4.3 2022-03-12 0.4.3 2022-03-12
---------------- ----------------
......
...@@ -30,6 +30,12 @@ from .structure import ( ...@@ -30,6 +30,12 @@ from .structure import (
) )
def get_nop(row):
return ''.join(
[row.kd_propinsi, row.kd_dati2, row.kd_kecamatan, row.kd_kelurahan,
row.kd_blok, row.no_urut, row.kd_jns_op])
class Common: class Common:
kecamatan_model = Kecamatan kecamatan_model = Kecamatan
kelurahan_model = Kelurahan kelurahan_model = Kelurahan
...@@ -38,6 +44,7 @@ class Common: ...@@ -38,6 +44,7 @@ class Common:
customer_model = Customer customer_model = Customer
invoice_id_structure = INVOICE_ID invoice_id_structure = INVOICE_ID
invoice_id_length = INVOICE_ID_LENGTH invoice_id_length = INVOICE_ID_LENGTH
kode_kurang_bayar = KODE_KURANG_BAYAR
def __init__(self, invoice_id): def __init__(self, invoice_id):
self.invoice_id = invoice_id self.invoice_id = invoice_id
...@@ -124,7 +131,7 @@ class Inquiry(Common): ...@@ -124,7 +131,7 @@ class Inquiry(Common):
self.total = self.tagihan + self.denda - self.discount self.total = self.tagihan + self.denda - self.discount
def hitung_denda(self): def hitung_denda(self):
if self.kode in KODE_KURANG_BAYAR: if self.kode in self.kode_kurang_bayar:
return return
if isinstance(self.tgl_bayar, datetime): if isinstance(self.tgl_bayar, datetime):
tgl_bayar = self.tgl_bayar.date() tgl_bayar = self.tgl_bayar.date()
...@@ -317,6 +324,7 @@ class AvailableInvoice(BaseAvailableInvoice): ...@@ -317,6 +324,7 @@ class AvailableInvoice(BaseAvailableInvoice):
invoice_model = Invoice invoice_model = Invoice
inquiry_cls = Inquiry inquiry_cls = Inquiry
invoice_id_structure = INVOICE_ID invoice_id_structure = INVOICE_ID
kode_kurang_bayar = KODE_KURANG_BAYAR
def get_query(self): def get_query(self):
db_session = get_db_session() db_session = get_db_session()
...@@ -331,7 +339,7 @@ class AvailableInvoice(BaseAvailableInvoice): ...@@ -331,7 +339,7 @@ class AvailableInvoice(BaseAvailableInvoice):
else: else:
q = q.filter(self.invoice_model.tgl_jatuh_tempo < kini) q = q.filter(self.invoice_model.tgl_jatuh_tempo < kini)
if self.option.skpdkb: if self.option.skpdkb:
q = q.filter(self.invoice_model.kode.in_(KODE_KURANG_BAYAR)) q = q.filter(self.invoice_model.kode.in_(self.kode_kurang_bayar))
return q.order_by(self.invoice_model.id.desc()) return q.order_by(self.invoice_model.id.desc())
def get_message(self, row): def get_message(self, row):
...@@ -343,8 +351,9 @@ class AvailableInvoice(BaseAvailableInvoice): ...@@ -343,8 +351,9 @@ class AvailableInvoice(BaseAvailableInvoice):
inq = self.inquiry_cls(invoice_id, self.conf) inq = self.inquiry_cls(invoice_id, self.conf)
if inq.total < 1: if inq.total < 1:
return return
nop = get_nop(row)
total = thousand(inq.total).rjust(11) total = thousand(inq.total).rjust(11)
msg = '{id} Rp {total}'.format(id=invoice_id, total=total) msg = f'{invoice_id} {nop} Rp {total}'
if row.tgl_jatuh_tempo: if row.tgl_jatuh_tempo:
return '{} jatuh tempo {}'.format( return '{} jatuh tempo {}'.format(
msg, row.tgl_jatuh_tempo.strftime('%d-%m-%Y')) msg, row.tgl_jatuh_tempo.strftime('%d-%m-%Y'))
......
from .default import (
Inquiry as BaseInquiry,
Reversal,
AvailableInvoice as BaseAvailableInvoice,
)
class Inquiry(BaseInquiry):
kode_kurang_bayar = ['1', '5']
class AvailableInvoice(BaseAvailableInvoice):
kode_kurang_bayar = ['1', '5']
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!