Subversion Repositories SmartDukaan

Rev

Rev 515 | Rev 963 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 515 Rev 596
Line 5... Line 5...
5
import xlrd
5
import xlrd
6
from shop2020.clients.WidgetClient import WidgetClient
6
from shop2020.clients.WidgetClient import WidgetClient
7
 
7
 
8
inventory_client = InventoryClient()
8
inventory_client = InventoryClient()
9
 
9
 
10
inventory_client.__start__()
10
#inventory_client.__start__()
11
 
11
 
12
client = inventory_client.get_client()
12
client = inventory_client.get_client()
13
 
13
 
14
 
14
 
15
#For accessories
15
#For accessories
-
 
16
"""
16
wb = xlrd.open_workbook('/home/rajveer/Desktop/accessories.xls')
17
wb = xlrd.open_workbook('/home/rajveer/Desktop/test1.xls')
17
sheet = wb.sheet_by_index(0)
18
sheet = wb.sheet_by_index(0)
18
 
19
 
19
count = 1
20
count = 1
20
for rownum in range(sheet.nrows):
21
for rownum in range(sheet.nrows):
21
    
22
    
Line 36... Line 37...
36
    item.itemStatus = status.ACTIVE
37
    item.itemStatus = status.ACTIVE
37
    client.addItem(item)
38
    client.addItem(item)
38
    count = count + 1
39
    count = count + 1
39
 
40
 
40
"""
41
"""
-
 
42
 
41
#For phones
43
#For phones
42
wb = xlrd.open_workbook('/home/rajveer/Desktop/phone-models.xls')
44
wb = xlrd.open_workbook('/home/rajveer/Desktop/phone-models.xls')
43
sheet = wb.sheet_by_index(0)
45
sheet = wb.sheet_by_index(0)
44
 
46
 
45
count = 0
47
count = 0
46
for rownum in range(sheet.nrows):
48
for rownum in range(sheet.nrows):
47
    #print sheet.row_values(rownum)
49
    #print sheet.row_values(rownum)
48
    print sheet.row_values(count)
-
 
49
    count = count + 1
-
 
50
 
50
 
51
count = 1
-
 
52
items = client.getAllItems(False);    
-
 
53
for item in items:
51
    item = Item()
-
 
52
 
54
    item.catalogItemId = sheet.row_values(count)[0]
53
    item.catalogItemId = long(sheet.row_values(count)[0])
55
    item.category = sheet.row_values(count)[1]
54
    #item.category = sheet.row_values(count)[1]
56
    item.manufacturerName = sheet.row_values(count)[2]
55
    #item.manufacturerName = sheet.row_values(count)[2]
57
    item.modelNumber = sheet.row_values(count)[3]
56
    #item.modelNumber = sheet.row_values(count)[3]
58
    item.modelName = sheet.row_values(count)[4]
57
    #item.modelName = sheet.row_values(count)[4]
59
    item.mrp = sheet.row_values(count)[5]
58
    #item.mrp = long(sheet.row_values(count)[5])
60
    item.sellingPrice = sheet.row_values(count)[6]
59
    #item.sellingPrice = long(sheet.row_values(count)[6])
-
 
60
    
-
 
61
    item.mrp = 981*(count+1)
-
 
62
    item.sellingPrice = 819*(count+1)
-
 
63
    item.vendorItemId = "CBHCC"+str(count)
61
    item.itemStatus = status.ACTIVE
64
    item.itemStatus = status.ACTIVE
62
    count = count + 1
-
 
63
    client.updateItem(item)
-
 
64
""" 
-
 
65
65
    client.addItem(item)
-
 
66
66
67