Commit 0cffb59e by Owo Sugiana

Variabel total bertipe int ketimbang Decimal

1 parent e7aa398c
0.2.1 2021-04-08
----------------
- Variabel total bertipe int ketimbang Decimal
0.2 2021-01-11
--------------
- Tambah Provinsi Jawa Barat
......
......@@ -26,14 +26,14 @@ def main(argv=sys.argv):
option = get_option(argv[1:])
conf = ConfigParser()
conf.read(option.conf)
module_name = 'services'
module = __import__('opensipkd.webr.' + module_name)
services = getattr(module.webr, module_name)
module_name = conf.get('main', 'module')
module = __import__('opensipkd.webr.services.' + module_name)
services = getattr(module.webr.services, module_name)
AvailableInvoice = services.AvailableInvoice
db_url = conf.get('main', 'db_url')
persen_denda = conf.getfloat('main', 'persen_denda')
engine = create_engine(db_url)
session_factory = sessionmaker(bind=engine)
module.webr.services.DBSession = session_factory()
module.webr.services.base.DBSession = session_factory()
a = AvailableInvoice(persen_denda, option)
a.show()
......@@ -59,6 +59,7 @@ def show(inq):
show_val('Nama Rekening', inq.get_nama_rekening())
show_val('Kode SKPD', inq.get_kode_departemen())
show_val('Nama SKPD', inq.get_nama_departemen())
show_val('Jatuh Tempo', inq.get_jatuh_tempo())
show_rp('Tagihan Pokok', inq.tagihan)
show_rp('Denda', inq.denda)
show_rp('Total Tagihan', inq.total)
......
......@@ -61,7 +61,7 @@ class Inquiry:
func.sum(self.payment_model.bayar).label('jml'))
q = q.filter_by(ar_invoice_id=self.invoice.id)
pay = q.first()
return pay and pay.jml or 0
return pay and int(pay.jml) or 0
def hitung(self):
bunga = self.invoice.bunga or 0
......@@ -106,6 +106,9 @@ class Inquiry:
def get_nama_departemen(self):
return self.invoice.departemen_nama.upper()
def get_jatuh_tempo(self):
return self.invoice.jatuh_tempo
def get_no_urut(self):
DBSession = get_db_session()
q = DBSession.query(self.payment_model).filter_by(
......@@ -176,6 +179,8 @@ class Reversal(Inquiry):
class AvailableInvoice:
invoice_model = Invoice
def __init__(self, persen_denda=2, option=None):
self.option = option
self.persen_denda = persen_denda
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!