Commit 918ffb5e by taufikyu

update cekbayar

1 parent 79f4f8c7
......@@ -255,11 +255,11 @@ def cekqris(values,request):
raise route_list(request)
def cekbayar(invoice_no, request, responfor):
id_bayar = DBSession.query(ArInvoice.id).\
tagihan = DBSession.query(func.max(BJBQRIS.amount)).\
filter(BJBQRIS.invoice_no==invoice_no,BJBQRIS.status.in_(['0','1','2'])).group_by(BJBQRIS.va_number).scalar()
cekbayar = DBSession.query(func.sum(ArPayment.bayar)).join(ArInvoice,ArInvoice.id==ArPayment.arinvoice_id).\
filter(ArInvoice.kode==invoice_no).scalar()
cekbayar = DBSession.query(ArPayment).\
filter(ArPayment.arinvoice_id==id_bayar).first()
if cekbayar:
if cekbayar >= tagihan:
if responfor == 0:
msg = 'BJBQRIS No. Billing %s sudah di bayar. Cek menu pembayaran.' % invoice_no
request.session.flash(msg, 'error')
......
......@@ -253,11 +253,11 @@ def cekva(values,request):
raise route_list(request)
def cekbayar(invoice_no, request, responfor):
id_bayar = DBSession.query(ArInvoice.id).\
tagihan = DBSession.query(func.max(BJBVA.amount)).\
filter(BJBVA.invoice_no==invoice_no,BJBVA.status.in_(['0','1','2'])).group_by(BJBVA.va_number).scalar()
cekbayar = DBSession.query(func.sum(ArPayment.bayar)).join(ArInvoice,ArInvoice.id==ArPayment.arinvoice_id).\
filter(ArInvoice.kode==invoice_no).scalar()
cekbayar = DBSession.query(ArPayment).\
filter(ArPayment.arinvoice_id==id_bayar).first()
if cekbayar:
if cekbayar >= tagihan:
if responfor == 0:
msg = 'BJBVA No. Billing %s sudah di bayar. Cek menu pembayaran.' % invoice_no
request.session.flash(msg, 'error')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!