Commit 10275c71 by taufikyu

penambahan create va dan create qris epap

1 parent 38bbc273
......@@ -15,6 +15,10 @@ from ..models import (DBSession)
from ..models.isipkd import (Pap)
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
SESS_ADD_FAILED = 'user add failed'
SESS_EDIT_FAILED = 'user edit failed'
......@@ -349,6 +353,47 @@ def view_edit(request):
return HTTPFound(location=request.route_url('pap-edit',nr=row.npwpd,
nk=row.m_pjk_bln,
em=row.m_pjk_thn))
elif 'createva' in request.POST:
val = dict(request.POST.items())
val.update(dict(
client_type = 3,
invoice_no = val['kd_bayar'],
product_code = 98,
description = val['keterangan'],
customer_name = val['nm_perus'],
customer_email = "-",
customer_phone = "-",
expired_date = ymdhms(datetime.now()),
))
val['amount'] = (val['bea_pok_pjk']+val['bea_den_pjk'])
row = BJBVA.create_va(val, rpc_params())
if row:
request.session.flash('BJBVA No. %s sudah ditambahkan.' % row.va_number)
else:
request.session.flash('BJBVA gagal ditambahkan.')
elif 'createqris' in request.POST:
val = dict(request.POST.items())
val.update(dict(
client_type = 3,
invoice_no = val['kd_bayar'],
product_code = 98,
description = val['keterangan'],
customer_name = val['nm_perus'],
customer_email = "-",
customer_phone = "-",
expired_date = ymdhms(datetime.now()),
))
val['amount'] = (val['bea_pok_pjk']+val['bea_den_pjk'])
row = BJBQRIS.create_va(val, rpc_params())
if row:
request.session.flash('BJBQRIS No. %s sudah ditambahkan.' % row.va_number)
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!