Commit a2726c50 authored by Nitesh Laxman Chaughule 's avatar Nitesh Laxman Chaughule
Browse files

'paymentmode' column is added in invoice table and respected changes in gkupgrade function.

parent 77daf30c
......@@ -297,7 +297,8 @@ Bankdetails is a dictionary will have bankname,accountno., branchname and ifscco
taxstate is a destination sate.
sourcestate is source state from where invoice is initiated.
Structure of a tax field is {productcode:taxrate}
save orgstategstin of sourcestate for organisation.
save orgstategstin of sourcestate for organisation.
paymentmode states that Mode of payment i.e 'bank' or 'cash'. Default value is set as 2 for 'bank' and 3 for 'cash'.
"""
invoice = Table('invoice',metadata,
Column('invid',Integer,primary_key=True),
......@@ -328,6 +329,7 @@ invoice = Table('invoice',metadata,
Column('vehicleno',UnicodeText),
Column('dateofsupply',DateTime),
Column('discount',JSONB),
Column('paymentmode',Integer,default=2),
UniqueConstraint('orgcode','invoiceno','custid','icflag'),
Index("invoice_orgcodeindex","orgcode"),
Index("invoice_invoicenoindex","invoiceno")
......
......@@ -62,6 +62,7 @@ class api_organisation(object):
"""
self.con = eng.connect()
try:
self.con.execute(select(gkdb.invoice.c.paymentmode))
self.con.execute(select(gkdb.organisation.c.bankdetails))
self.con.execute(select([func.count(gkdb.delchal.c.consignee)]))
self.con.execute(select([func.count(gkdb.invoice.c.orgstategstin)]))
......@@ -87,6 +88,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 paymentmode integer")
self.con.execute("alter table organisation add bankdetails json")
self.con.execute("alter table delchal add consignee jsonb")
self.con.execute("alter table invoice add orgstategstin text")
......
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