Subversion Repositories SmartDukaan

Rev

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

Rev 1271 Rev 1278
Line 30... Line 30...
30
    for rownum in range(1, num_rows):
30
    for rownum in range(1, num_rows):
31
        #print sheet.row_values(rownum)
31
        #print sheet.row_values(rownum)
32
        catalog_item_id, category_id, product_group = [None, None, None]
32
        catalog_item_id, category_id, product_group = [None, None, None]
33
        
33
        
34
        #hotspot_category, brand, model_number, color, model_name, mrp, mop, dp, xfer_price, weight, start_date, deal_text, deal_value, comments, catalog_item_id, category_id = sheet.row_values(rownum)[0:17]
34
        #hotspot_category, brand, model_number, color, model_name, mrp, mop, dp, xfer_price, weight, start_date, deal_text, deal_value, comments, catalog_item_id, category_id = sheet.row_values(rownum)[0:17]
35
        brand, model_number, model_name, color, dp, mrp, mop, comments, hotspot_category, unused_feature, xfer_price, weight, start_date, deal_text, deal_value = sheet.row_values(rownum)[0:15]
35
        brand, model_number, model_name, color, dp, mrp, mop, comments, hotspot_category, unused_feature, xfer_price, weight, start_date, deal_text, deal_value, catalog_item_id, category_id = sheet.row_values(rownum)[0:17]
36
        #product_group, brand, model_number, color, xfer_price, mop, mrp, catalog_item_id, category_id = sheet.row_values(rownum)[0:9]
36
        #product_group, brand, model_number, color, xfer_price, mop, mrp, catalog_item_id, category_id = sheet.row_values(rownum)[0:9]
37
        if isinstance(model_number, float):
37
        if isinstance(model_number, float):
38
            model_number = str(int(model_number))
38
            model_number = str(int(model_number))
39
        
39
        
40
        key = brand + ';' + model_number + ';' + color
40
        key = brand + ';' + model_number + ';' + color
Line 82... Line 82...
82
                    #If a similar item already exists for a product group, brand and model_number, set it as same.
82
                    #If a similar item already exists for a product group, brand and model_number, set it as same.
83
                    item.catalog_item_id = similar_item.catalog_item_id
83
                    item.catalog_item_id = similar_item.catalog_item_id
84
                    item.category = similar_item.category
84
                    item.category = similar_item.category
85
                    #item.status = status.ACTIVE
85
                    #item.status = status.ACTIVE
86
        else:
86
        else:
-
 
87
            #Check if this item already existed and one of its price parameters has changed
-
 
88
            # in which case we add it to the list of updated items for reporting.
87
            if item.mrp != mrp or item.dealerPrice != dp or item.transfer_price != xfer_price:
89
            if item.mrp != mrp or item.dealerPrice != dp or item.transfer_price != xfer_price:
88
                updated_items.append(sheet.row_values(rownum)[0:15] + [item.mrp, item.dealerPrice, item.transfer_price])
90
                updated_items.append(sheet.row_values(rownum)[0:15] + [item.mrp, item.dealerPrice, item.transfer_price])
89
 
91
 
90
        if category_id !=None and category_id != "":
92
        if category_id !=None and category_id != "":
91
            item.category = int(category_id)
93
            item.category = int(category_id)