Commit 9fece18e authored by Abhijith Balan's avatar Abhijith Balan
Browse files

Changed request param from type to invtype

parent 6221833e
......@@ -214,10 +214,11 @@ It will be used for creating entries in the billwise table and updating it as ne
for inv in invoicesData:
custData = self.con.execute(select([customerandsupplier.c.custname, customerandsupplier.c.csflag, customerandsupplier.c.custid]).where(customerandsupplier.c.custid == inv["custid"]))
customerdata = custData.fetchone()
if self.request.params.has_key('type'):
if str(self.request.params["type"]) == 'sale' and int(customerdata['csflag']) == 3:
# If there is a invtype parameter then only sale/purchase invoices are returned depending on the value of type.
if self.request.params.has_key('invtype'):
if str(self.request.params["invtype"]) == 'sale' and int(customerdata['csflag']) == 3:
unAdjInvoices.append({"invid":inv["invid"],"invoiceno":inv["invoiceno"],"invoicedate":datetime.strftime(inv["invoicedate"],'%d-%m-%Y'),"invoicetotal":"%.2f"%(float(inv["invoicetotal"])),"balanceamount":"%.2f"%(float(inv["invoicetotal"]-inv["amountpaid"])), "custname":customerdata["custname"], "custid":customerdata["custid"], "csflag": customerdata["csflag"]})
elif str(self.request.params["type"]) == 'purchase' and int(custname['csflag']) == 19:
elif str(self.request.params["invtype"]) == 'purchase' and int(customerdata['csflag']) == 19:
unAdjInvoices.append({"invid":inv["invid"],"invoiceno":inv["invoiceno"],"invoicedate":datetime.strftime(inv["invoicedate"],'%d-%m-%Y'),"invoicetotal":"%.2f"%(float(inv["invoicetotal"])),"balanceamount":"%.2f"%(float(inv["invoicetotal"]-inv["amountpaid"])), "custname":customerdata["custname"], "custid":customerdata["custid"], "csflag": customerdata["csflag"]})
else:
unAdjInvoices.append({"invid":inv["invid"],"invoiceno":inv["invoiceno"],"invoicedate":datetime.strftime(inv["invoicedate"],'%d-%m-%Y'),"invoicetotal":"%.2f"%(float(inv["invoicetotal"])),"balanceamount":"%.2f"%(float(inv["invoicetotal"]-inv["amountpaid"])), "custname":customerdata["custname"], "custid":customerdata["custid"], "csflag": customerdata["csflag"]})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment