Commit cd456be6 by taufikyu

perbaiki bjb qris, bjb va

1 parent 3571b142
......@@ -277,7 +277,6 @@ def save(request, values, row=None):
ARInvoice.wilayah_id==row.wilayah_id,
ARInvoice.tgl_tetap==tgl_tetap_new,
func.substr(ARInvoice.kode,1,2)=='20').scalar()
print "--------- Invoice No ---------- ",invoice_no
if not invoice_no:
row.no_id = 1
else:
......
......@@ -275,7 +275,6 @@ def save(request, values, row=None):
#ARInvoice.tgl_tetap==datetime.now().strftime('%Y-%m-%d'),
ARInvoice.tgl_tetap==tgl_tetap_new,
func.substr(ARInvoice.kode,1,2)=='20').scalar()
print "--------- Invoice No ---------- ",invoice_no
if not invoice_no:
row.no_id = 1
else:
......
......@@ -323,7 +323,6 @@ def save(request, values, row=None):
ARInvoice.wilayah_id==row.wilayah_id,
ARInvoice.tgl_tetap==tgl_tetap_new,
func.substr(ARInvoice.kode,1,2)=='21').scalar()
print "--------- Invoice No ---------- ",invoice_no
print "--tahun--",row.tahun_id
print "--wilayah--",row.wilayah_id
print "--tanggal--",tgl_tetap_new
......
......@@ -276,7 +276,6 @@ def save(request, values, row=None):
#ARInvoice.tgl_tetap==datetime.now().strftime('%Y-%m-%d'),
ARInvoice.tgl_tetap==tgl_tetap_new,
func.substr(ARInvoice.kode,1,2)=='21').scalar()
print "--------- Invoice No ---------- ",invoice_no
if not invoice_no:
row.no_id = 1
else:
......
......@@ -297,7 +297,6 @@ def save(request, values, row=None):
ARInvoice.wilayah_id==row.wilayah_id,
ARInvoice.tgl_tetap==tgl_tetap_new,
func.substr(ARInvoice.kode,1,2)=='21').scalar()
print "--------- Invoice No ---------- ",invoice_no
print "--tahun--",row.tahun_id
print "--wilayah--",row.wilayah_id
print "--tanggal--",tgl_tetap_new
......
......@@ -277,7 +277,6 @@ def save(request, values, row=None):
filter(ARSspd.tahun_id==ref.tahun_id,
ARSspd.arinvoice_id==ref.id).\
scalar()
print "--------- Invoice No ---------- ",invoice_no
if not invoice_no:
row.pembayaran_ke = 1
else:
......
......@@ -269,7 +269,6 @@ def save(request, values, row=None):
filter(ARSspd.tahun_id==row.tahun_id,
ARSspd.arinvoice_id==row.arinvoice_id).\
scalar()
print "--------- Invoice No ---------- ",invoice_no
if not invoice_no:
row.pembayaran_ke = 1
else:
......
......@@ -641,14 +641,12 @@ def view_posting(request):
ARInvoice.wilayah_id==i.wilayah_id,
ARInvoice.tgl_tetap==tgl_tetap_new,
func.substr(ARInvoice.kode,1,2)=='20').scalar()
print "--------- Invoice No ---------- ",invoice_no
elif prefix == '21':
invoice_no = DBSession.query(func.max(ARInvoice.no_id)).\
filter(ARInvoice.tahun_id==i.tahun_id,
ARInvoice.wilayah_id==i.wilayah_id,
ARInvoice.tgl_tetap==tgl_tetap_new,
func.substr(ARInvoice.kode,1,2)=='21').scalar()
print "--------- Invoice No ---------- ",invoice_no
if not invoice_no:
i.no_id = 1
......
......@@ -622,14 +622,12 @@ def view_posting(request):
ARInvoice.wilayah_id==i.wilayah_id,
ARInvoice.tgl_tetap==datetime.now().strftime('%Y-%m-%d'),
func.substr(ARInvoice.kode,1,2)=='20').scalar()
print "--------- Invoice No ---------- ",invoice_no
elif prefix == '21':
invoice_no = DBSession.query(func.max(ARInvoice.no_id)).\
filter(ARInvoice.tahun_id==i.tahun_id,
ARInvoice.wilayah_id==i.wilayah_id,
ARInvoice.tgl_tetap==datetime.now().strftime('%Y-%m-%d'),
func.substr(ARInvoice.kode,1,2)=='21').scalar()
print "--------- Invoice No ---------- ",invoice_no
if not invoice_no:
i.no_id = 1
......
......@@ -521,13 +521,13 @@ def callback(request, data):
if int(get_va.status) == 2 and not pay.status:
get_va.status = '1'
if DBSession.add(get_va):
try:
DBSession.add(get_va):
DBSession.flush()
if not sendrpc(request, get_va.invoice_no):
log.error('Error send BJBQRIS to pemda')
sendrpc(request, get_va.invoice_no)
return render_to_response('json',
dict(response_code='0000',response_message='Success'))
else:
except:
return render_to_response('json',
dict(response_code='-1',response_message='Failed to update'))
......@@ -573,6 +573,7 @@ def calculate_tagihan(values):
return pokok, denda
def sendrpc(request, kd_bayar):
log.info('STARTING RPC QRIS CALLBACK PEMDA')
settings = get_settings()
request = self.req
headers = {'Content-Type':'application/json'}
......@@ -593,5 +594,5 @@ def sendrpc(request, kd_bayar):
log.info('Response RPC CALLBACK PEMDA : {}'.format(resp.content))
return True
except requests.exceptions.RequestException as err:
log.error('Gagal membuat koneksi, silakan coba lagi beberapa saat')
log.error('Error send BJBQRIS to pemda : {}'.format(err))
return
......@@ -603,13 +603,14 @@ def callback(request, data):
if int(get_va.status) == 2 and not pay.status:
get_va.status = '1'
if DBSession.add(get_va):
try:
DBSession.add(get_va):
DBSession.flush()
if not sendrpc(request, get_va.invoice_no):
log.error('Error send BJBVA to pemda')
sendrpc(request, get_va.invoice_no)
return render_to_response('json',
dict(response_code='0000',response_message='Success'))
else:
except:
return render_to_response('json',
dict(response_code='-1',response_message='Failed to update'))
......@@ -668,6 +669,7 @@ def calculate_tagihan(values):
return pokok, denda
def sendrpc(request, kd_bayar):
log.info('STARTING RPC VA CALLBACK PEMDA')
settings = get_settings()
request = self.req
headers = {'Content-Type':'application/json'}
......@@ -688,5 +690,5 @@ def sendrpc(request, kd_bayar):
log.info('Response RPC CALLBACK PEMDA : {}'.format(resp.content))
return True
except requests.exceptions.RequestException as err:
log.error('Gagal membuat koneksi, silakan coba lagi beberapa saat')
log.error('Error send BJBVA to pemda : {}'.format(err))
return
\ No newline at end of file
......@@ -267,14 +267,12 @@ def save(request, values, row=None):
ARInvoice.wilayah_id==row.wilayah_id,
ARInvoice.tgl_tetap==datetime.now().strftime('%Y-%m-%d'),
func.substr(ARInvoice.kode,1,2)=='20').scalar()
print "--------- Invoice No ---------- ",invoice_no
elif prefix == '21':
invoice_no = DBSession.query(func.max(ARInvoice.no_id)).\
filter(ARInvoice.tahun_id==row.tahun_id,
ARInvoice.wilayah_id==row.wilayah_id,
ARInvoice.tgl_tetap==datetime.now().strftime('%Y-%m-%d'),
func.substr(ARInvoice.kode,1,2)=='21').scalar()
print "--------- Invoice No ---------- ",invoice_no
if not invoice_no:
row.no_id = 1
......
......@@ -288,7 +288,6 @@ def save(request, values, row=None):
ARInvoice.wilayah_id==row.wilayah_id,
ARInvoice.tgl_tetap==tgl_tetap_new,
func.substr(ARInvoice.kode,1,2)=='21').scalar()
print "--------- Invoice No ---------- ",invoice_no
print "--tahun--",row.tahun_id
print "--wilayah--",row.wilayah_id
print "--tanggal--",tgl_tetap_new
......
......@@ -84,7 +84,6 @@ def view_act(request):
if url_dict['act']=='grid':
u = request.user.id
print '--------user--------',u
columns = []
columns.append(ColumnDT('id'))
columns.append(ColumnDT('kode'))
......@@ -819,21 +818,18 @@ def view_posting(request):
ARInvoice.wilayah_id==i.wilayah_id,
ARInvoice.tgl_tetap==datetime.now().strftime('%Y-%m-%d'),
func.substr(ARInvoice.kode,1,2)=='20').scalar()
print "--------- Invoice No ---------- ",invoice_no
elif prefix == '21':
invoice_no = DBSession.query(func.max(ARInvoice.no_id)).\
filter(ARInvoice.tahun_id==i.tahun_id,
ARInvoice.wilayah_id==i.wilayah_id,
ARInvoice.tgl_tetap==datetime.now().strftime('%Y-%m-%d'),
func.substr(ARInvoice.kode,1,2)=='21').scalar()
print "--------- Invoice No ---------- ",invoice_no
elif prefix == '22':
invoice_no = DBSession.query(func.max(ARInvoice.no_id)).\
filter(ARInvoice.tahun_id==i.tahun_id,
ARInvoice.wilayah_id==i.wilayah_id,
ARInvoice.tgl_tetap==datetime.now().strftime('%Y-%m-%d'),
func.substr(ARInvoice.kode,1,2)=='22').scalar()
print "--------- Invoice No ---------- ",invoice_no
if not invoice_no:
i.no_id = 1
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!