| Line 20... |
Line 20... |
| 20 |
warehouseId = 7573
|
20 |
warehouseId = 7573
|
| 21 |
# registered address
|
21 |
# registered address
|
| 22 |
seller.address = 'Khasra No-322, Second Floor, Opp.Purani Tel Mil, Neb Sarai, New Delhi-110068'
|
22 |
seller.address = 'Khasra No-322, Second Floor, Opp.Purani Tel Mil, Neb Sarai, New Delhi-110068'
|
| 23 |
# keep one of , seller.gstn = '' or
|
23 |
# keep one of , seller.gstn = '' or
|
| 24 |
seller.tin = ''
|
24 |
seller.tin = ''
|
| 25 |
seller.gstin = 'DELGSTIN'
|
25 |
seller.gstin = '07AAFCM7436G1ZD'
|
| 26 |
# short for seller e.g. NSSPL-STATE
|
26 |
# short for seller e.g. NSSPL-STATE
|
| 27 |
seller.label = 'NSSPL-DL'
|
27 |
seller.label = 'SOPL-DL'
|
| 28 |
seller.organisation_id = company.id
|
28 |
seller.organisation_id = company.id
|
| 29 |
# 0 for delhi, 1 MH, 2 karnataka, 3 Haryana, 4 Rajasthan, 5 Telangana, 6 Gujarat, 7 UP, 8, Punjab
|
29 |
# 0 for delhi, 1 MH, 2 karnataka, 3 Haryana, 4 Rajasthan, 5 Telangana, 6 Gujarat, 7 UP, 8, Punjab
|
| 30 |
seller.state_id = 0
|
30 |
seller.state_id = 0
|
| 31 |
session.merge(seller)
|
31 |
session.merge(seller)
|
| 32 |
# Create one warehouse for this seller
|
32 |
# Create one warehouse for this seller
|
| 33 |
sellerWarehouse = SellerWarehouse()
|
33 |
sellerWarehouse = SellerWarehouse()
|
| 34 |
sellerWarehouse.created_on = datetime.datetime.now()
|
34 |
sellerWarehouse.created_on = datetime.datetime.now()
|
| 35 |
sellerWarehouse.is_active = True
|
35 |
sellerWarehouse.is_active = True
|
| 36 |
# 0-B2C, 1-B2B
|
36 |
# 0-B2C, 1-B2B
|
| - |
|
37 |
#This is no more valid as single invoice has to be generated
|
| 37 |
sellerWarehouse.orderType = 0
|
38 |
sellerWarehouse.orderType = 0
|
| 38 |
# Prefix that will be used during invoice generation at the time of billing.
|
39 |
# Prefix that will be used during invoice generation at the time of billing.
|
| 39 |
sellerWarehouse.prefix = 'NSDL'
|
40 |
sellerWarehouse.prefix = 'SOPL'
|
| 40 |
# This has to be created in old system and to be set accordingly
|
41 |
# This has to be created in old system and to be set accordingly
|
| 41 |
sellerWarehouse.warehouse_id = warehouseId
|
42 |
sellerWarehouse.warehouse_id = warehouseId
|
| 42 |
# The sequence of invoice in system is controlled from here.
|
43 |
# The sequence of invoice in system is controlled from here.
|
| 43 |
sellerWarehouse.id = 0
|
44 |
sellerWarehouse.id = 0
|
| 44 |
sellerWarehouse.seller_id = seller.id
|
45 |
sellerWarehouse.seller_id = seller.id
|
| Line 56... |
Line 57... |
| 56 |
# The sequence of invoice in system is controlled from here.
|
57 |
# The sequence of invoice in system is controlled from here.
|
| 57 |
#sellerWarehouse1.id = 0
|
58 |
#sellerWarehouse1.id = 0
|
| 58 |
#sellerWarehouse1.seller_id = seller.id
|
59 |
#sellerWarehouse1.seller_id = seller.id
|
| 59 |
#session.merge(sellerWarehouse1)
|
60 |
#session.merge(sellerWarehouse1)
|
| 60 |
# Create warehouse addresses
|
61 |
# Create warehouse addresses
|
| 61 |
whm1 = WarehouseAddressMaster()
|
62 |
# whm1 = WarehouseAddressMaster()
|
| 62 |
# complete address without pin
|
63 |
# # complete address without pin
|
| 63 |
whm1.address = 'Khasra No-322, Second Floor, Opp.Purani Tel Mil, Neb Sarai, New Delhi'
|
64 |
# whm1.address = 'Khasra No-322, Second Floor, Opp.Purani Tel Mil, Neb Sarai, New Delhi'
|
| 64 |
whm1.pin = 110068
|
65 |
# whm1.pin = 110068
|
| 65 |
whm1.created = datetime.datetime.now()
|
66 |
# whm1.created = datetime.datetime.now()
|
| 66 |
# number of person responsible for warehouse
|
67 |
# # number of person responsible for warehouse
|
| 67 |
whm1.contact_number = '9990381569'
|
68 |
# whm1.contact_number = '9990381569'
|
| 68 |
whm1.state_id = 0
|
69 |
# whm1.state_id = 0
|
| 69 |
session.merge(whm1)
|
70 |
# session.merge(whm1)
|
| 70 |
|
71 |
|
| 71 |
warehouseAddressMapping = WarehouseAddressMapping()
|
72 |
warehouseAddressMapping = WarehouseAddressMapping()
|
| 72 |
warehouseAddressMapping.address_id = whm1.id
|
73 |
#warehouseAddressMapping.address_id = whm1.id
|
| - |
|
74 |
warehouseAddressMapping.address_id = 10
|
| 73 |
warehouseAddressMapping.created = datetime.datetime.now()
|
75 |
warehouseAddressMapping.created = datetime.datetime.now()
|
| 74 |
warehouseAddressMapping.updated = datetime.datetime.now()
|
76 |
warehouseAddressMapping.updated = datetime.datetime.now()
|
| 75 |
warehouseAddressMapping.warehouse_id = warehouseId
|
77 |
warehouseAddressMapping.warehouse_id = warehouseId
|
| 76 |
session.merge(warehouseAddressMapping)
|
78 |
session.merge(warehouseAddressMapping)
|
| 77 |
|
79 |
|
| Line 137... |
Line 139... |
| 137 |
|
139 |
|
| 138 |
|
140 |
|
| 139 |
|
141 |
|
| 140 |
def main():
|
142 |
def main():
|
| 141 |
company = Organisation()
|
143 |
company = Organisation()
|
| 142 |
company.name = 'New Spice Solutions Private Limited'
|
144 |
company.name = 'SPICE ONLINE PRIVATE LIMITED'
|
| 143 |
company.address = 'Global Knowledge Park, 19A & 19B, 6th Floor, Sector 125, Noida, Uttar Pradesh - 201301'
|
145 |
company.address = '512-B, Modi Tower, 98, Nehru Place, New Delhi-110019'
|
| 144 |
company.type = 'company'
|
146 |
company.type = 'company'
|
| 145 |
company.registered_id = 'U2222UP2009PTC036977'
|
147 |
company.registered_id = 'U74140DL2008PTC183856'
|
| 146 |
session.merge(company)
|
148 |
session.merge(company)
|
| 147 |
create_delhi(company)
|
149 |
create_delhi(company)
|
| 148 |
#create_haryana(company)
|
150 |
#create_haryana(company)
|
| 149 |
session.commit()
|
151 |
session.commit()
|
| 150 |
|
152 |
|
| 151 |
|
153 |
|
| 152 |
|
154 |
|
| 153 |
|
155 |
|
| 154 |
|
156 |
|
| 155 |
if __name__ == '__main__':
|
157 |
if __name__ == '__main__':
|
| 156 |
#DataService.initialize()
|
158 |
DataService.initialize()
|
| 157 |
#main()
|
159 |
main()
|
| 158 |
tc = TransactionClient().get_client()
|
160 |
tc = TransactionClient().get_client()
|
| 159 |
print tc.getSellerInfo(12)
|
161 |
#print tc.getSellerInfo(13)
|