Commit f956c722 by taufikyu

perbaikan epap

1 parent f4bad9a5
......@@ -18,6 +18,7 @@ from ..models.informix import EngInformix
from .bjb_va import rpc_params, BJBVA
from .bjb_qris import BJBQRIS
from ..tools import ymd, dmy, ymdhms, dmyhms, dmy_to_date
from pyramid.renderers import render_to_response, render
SESS_ADD_FAILED = 'user add failed'
SESS_EDIT_FAILED = 'user edit failed'
......@@ -395,17 +396,16 @@ def view_edit(request):
DBSession.flush()
row = BJBVA.create_va(val, rpc_params())
if row:
if row and hasattr(row,'va_number'):
request.session.flash('BJBVA No. %s sudah ditambahkan.' % row.va_number)
else:
request.session.flash('BJBVA gagal ditambahkan.')
form = get_form(request, VASchema)
val['va'] = row.va_number
form.set_appstruct(val)
return HTTPFound(location=request.route_url('pap-edit',nr=val['npwpd'],
nk=val['m_pjk_bln'],
em=val['m_pjk_thn']))
return render_to_response('templates/pap/edit.pt',
dict(form=form, private_key=private_key, data_key=data_key, found=found), request)
else:
request.session.flash('BJBVA gagal ditambahkan.')
elif 'createqris' in request.POST:
......@@ -430,17 +430,16 @@ def view_edit(request):
DBSession.flush()
row = BJBQRIS.create_va(val, rpc_params())
if row:
if row and hasattr(row,'va_number'):
request.session.flash('BJBQRIS No. %s sudah ditambahkan.' % row.va_number)
else:
request.session.flash('BJBQRIS gagal ditambahkan.')
form = get_form(request, QRISSchema)
val['qris'] = row.va_number
form.set_appstruct(val)
return HTTPFound(location=request.route_url('pap-edit',nr=val['npwpd'],
nk=val['m_pjk_bln'],
em=val['m_pjk_thn']))
return render_to_response('templates/pap/edit.pt',
dict(form=form, private_key=private_key, data_key=data_key, found=found), request)
else:
request.session.flash('BJBQRIS gagal ditambahkan.')
return route_list(request)
elif SESS_EDIT_FAILED in request.session:
return session_failed(request, SESS_EDIT_FAILED)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!