Commit a2787fcb authored by sanket shrawan kolnoorkar's avatar sanket shrawan kolnoorkar
Browse files

done with updation of null fields of bankdetails in database. and overall...

done with updation of null fields of bankdetails in database. and overall updation of organisation field. changes made in apy_organisation.py and organisation.py
parent e9b22d4d
......@@ -474,7 +474,13 @@ class api_organisation(object):
if(row["gstin"]==None):
gstin=""
orgDetails={"orgname":row["orgname"], "orgtype":row["orgtype"], "yearstart":str(row["yearstart"]), "yearend":str(row["yearend"]),"orgcity":orgcity, "orgaddr":orgaddr, "orgpincode":orgpincode, "orgstate":orgstate, "orgcountry":orgcountry, "orgtelno":orgtelno, "orgfax":orgfax, "orgwebsite":orgwebsite, "orgemail":orgemail, "orgpan":orgpan, "orgmvat":orgmvat, "orgstax":orgstax, "orgregno":orgregno, "orgregdate":orgregdate, "orgfcrano":orgfcrano, "orgfcradate":orgfcradate, "roflag":row["roflag"], "booksclosedflag":row["booksclosedflag"],"invflag":row["invflag"],"billflag":row["billflag"],"invsflag":row["invsflag"],"gstin":row["gstin"]}
if(row["bankdetails"]==None):
bankdetails=""
else:
bankdetails=row["bankdetails"]
orgDetails={"orgname":row["orgname"], "orgtype":row["orgtype"], "yearstart":str(row["yearstart"]), "yearend":str(row["yearend"]),"orgcity":orgcity, "orgaddr":orgaddr, "orgpincode":orgpincode, "orgstate":orgstate, "orgcountry":orgcountry, "orgtelno":orgtelno, "orgfax":orgfax, "orgwebsite":orgwebsite, "orgemail":orgemail, "orgpan":orgpan, "orgmvat":orgmvat, "orgstax":orgstax, "orgregno":orgregno, "orgregdate":orgregdate, "orgfcrano":orgfcrano, "orgfcradate":orgfcradate, "roflag":row["roflag"], "booksclosedflag":row["booksclosedflag"],"invflag":row["invflag"],"billflag":row["billflag"],"invsflag":row["invsflag"],"gstin":row["gstin"],"bankdetails":row["bankdetails"]}
self.con.close()
return {"gkstatus":enumdict["Success"],"gkdata":orgDetails}
except:
......@@ -568,6 +574,7 @@ class api_organisation(object):
def putOrg(self):
token = self.request.headers['gktoken']
authDetails = authCheck(token)
orgcode=authDetails['orgcode']
if authDetails["auth"]==False:
return {"gkstatus":enumdict["UnauthorisedAccess"]}
else:
......@@ -578,6 +585,8 @@ class api_organisation(object):
dataset = self.request.json_body
if userRole[0]==-1:
result = self.con.execute(gkdb.organisation.update().where(gkdb.organisation.c.orgcode==authDetails["orgcode"]).values(dataset))
if 'bankdetails' not in dataset:
self.con.execute("update organisation set bankdetails=NULL where bankdetails IS NOT NULL and orgcode=%d"%int(orgcode))
self.con.close()
return {"gkstatus":enumdict["Success"]}
else:
......
Supports Markdown
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