| Line 64... |
Line 64... |
| 64 |
holdOverride = Field(Boolean)
|
64 |
holdOverride = Field(Boolean)
|
| 65 |
packQuantity = Field(Integer, default=1, server_default="1")
|
65 |
packQuantity = Field(Integer, default=1, server_default="1")
|
| 66 |
quantityStep = Field(Integer, default=1, server_default="1")
|
66 |
quantityStep = Field(Integer, default=1, server_default="1")
|
| 67 |
minimumBuyQuantity = Field(Integer, default=1, server_default="1")
|
67 |
minimumBuyQuantity = Field(Integer, default=1, server_default="1")
|
| 68 |
maximumBuyQuantity = Field(Integer, default=0, server_default="0")
|
68 |
maximumBuyQuantity = Field(Integer, default=0, server_default="0")
|
| - |
|
69 |
hsnCode = Field(String(12))
|
| 69 |
using_options(shortnames=True)
|
70 |
using_options(shortnames=True)
|
| 70 |
using_table_options(mysql_engine="InnoDB")
|
71 |
using_table_options(mysql_engine="InnoDB")
|
| 71 |
|
72 |
|
| 72 |
def __repr__(self):
|
73 |
def __repr__(self):
|
| 73 |
return "<Item>%d</item>" % (self.id)
|
74 |
return "<Item>%d</item>" % (self.id)
|
| Line 76... |
Line 77... |
| 76 |
itemId = Field(Integer, primary_key=True, autoincrement=False)
|
77 |
itemId = Field(Integer, primary_key=True, autoincrement=False)
|
| 77 |
stateId = Field(Integer, primary_key=True, autoincrement=False)
|
78 |
stateId = Field(Integer, primary_key=True, autoincrement=False)
|
| 78 |
vatPercentage = Field(Float)
|
79 |
vatPercentage = Field(Float)
|
| 79 |
using_options(shortnames=True)
|
80 |
using_options(shortnames=True)
|
| 80 |
using_table_options(mysql_engine="InnoDB")
|
81 |
using_table_options(mysql_engine="InnoDB")
|
| - |
|
82 |
|
| - |
|
83 |
class CategoryHsnCodes(Entity):
|
| - |
|
84 |
categoryId = Field(Integer, primary_key=True)
|
| - |
|
85 |
hsnCode = Field(String(12), primary_key=True)
|
| - |
|
86 |
using_options(shortnames=True)
|
| - |
|
87 |
using_table_options(mysql_engine="InnoDB")
|
| - |
|
88 |
|
| 81 |
|
89 |
|
| 82 |
|
90 |
|
| 83 |
class ItemChangeLog(Entity):
|
91 |
class ItemChangeLog(Entity):
|
| 84 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
92 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
| 85 |
old_status = Field(Integer)
|
93 |
old_status = Field(Integer)
|
| Line 152... |
Line 160... |
| 152 |
maxVal = Field(Integer, primary_key=True, autoincrement=False)
|
160 |
maxVal = Field(Integer, primary_key=True, autoincrement=False)
|
| 153 |
vatPercent = Field(Float)
|
161 |
vatPercent = Field(Float)
|
| 154 |
using_options(shortnames=True)
|
162 |
using_options(shortnames=True)
|
| 155 |
using_table_options(mysql_engine="InnoDB")
|
163 |
using_table_options(mysql_engine="InnoDB")
|
| 156 |
|
164 |
|
| - |
|
165 |
class CentralGstMaster(Entity):
|
| - |
|
166 |
hsnCode = Field(String(12), primary_key=True)
|
| - |
|
167 |
startDate = Field(DateTime, primary_key=True)
|
| - |
|
168 |
gstPercent = Field(Float)
|
| - |
|
169 |
using_options(shortnames=True)
|
| - |
|
170 |
using_table_options(mysql_engine="InnoDB")
|
| - |
|
171 |
|
| - |
|
172 |
class StateGstMaster(Entity):
|
| - |
|
173 |
hsnCode = Field(String(12), primary_key=True)
|
| - |
|
174 |
startDate = Field(DateTime, primary_key=True)
|
| - |
|
175 |
stateId = Field(Integer, primary_key=True, autoincrement=False)
|
| - |
|
176 |
sgstPercent = Field(Float)
|
| - |
|
177 |
cgstPercent = Field(Float)
|
| - |
|
178 |
using_options(shortnames=True)
|
| - |
|
179 |
using_table_options(mysql_engine="InnoDB")
|
| - |
|
180 |
|
| 157 |
class OOSTracker(Entity):
|
181 |
class OOSTracker(Entity):
|
| 158 |
itemId = Field(Integer, primary_key=True)
|
182 |
itemId = Field(Integer, primary_key=True)
|
| 159 |
using_options(shortnames=True)
|
183 |
using_options(shortnames=True)
|
| 160 |
using_table_options(mysql_engine="InnoDB")
|
184 |
using_table_options(mysql_engine="InnoDB")
|
| 161 |
|
185 |
|
| Line 829... |
Line 853... |
| 829 |
def initialize(dbname='catalog', db_hostname="localhost", setup=True):
|
853 |
def initialize(dbname='catalog', db_hostname="localhost", setup=True):
|
| 830 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
854 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
| 831 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
855 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
| 832 |
cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
856 |
cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
| 833 |
metadata.bind = cengine
|
857 |
metadata.bind = cengine
|
| 834 |
metadata.bind.echo = False
|
858 |
metadata.bind.echo = True
|
| 835 |
setup_all(setup)
|
859 |
setup_all(setup)
|
| 836 |
|
860 |
|
| 837 |
if __name__=="__main__":
|
861 |
if __name__=="__main__":
|
| 838 |
initialize()
|
862 |
initialize()
|