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 0.2 2021-01-11
-------------- --------------
- Tambah Provinsi Jawa Barat - Tambah Provinsi Jawa Barat
......
...@@ -26,14 +26,14 @@ def main(argv=sys.argv): ...@@ -26,14 +26,14 @@ def main(argv=sys.argv):
option = get_option(argv[1:]) option = get_option(argv[1:])
conf = ConfigParser() conf = ConfigParser()
conf.read(option.conf) conf.read(option.conf)
module_name = 'services' module_name = conf.get('main', 'module')
module = __import__('opensipkd.webr.' + module_name) module = __import__('opensipkd.webr.services.' + module_name)
services = getattr(module.webr, module_name) services = getattr(module.webr.services, module_name)
AvailableInvoice = services.AvailableInvoice AvailableInvoice = services.AvailableInvoice
db_url = conf.get('main', 'db_url') db_url = conf.get('main', 'db_url')
persen_denda = conf.getfloat('main', 'persen_denda') persen_denda = conf.getfloat('main', 'persen_denda')
engine = create_engine(db_url) engine = create_engine(db_url)
session_factory = sessionmaker(bind=engine) session_factory = sessionmaker(bind=engine)
module.webr.services.DBSession = session_factory() module.webr.services.base.DBSession = session_factory()
a = AvailableInvoice(persen_denda, option) a = AvailableInvoice(persen_denda, option)
a.show() a.show()
...@@ -59,6 +59,7 @@ def show(inq): ...@@ -59,6 +59,7 @@ def show(inq):
show_val('Nama Rekening', inq.get_nama_rekening()) show_val('Nama Rekening', inq.get_nama_rekening())
show_val('Kode SKPD', inq.get_kode_departemen()) show_val('Kode SKPD', inq.get_kode_departemen())
show_val('Nama SKPD', inq.get_nama_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('Tagihan Pokok', inq.tagihan)
show_rp('Denda', inq.denda) show_rp('Denda', inq.denda)
show_rp('Total Tagihan', inq.total) show_rp('Total Tagihan', inq.total)
......
...@@ -61,7 +61,7 @@ class Inquiry: ...@@ -61,7 +61,7 @@ class Inquiry:
func.sum(self.payment_model.bayar).label('jml')) func.sum(self.payment_model.bayar).label('jml'))
q = q.filter_by(ar_invoice_id=self.invoice.id) q = q.filter_by(ar_invoice_id=self.invoice.id)
pay = q.first() pay = q.first()
return pay and pay.jml or 0 return pay and int(pay.jml) or 0
def hitung(self): def hitung(self):
bunga = self.invoice.bunga or 0 bunga = self.invoice.bunga or 0
...@@ -106,6 +106,9 @@ class Inquiry: ...@@ -106,6 +106,9 @@ class Inquiry:
def get_nama_departemen(self): def get_nama_departemen(self):
return self.invoice.departemen_nama.upper() return self.invoice.departemen_nama.upper()
def get_jatuh_tempo(self):
return self.invoice.jatuh_tempo
def get_no_urut(self): def get_no_urut(self):
DBSession = get_db_session() DBSession = get_db_session()
q = DBSession.query(self.payment_model).filter_by( q = DBSession.query(self.payment_model).filter_by(
...@@ -176,6 +179,8 @@ class Reversal(Inquiry): ...@@ -176,6 +179,8 @@ class Reversal(Inquiry):
class AvailableInvoice: class AvailableInvoice:
invoice_model = Invoice
def __init__(self, persen_denda=2, option=None): def __init__(self, persen_denda=2, option=None):
self.option = option self.option = option
self.persen_denda = persen_denda 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!