Commit 404b1850 by Owo Sugiana

Tambah tangsel

1 parent a8d6e05d
......@@ -321,10 +321,13 @@ class AvailableInvoice(Query):
if inq.is_paid():
continue
no += 1
msg = '#{} {} Pokok Rp {} + Denda Rp {} = Rp {}'.format(
str(no).zfill(2), inq.invoice_id_raw,
thousand(inq.tagihan), thousand(inq.denda),
thousand(inq.total))
msg = self.get_msg(inq)
msg = '#{} {}'.format(str(no).zfill(2), msg)
print(msg)
if no == self.count:
break
def get_msg(self, inq):
return '{} Pokok Rp {} + Denda Rp {} = Rp {}'.format(
inq.invoice_id_raw, thousand(inq.tagihan),
thousand(inq.denda), thousand(inq.total))
from datetime import date
from ..base import thousand
from ..default import (
Inquiry as BaseInquiry,
Reversal,
AvailableInvoice as BaseAvailableInvoice,
)
AKHIR_DISC = date(2020, 12, 31)
THN_DISC = []
for i in range(2014, 2020): # 2014 - 2019
THN_DISC.append(str(i))
class Inquiry(BaseInquiry):
def hitung_denda(self): # Override
BaseInquiry.hitung_denda(self)
self.denda_sblm_diskon = self.denda
if self.tgl_bayar.date() > AKHIR_DISC:
return
if self.invoice.thn_pajak_sppt not in THN_DISC:
return
self.denda -= int(0.5 * self.denda)
def before_save(self, bayar): # Override
bayar.denda_sblm_diskon = self.denda_sblm_diskon
class AvailableInvoice(BaseAvailableInvoice):
def get_inquiry_class(self):
return Inquiry
def get_msg(self, inq):
s = BaseAvailableInvoice.get_msg(self, inq)
if inq.denda == inq.denda_sblm_diskon:
return s
return '{}, Denda Sebelum Discount Rp {}'.format(
s, thousand(inq.denda_sblm_diskon))
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!