Commit 9bc31a23 by Owo sugiana

Bug fixed perhitungan tagihan usai payment

1 parent b73cd66e
0.4.4 2022-09-05
----------------
- Bug fixed perhitungan tagihan usai payment
- Tambah Banjar
0.4.3 2022-08-04 0.4.3 2022-08-04
---------------- ----------------
- Discount denda untuk Tangerang Selatan - Discount denda untuk Tangerang Selatan
......
from .base import get_db_session
from .default import (
Inquiry as BaseInquiry,
Reversal as BaseReversal,
AvailableInvoice as BaseAvailableInvoice,
)
from ..models.banjar import (
Invoice,
Kohir,
)
class Inquiry(BaseInquiry):
def get_invoice_model(self): # Override
return Invoice
def get_kohir_model(self): # Override
return Kohir
def get_kohir(self): # Override
DBSession = get_db_session()
Kohir = self.get_kohir_model()
q = DBSession.query(Kohir).filter_by(sptpd_id=self.invoice.sptpd_id)
q = q.order_by(Kohir.id.desc())
return q.first()
class Reversal(BaseReversal):
def get_invoice_model(self): # Override
return Invoice
class AvailableInvoice(BaseAvailableInvoice):
def get_inquiry_class(self): # Override
return Inquiry
...@@ -301,10 +301,13 @@ class Inquiry(BaseInquiry): ...@@ -301,10 +301,13 @@ class Inquiry(BaseInquiry):
if self.get_type_name().strip() == 'STPD': if self.get_type_name().strip() == 'STPD':
self.denda = round_up(self.invoice.bunga) self.denda = round_up(self.invoice.bunga)
elif self.invoice.jatuhtempotgl: elif self.invoice.jatuhtempotgl:
self.bln_tunggakan, self.denda_waktu = hitung_denda( if self.invoice.status_pembayaran == 0:
self.tagihan, self.invoice.jatuhtempotgl, self.bln_tunggakan, self.denda_waktu = hitung_denda(
self.conf['persen_denda'], self.tagihan, self.invoice.jatuhtempotgl,
self.tgl_bayar.date()) self.conf['persen_denda'],
self.tgl_bayar.date())
else:
self.bln_tunggakan = self.denda_waktu = 0
self.denda = self.denda_waktu + self.invoice.bunga self.denda = self.denda_waktu + self.invoice.bunga
self.denda = round_up(self.denda) self.denda = round_up(self.denda)
self.discount_denda = self.get_discount_denda() self.discount_denda = self.get_discount_denda()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!