Commit 5f34e878 by taufikyu

update flagging kode bayar

1 parent c8e96881
......@@ -42,10 +42,17 @@ def get_listkdbayar():
.filter(ARSspd.tahun_id == tahunargs,
ARSspd.ntb.notin_(['BJBQRIS','BJBVA']),
ARSspd.tgl_bayar >= datenow,
ARSspd.posted == 0).all()
ARSspd.posted_pemda == 0).all()
list_kd_bayar = [d.kode for d in getdata]
return list_kd_bayar
def update_flagging(kd_bayar):
id_inv = DBSession.query(ARInvoice.id).select_from(ARSspd)\
.join(ARInvoice,ARInvoice.id==ARSspd.arinvoice_id)\
.filter(ARInvoice.kode == kd_bayar).scalar()
DBSession.query(ARSspd).filter(ARSspd.arinvoice_id==id_inv).\
update({ARSspd.posted_pemda: 1}, synchronize_session='fetch')
def sendrpc(kd_bayar):
print('STARTING RPC CALLBACK PEMDA')
headers = {'Content-Type':'application/json'}
......@@ -68,6 +75,7 @@ def sendrpc(kd_bayar):
except Exception as err:
print(err)
raise Exception(err)
update_flagging(kd_bayar)
return True
except requests.exceptions.RequestException as err:
print('Error send BJBQRIS to pemda : {}'.format(err))
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!