Commit 11c3d052 authored by Prajkta Patkar's avatar Prajkta Patkar
Browse files

Merge branch 'PRRules' into 'devel'

Pr rules

Closes #373

See merge request gnukhata/gkcore!377
parents dd6bb692 a1b60bbf
......@@ -113,7 +113,7 @@ class api_accountsbyrule(object):
return {"gkstatus":enumdict["ConnectionFailed"]}
if self.request.params['side']=="Cr":
try:
accs = self.con.execute("select accountname , accountcode from accounts where groupcode in (select groupcode from groupsubgroups where groupname in ('Bank','Cash')and orgcode = %d) and orgcode = %d order by accountname"%(authDetails["orgcode"],authDetails["orgcode"]))
accs = self.con.execute("select accountname , accountcode from accounts where accountname not in ('Opening Stock','Closing Stock','Stock at the Beginning','Profit & Loss','Income & Expenditure') and groupcode in (select groupcode from groupsubgroups where groupname in ('Bank','Cash','Direct Income','Indirect Income','Direct Expense','Indirect Expense') or subgroupof in (select groupcode from groupsubgroups where groupname in ('Direct Income','Indirect Income','Direct Expense','Indirect Expense') and orgcode = %d) and orgcode = %d) and orgcode = %d order by accountname"%(authDetails["orgcode"],authDetails["orgcode"], authDetails["orgcode"]))
list = []
for row in accs:
list.append({"accountname":row["accountname"], "accountcode":row["accountcode"]})
......@@ -124,6 +124,8 @@ class api_accountsbyrule(object):
return {"gkstatus":enumdict["ConnectionFailed"]}
finally:
self.con.close()
@view_config(request_param="type=receipt", renderer='json')
def receipt(self):
try:
......@@ -147,7 +149,7 @@ class api_accountsbyrule(object):
return {"gkstatus":enumdict["ConnectionFailed"]}
if self.request.params['side']=="Dr":
try:
accs = self.con.execute("select accountname , accountcode from accounts where orgcode = %d and groupcode in (select groupcode from groupsubgroups where groupname in ('Bank','Cash')and orgcode = %d ) order by accountname"%(authDetails["orgcode"],authDetails["orgcode"]))
accs = self.con.execute("select accountname , accountcode from accounts where accountname not in ('Opening Stock','Closing Stock','Stock at the Beginning','Profit & Loss','Income & Expenditure') and groupcode in (select groupcode from groupsubgroups where groupname in ('Bank','Cash','Direct Income','Indirect Income','Direct Expense','Indirect Expense') or subgroupof in (select groupcode from groupsubgroups where groupname in ('Direct Income','Indirect Income','Direct Expense','Indirect Expense') and orgcode = %d) and orgcode = %d) and orgcode = %d order by accountname"%(authDetails["orgcode"],authDetails["orgcode"], authDetails["orgcode"]))
list = []
for row in accs:
list.append({"accountname":row["accountname"], "accountcode":row["accountcode"]})
......
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