Commit 6c0b2dd5 authored by Nitesh Laxman Chaughule 's avatar Nitesh Laxman Chaughule
Browse files

"address" field added in 'invoice' table and changes in gkupgrade function for same field.

"bankdetails" field added in 'customerandsupplier' table and changes in gkupgrade function for same field.
parent a2726c50
......@@ -211,6 +211,7 @@ customerandsupplier = Table('customerandsupplier',metadata,
Column('custdoc',JSONB),
Column('state', UnicodeText),
Column('csflag',Integer,nullable=False),
Column('bankdetails',JSONB),
Column('orgcode',Integer, ForeignKey('organisation.orgcode', ondelete="CASCADE"), nullable=False),
UniqueConstraint('orgcode','custname'),
UniqueConstraint('orgcode','custname','custemail','csflag'),
......@@ -330,6 +331,7 @@ invoice = Table('invoice',metadata,
Column('dateofsupply',DateTime),
Column('discount',JSONB),
Column('paymentmode',Integer,default=2),
Column('address',UnicodeText),
UniqueConstraint('orgcode','invoiceno','custid','icflag'),
Index("invoice_orgcodeindex","orgcode"),
Index("invoice_invoicenoindex","invoiceno")
......
......@@ -62,6 +62,8 @@ class api_organisation(object):
"""
self.con = eng.connect()
try:
self.con.execute(select(gkdb.invoice.c.address))
self.con.execute(select(gkdb.customerandsupplier.c.bankdetails))
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)]))
......@@ -88,6 +90,8 @@ 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 address text")
self.con.execute("alter table customerandsupplier add bankdetails jsonb")
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")
......
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