Commit 886ddf66 by iwan

Tambah Kabupaten Kuningan

1 parent 4801e774
0.3.3 2021-04-29
----------------
- Tambah Kabupaten Kuningan
0.3.2 2021-04-06
----------------
- Maksimum denda 0,48 dari tagihan pokok hanya untuk denda waktu.
......
......@@ -439,6 +439,7 @@ class AvailableInvoice:
q = q.filter(
Invoice.pajak_id == Pajak.id, Pajak.rekening_id == Rekening.id,
Invoice.status_pembayaran == 0)
q = self.get_filter_tahun(q)
q = self.get_filter_rekening(q)
q = self.get_filter_usaha(q)
q = self.get_filter_nominal(q)
......@@ -449,6 +450,11 @@ class AvailableInvoice:
q = self.get_filter_type(q)
return q
def get_filter_tahun(self, q):
if self.option.tahun:
return q.filter(Invoice.tahun == self.option.tahun)
return q
def get_filter_rekening(self, q):
if self.option.rekening:
q = q.filter(Rekening.rekeningkd == self.option.rekening)
......
from datetime import date
from .default import (
Inquiry as BaseInquiry,
Reversal,
AvailableInvoice as BaseAvailableInvoice,
)
def dmy(tgl):
return tgl.strftime('%d-%m-%Y')
AWAL_TAHUN = 2016
AKHIR_TAHUN = 2020
AKHIR_TGL_BAYAR = date(2021, 12, 31)
NOTE_TGL_BAYAR = 'Tanggal bayar {tgl} <= ' + dmy(AKHIR_TGL_BAYAR)
NOTE_TAHUN = str(AWAL_TAHUN) + ' <= field tahun {tahun} <= ' + str(AKHIR_TAHUN)
class Inquiry(BaseInquiry):
def get_discount_denda(self): # Override
tgl_bayar = self.tgl_bayar.date()
if tgl_bayar > AKHIR_TGL_BAYAR:
return 0
notes = [NOTE_TGL_BAYAR.format(tgl=dmy(tgl_bayar))]
if AWAL_TAHUN <= self.invoice.tahun <= AKHIR_TAHUN:
s = NOTE_TAHUN.format(tahun=self.invoice.tahun)
notes.append(s)
self.notes = notes
return self.denda
return 0
class AvailableInvoice(BaseAvailableInvoice):
def get_inquiry_class(self): # Override
return Inquiry
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!