Commit 2de2211c by Owo Sugiana

Bug fixed potongan karena maksimum denda bukanlah discount

1 parent fe6f4ebd
......@@ -63,7 +63,7 @@ def show(inq):
show_rp('Tagihan', inq.tagihan)
show_rp('Denda', inq.denda)
show_rp('Discount Denda', inq.discount_denda)
if inq.discount_denda:
if inq.notes:
show_val('Note', inq.notes)
show_rp('Total Denda', inq.denda)
show_rp('Total Bayar', inq.total_bayar)
......
......@@ -45,8 +45,6 @@ INVOICE_ID = [
MAX_PORSI_DENDA = 0.48
NOTE_MAX_DENDA = 'maksimum denda = 0,48 x tagihan pokok {pokok} = {maks}'
NOTE_DISC = 'discount = bunga {bunga} + denda waktu {denda_waktu} '\
'- {maks} = {disc}'
class BaseInquiry:
......@@ -300,20 +298,14 @@ class Inquiry(BaseInquiry):
self.bln_tunggakan = None
self.discount_denda = self.get_discount_denda()
self.denda -= self.discount_denda
def get_discount_denda(self):
max_denda = MAX_PORSI_DENDA * self.tagihan
max_denda = round_up(max_denda)
if self.denda > max_denda:
n = self.denda - max_denda
n = int(n)
self.denda = max_denda
s = NOTE_MAX_DENDA.format(pokok=self.tagihan, maks=max_denda)
self.notes.append(s)
s = NOTE_DISC.format(
bunga=self.bunga, denda_waktu=self.denda_waktu,
maks=max_denda, disc=n)
self.notes.append(s)
return n
def get_discount_denda(self):
return 0
def hitung_bayar(self):
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!