Commit d1acbfee by taufikyu

Merge branch 'master' of http://git.opensipkd.com/taufik/esipkd

2 parents 242e2bde fd8774fd
...@@ -52,7 +52,7 @@ class AddSchema(colander.Schema): ...@@ -52,7 +52,7 @@ class AddSchema(colander.Schema):
product_code = colander.SchemaNode( product_code = colander.SchemaNode(
colander.String(), colander.String(),
widget = widget.HiddenWidget(), widget = widget.HiddenWidget(),
default = 30, default = "01", #30,
oid = "product_code", oid = "product_code",
title="") title="")
invoice_no = colander.SchemaNode( invoice_no = colander.SchemaNode(
......
...@@ -62,9 +62,9 @@ def deferred_tahun(node, kw): ...@@ -62,9 +62,9 @@ def deferred_tahun(node, kw):
return widget.SelectWidget(values=values) return widget.SelectWidget(values=values)
TAHUNS = (('','Pilih Tahun'), TAHUNS = (('','Pilih Tahun'),
('1990','1990'),('1991','1991'),('1992','1992'),('1993','1993'),('1994','1994'), # ('1990','1990'),('1991','1991'),('1992','1992'),('1993','1993'),('1994','1994'),
('1995','1995'),('1996','1996'),('1997','1997'),('1998','1998'),('1999','1999'), # ('1995','1995'),('1996','1996'),('1997','1997'),('1998','1998'),('1999','1999'),
('2000','2000'),('2001','2001'),('2002','2002'),('2003','2003'),('2004','2004'), # ('2000','2000'),('2001','2001'),('2002','2002'),('2003','2003'),('2004','2004'),
('2005','2005'),('2006','2006'),('2007','2007'),('2008','2008'),('2009','2009'), ('2005','2005'),('2006','2006'),('2007','2007'),('2008','2008'),('2009','2009'),
('2010','2010'),('2011','2011'),('2012','2012'),('2013','2013'),('2014','2014'), ('2010','2010'),('2011','2011'),('2012','2012'),('2013','2013'),('2014','2014'),
('2015','2015'),('2016','2016'),('2017','2017'),('2018','2018'),('2019','2019'), ('2015','2015'),('2016','2016'),('2017','2017'),('2018','2018'),('2019','2019'),
......
...@@ -19,7 +19,7 @@ SESS_EDIT_FAILED = 'user edit failed' ...@@ -19,7 +19,7 @@ SESS_EDIT_FAILED = 'user edit failed'
####### #######
# Add # # Add #
####### #######
import logging
def form_validator(form, value): def form_validator(form, value):
def err_no_rangka(): def err_no_rangka():
raise colander.Invalid(form, raise colander.Invalid(form,
...@@ -259,7 +259,7 @@ def save(request, values, row=None): ...@@ -259,7 +259,7 @@ def save(request, values, row=None):
tg_pros_daftar, jam_daftar, kd_status, flag_sms) tg_pros_daftar, jam_daftar, kd_status, flag_sms)
VALUES('{no_rangka}', '{no_ktp}', '{email}', '{no_hp}', '{ivr}', VALUES('{no_rangka}', '{no_ktp}', '{email}', '{no_hp}', '{ivr}',
'{c_date}' , '{c_time}', '{kd_status}', '{flag_sms}')""" '{c_date}' , '{c_time}', '{kd_status}', '{flag_sms}')"""
logging.info(sql)
row = engInformix.execute(sql.format( row = engInformix.execute(sql.format(
no_rangka = values['no_rangka'], no_rangka = values['no_rangka'],
no_ktp = values['no_ktp'], no_ktp = values['no_ktp'],
...@@ -270,7 +270,8 @@ def save(request, values, row=None): ...@@ -270,7 +270,8 @@ def save(request, values, row=None):
c_time = values['c_time'], c_time = values['c_time'],
kd_status = 0, kd_status = 0,
flag_sms = 0)) flag_sms = 0))
except: except Exception as e:
logging.info(e)
return return
tm_awal = datetime.now() tm_awal = datetime.now()
...@@ -279,25 +280,24 @@ def save(request, values, row=None): ...@@ -279,25 +280,24 @@ def save(request, values, row=None):
sql_result = """ sql_result = """
SELECT * FROM v_smsdft SELECT * FROM v_smsdft
WHERE no_rangka= '{no_rangka}' and no_ktp= '{no_ktp}' WHERE no_rangka= '{no_rangka}' and no_ktp= '{no_ktp}'
and email = '{email}' and no_hp='{no_hp}' and ivr= '{ivr}' and no_hp='{no_hp}' and ivr= '{ivr}'
and tg_pros_daftar='{c_date}' and jam_daftar='{c_time}' and tg_pros_daftar='{c_date}' and jam_daftar='{c_time}'
and kd_status='{kd_status}' and kd_status='{kd_status}'
""".format( """.format(
no_rangka = values['no_rangka'], no_rangka = values['no_rangka'],
no_ktp = values['no_ktp'], no_ktp = values['no_ktp'],
email = values['email'], # email = values['email'],
no_hp = values['no_hp'], no_hp = values['no_hp'],
ivr = '11', ivr = '11',
c_date = values['c_date'], c_date = values['c_date'],
c_time = values['c_time'], c_time = values['c_time'],
kd_status = 2) kd_status = 2)
trx_timeout = 10 trx_timeout = 20
delay_after_insert = 1 delay_after_insert = 1
awal = time() awal = time()
p = None p = None
msg = None msg = None
while time() - awal < trx_timeout: while time() - awal < trx_timeout:
sleep(delay_after_insert) sleep(delay_after_insert)
try: try:
...@@ -370,6 +370,7 @@ def view_add(request): ...@@ -370,6 +370,7 @@ def view_add(request):
c_now = datetime.now() c_now = datetime.now()
ctrl['c_date'] = c_now.strftime('%m-%d-%Y') ctrl['c_date'] = c_now.strftime('%m-%d-%Y')
ctrl['c_time'] = c_now.strftime('%H:%M:%S') ctrl['c_time'] = c_now.strftime('%H:%M:%S')
ctrl['c_date2'] = c_now
row = save_request(ctrl, request) row = save_request(ctrl, request)
found = 1 found = 1
return HTTPFound(location=request.route_url('pkb-edit',nr=ctrl['no_rangka'], return HTTPFound(location=request.route_url('pkb-edit',nr=ctrl['no_rangka'],
...@@ -391,13 +392,12 @@ def query_id(request): ...@@ -391,13 +392,12 @@ def query_id(request):
sql_result1 = """ sql_result1 = """
SELECT * FROM v_smsdft SELECT * FROM v_smsdft
WHERE no_rangka= '{no_rangka}' and no_ktp= '{no_ktp}' WHERE no_rangka= '{no_rangka}' and no_ktp= '{no_ktp}'
and email = '{email}' and no_hp='{no_hp}' and ivr= '{ivr}' and no_hp='{no_hp}' and ivr= '{ivr}'
and tg_pros_daftar='{c_date}' and jam_daftar='{c_time}' and tg_pros_daftar='{c_date}' and jam_daftar='{c_time}'
and kd_status<>'{kd_status}' and kd_status<>'{kd_status}'
""".format( """.format(
no_rangka = request.matchdict['nr'], no_rangka = request.matchdict['nr'],
no_ktp = request.matchdict['nk'], no_ktp = request.matchdict['nk'],
email = request.matchdict['em'],
no_hp = request.matchdict['nh'], no_hp = request.matchdict['nh'],
c_date = request.matchdict['cd'], c_date = request.matchdict['cd'],
c_time = request.matchdict['ct'], c_time = request.matchdict['ct'],
...@@ -446,6 +446,7 @@ def view_edit(request): ...@@ -446,6 +446,7 @@ def view_edit(request):
c_now = datetime.now() c_now = datetime.now()
ctrl['c_date'] = c_now.strftime('%m-%d-%Y') ctrl['c_date'] = c_now.strftime('%m-%d-%Y')
ctrl['c_time'] = c_now.strftime('%H:%M:%S') ctrl['c_time'] = c_now.strftime('%H:%M:%S')
ctrl['c_date2'] = c_now
row = save_request(ctrl, request) row = save_request(ctrl, request)
found = 1 found = 1
print '----------------Row Hasil Select--------------------',row print '----------------Row Hasil Select--------------------',row
......
...@@ -194,7 +194,14 @@ class ViewLaporan(BaseViews): ...@@ -194,7 +194,14 @@ class ViewLaporan(BaseViews):
req = self.request req = self.request
params = req.params params = req.params
url_dict = req.matchdict url_dict = req.matchdict
u = req.user.id if not req.user:
req_user = False
req_user_id = None
else:
req_user = True
req_user_id = req.user.id
u = req_user_id # req.user.id
now = datetime.now().strftime('%Y-%m-%d') now = datetime.now().strftime('%Y-%m-%d')
thn = datetime.now().strftime('%Y') thn = datetime.now().strftime('%Y')
id = 'id' in params and params['id'] and int(params['id']) or 0 id = 'id' in params and params['id'] and int(params['id']) or 0
...@@ -212,6 +219,8 @@ class ViewLaporan(BaseViews): ...@@ -212,6 +219,8 @@ class ViewLaporan(BaseViews):
bulan2 = int(bulan)-1 bulan2 = int(bulan)-1
sptpd_id = 'sptpd_id' in params and params['sptpd_id'] and str(params['sptpd_id']) or '' sptpd_id = 'sptpd_id' in params and params['sptpd_id'] and str(params['sptpd_id']) or ''
if req_user == True:
if group_in(req, 'bendahara'): if group_in(req, 'bendahara'):
unit_id = DBSession.query(UserUnit.unit_id unit_id = DBSession.query(UserUnit.unit_id
).filter(UserUnit.user_id==u ).filter(UserUnit.user_id==u
...@@ -251,6 +260,11 @@ class ViewLaporan(BaseViews): ...@@ -251,6 +260,11 @@ class ViewLaporan(BaseViews):
unit_kd = "1.20.05." unit_kd = "1.20.05."
unit_nm = "BADAN PENDAPATAN DAERAH" unit_nm = "BADAN PENDAPATAN DAERAH"
unit_al = "Jl. Soekarno Hatta, No. 528, Bandung" unit_al = "Jl. Soekarno Hatta, No. 528, Bandung"
else:
unit_kd = "1.20.05."
unit_nm = "BADAN PENDAPATAN DAERAH"
unit_al = "Jl. Soekarno Hatta, No. 528, Bandung"
#-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------#
tgl_awal = 'tgl_awal' in params and params['tgl_awal'] and str(params['tgl_awal']) or 0 tgl_awal = 'tgl_awal' in params and params['tgl_awal'] and str(params['tgl_awal']) or 0
...@@ -865,7 +879,7 @@ class ViewLaporan(BaseViews): ...@@ -865,7 +879,7 @@ class ViewLaporan(BaseViews):
elif url_dict['act']=='Laporan_7' : elif url_dict['act']=='Laporan_7' :
query = DBSession.query(ARSspd.bayar.label('bayar'), query = DBSession.query(ARSspd.bayar.label('bayar'),
ARSspd.bunga.label('bunga'), (ARInvoice.denda+ARSspd.bunga).label('bunga'),
#ARInvoice.denda.label('bunga'), #ARInvoice.denda.label('bunga'),
ARSspd.tgl_bayar.label('tgl'), ARSspd.tgl_bayar.label('tgl'),
ARInvoice.kode.label('kd'), ARInvoice.kode.label('kd'),
......
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
</div> </div>
<!--npa --> <!--npa -->
<label for="npa" class="control-label col-md-3" id="req-npa"> <label for="npa" class="control-label col-md-3" id="req-npa">
NPS </label> NPA </label>
<div class="col-md-3" tal:define="field form['npa']" id="item-${field.oid}"> <div class="col-md-3" tal:define="field form['npa']" id="item-${field.oid}">
${structure:field.serialize()} ${structure:field.serialize()}
<script> <script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!