From 29fc82acc61294f7ad1d6823383d754d4469dec9 Mon Sep 17 00:00:00 2001 From: kk Date: Fri, 27 Oct 2017 12:27:19 +0530 Subject: [PATCH 1/2] Added CESS as json field. --- gkcore/models/gkdb.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gkcore/models/gkdb.py b/gkcore/models/gkdb.py index 04a7f1d..6f0f050 100644 --- a/gkcore/models/gkdb.py +++ b/gkcore/models/gkdb.py @@ -304,6 +304,7 @@ invoice = Table('invoice',metadata, Column('issuername', UnicodeText), Column('designation', UnicodeText), Column('tax', JSONB), + Column('cess',JSONB), Column('amountpaid',Numeric(13,2),default=0.00), Column('invoicetotal', Numeric(13,2),nullable=False), Column('icflag',Integer,default=9), -- GitLab From 531a240db18a8c79f8779382ca03073ce3038387 Mon Sep 17 00:00:00 2001 From: Prajkta_Patkar Date: Fri, 27 Oct 2017 15:38:31 +0530 Subject: [PATCH 2/2] documentation added and cess field added in gkupgrade --- gkcore/models/gkdb.py | 5 +++-- gkcore/views/api_organisation.py | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gkcore/models/gkdb.py b/gkcore/models/gkdb.py index 6f0f050..db7d9af 100644 --- a/gkcore/models/gkdb.py +++ b/gkcore/models/gkdb.py @@ -291,9 +291,10 @@ Note that invoice is connected to a voucher. So the accounting part is thus connected with stock movement of that cost. A new json field called freeqty. Consignee (shipped to) is a json field which has name , address, state, statecode,gstin as keys along with its value. -Bankdetails is a dictionary will have bankname,accountno. and ifsccode. +Bankdetails is a dictionary will have bankname,accountno., branchname and ifsccode. taxstate is a destination sate. -sourcestate is source state from where invoice is initiated +sourcestate is source state from where invoice is initiated. +Structure of a tax field is {productcode:taxrate} """ invoice = Table('invoice',metadata, Column('invid',Integer,primary_key=True), diff --git a/gkcore/views/api_organisation.py b/gkcore/views/api_organisation.py index 95a5817..10a8900 100644 --- a/gkcore/views/api_organisation.py +++ b/gkcore/views/api_organisation.py @@ -23,7 +23,7 @@ Contributors: "Krishnakant Mane" "Ishan Masdekar " "Navin Karkera" -'Prajkta Patkar' +'Prajkta Patkar' 'Reshma Bhatwadekar' """ @@ -60,6 +60,7 @@ class api_organisation(object): """ self.con = eng.connect() try: + self.con.execute(select([func.count(gkdb.invoice.c.cess)])) self.con.execute(select([func.count(gkdb.state.c.statecode)])) self.con.execute(select([func.count(gkdb.invoice.c.reversecharge)])) self.con.execute(select(gkdb.organisation.c.gstin)) @@ -78,6 +79,7 @@ class api_organisation(object): self.con.execute(select(gkdb.organisation.c.billflag)) self.con.execute(select([func.count(gkdb.billwise.c.billid)])) except: + self.con.execute("alter table invoice add cess jsonb") self.con.execute("alter table product add UNIQUE(productdesc,orgcode)") self.con.execute("create table state( statecode integer,statename text,primary key (statecode))") self.con.execute("insert into state( statecode, statename)values(1, 'Jammu and Kashmir')") -- GitLab