diff --git a/gkcore/models/gkdb.py b/gkcore/models/gkdb.py index 04a7f1db778d3f673453df8bf131e9fdf575479b..db7d9af9b987f91d22c8c8ba2e7916168e5693fc 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), @@ -304,6 +305,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), diff --git a/gkcore/views/api_organisation.py b/gkcore/views/api_organisation.py index 95a5817e0bf05ac5b9b0b5d563418a5bcfac6043..10a8900601330b1f0394b546ffee519836610447 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')")