Subversion Repositories SmartDukaan

Rev

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

Rev 1833 Rev 1965
Line 73... Line 73...
73
        
73
        
74
        if item is None:
74
        if item is None:
75
            #print "[ADDING:]{0} {1} {2} {3} to our catalogue.".format(product_group, brand, model_number, color)
75
            #print "[ADDING:]{0} {1} {2} {3} to our catalogue.".format(product_group, brand, model_number, color)
76
            new_items.append(rownum)
76
            new_items.append(rownum)
77
            item = Item()
77
            item = Item()
78
            item.product_group = product_group
-
 
79
            item.brand = our_brand
-
 
80
            item.model_number = our_model_number
-
 
81
            item.color = our_color
-
 
82
            item.status = status.IN_PROCESS
78
            item.status = status.IN_PROCESS
83
            item.addedOn = updatedOn
79
            item.addedOn = updatedOn
84
            item.hotspotCategory = category
80
            item.hotspotCategory = category
85
            
81
            
86
            if category == 'Handsets':
82
            if category == 'Handsets':
Line 117... Line 113...
117
                    item.category = similar_item.category
113
                    item.category = similar_item.category
118
                    item.status = similar_item.status
114
                    item.status = similar_item.status
119
        else:
115
        else:
120
            # If this item already existed and one of its price parameters has changed
116
            # If this item already existed and one of its price parameters has changed
121
            # in which case we add it to the list of updated items for reporting.
117
            # in which case we add it to the list of updated items for reporting.
-
 
118
            if item.status == status.PHASED_OUT:
-
 
119
                item.status = status.IN_PROCESS #Not the ideal choice but we don't know whether content has been generated for it beforehand.
122
            vendor_item_pricing = VendorItemPricing.get_by(vendor=vendor, item=item)
120
            vendor_item_pricing = VendorItemPricing.get_by(vendor=vendor, item=item)
123
            if vendor_item_pricing is None:
121
            if vendor_item_pricing is None:
124
                vendor_item_pricing = VendorItemPricing(vendor=vendor, item=item)
122
                vendor_item_pricing = VendorItemPricing(vendor=vendor, item=item)
125
                session.add(vendor_item_pricing)
123
                session.add(vendor_item_pricing)
126
            
124
            
127
            if item.mrp != mrp or vendor_item_pricing.dealerPrice != dp or vendor_item_pricing.transfer_price != xfer_price or item.sellingPrice != sp:
125
            if item.mrp != mrp or vendor_item_pricing.dealerPrice != dp or vendor_item_pricing.transfer_price != xfer_price or item.sellingPrice != sp:
128
                updated_items.append(sheet.row_values(rownum)[0:19] + [item.mrp, item.dealerPrice, item.transfer_price])
126
                updated_items.append(sheet.row_values(rownum)[0:19] + [item.mrp, item.dealerPrice, item.transfer_price])
129
 
127
 
-
 
128
        item.product_group = product_group
-
 
129
        item.brand = our_brand
-
 
130
        item.model_number = our_model_number
-
 
131
        item.color = our_color
-
 
132
 
130
        if category_id !=None and category_id != "":
133
        if category_id !=None and category_id != "":
131
            item.category = int(category_id)
134
            item.category = int(category_id)
132
 
135
 
133
        if dp != "":
136
        if dp != "":
134
            item.dealerPrice = dp
137
            item.dealerPrice = dp