Subversion Repositories SmartDukaan

Rev

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

Rev 9365 Rev 9366
Line 172... Line 172...
172
    sheet.write(0, 17, "Lowest Offer Price", heading_xf)
172
    sheet.write(0, 17, "Lowest Offer Price", heading_xf)
173
    sheet.write(0, 18, "Inventory of Top Vendors", heading_xf)
173
    sheet.write(0, 18, "Inventory of Top Vendors", heading_xf)
174
    sheet.write(0, 19, "Our Inventory", heading_xf)
174
    sheet.write(0, 19, "Our Inventory", heading_xf)
175
    sheet.write(0, 20, "Our NLC", heading_xf)
175
    sheet.write(0, 20, "Our NLC", heading_xf)
176
    sheet.write(0, 21, "Lowest Possible TP", heading_xf)
176
    sheet.write(0, 21, "Lowest Possible TP", heading_xf)
-
 
177
    sheet.write(0, 22, "Lowest Possible SP", heading_xf)
-
 
178
    sheet.write(0, 23, "Competition Basis ", heading_xf)
177
    sheet.write(0, 22, "Can Compete", heading_xf)
179
    sheet.write(0, 24, "Can Compete", heading_xf)
178
    sheet.write(0, 23, "Proposed TP", heading_xf)
180
    sheet.write(0, 25, "Proposed TP", heading_xf)
179
    sheet.write(0, 24, "Proposed SP", heading_xf)    
181
    sheet.write(0, 26, "Proposed SP", heading_xf)  
-
 
182
    sheet.write(0, 27, "Sales Potential", heading_xf)    
180
    
183
    
181
    i, sheet_iterator=1,1
184
    i, sheet_iterator=1,1
182
    for one_line in all_lines:
185
    for one_line in all_lines:
183
        supc = all_supc[i-1]
186
        supc = all_supc[i-1]
184
        supc_data = fetchDetails(supc)
187
        supc_data = fetchDetails(supc)
Line 228... Line 231...
228
        if supc_data.rank==1:
231
        if supc_data.rank==1:
229
            i+=1
232
            i+=1
230
            sheet_iterator+=1
233
            sheet_iterator+=1
231
            continue
234
            continue
232
        lowest_possible_tp = one_line.our_nlc/0.988+15+6
235
        lowest_possible_tp = one_line.our_nlc/0.988+15+6
-
 
236
        lowest_possible_sp = (lowest_possible_tp+courierCost)/0.9597
233
        sheet.write(sheet_iterator, 21, round(lowest_possible_tp))
237
        sheet.write(sheet_iterator, 21, round(lowest_possible_tp))
-
 
238
        sheet.write(sheet_iterator, 22, round(lowest_possible_sp))
-
 
239
        if (supc_data.ourOfferPrice == supc_data.ourSp):
-
 
240
            sheet.write(sheet_iterator, 23, 'SP')
-
 
241
        else:
-
 
242
            sheet.write(sheet_iterator, 23, 'TP')
234
        proposed_tp = 0
243
        proposed_tp = 0
235
        if lowestTp > lowest_possible_tp:
244
        if lowestTp > lowest_possible_tp:
236
            sheet.write(sheet_iterator, 22, "Yes")
245
            sheet.write(sheet_iterator, 24, "Yes")
237
            proposed_tp  = max(lowestTp - max((10, lowestTp*0.001)), lowest_possible_tp)
246
            proposed_tp  = max(lowestTp - max((10, lowestTp*0.001)), lowest_possible_tp)
238
            sheet.write(sheet_iterator, 23, round(proposed_tp))
247
            sheet.write(sheet_iterator, 25, round(proposed_tp))
239
            sheet.write(sheet_iterator, 24, round((proposed_tp+courierCost)/0.9597)) 
248
            sheet.write(sheet_iterator, 26, round((proposed_tp+courierCost)/0.9597)) 
-
 
249
        else:
-
 
250
            sheet.write(sheet_iterator, 24, "No")
-
 
251
            
-
 
252
        if (supc_data.lowestOfferPrice - one_line.our_nlc) < 0:
-
 
253
            sheet.write(sheet_iterator, 27, "HIGH")
-
 
254
        elif (supc_data.lowestOfferPrice - one_line.our_nlc)/supc_data.lowestOfferPrice >=0 and (supc_data.lowestOfferPrice - one_line.our_nlc)/supc_data.lowestOfferPrice <= .02:
-
 
255
            sheet.write(sheet_iterator, 27, "MEDIUM")
240
        else:
256
        else:
241
            sheet.write(sheet_iterator, 22, "No")
257
            sheet.write(sheet_iterator, 27, "LOW")
242
        i= i+1
258
        i= i+1
243
        sheet_iterator+=1
259
        sheet_iterator+=1
244
        
260
        
245
    createSheetForBuyBoxItems(buyBoxItems,wbk)
261
    createSheetForBuyBoxItems(buyBoxItems,wbk)
246
    wbk.save(filename)
262
    wbk.save(filename)