Subversion Repositories SmartDukaan

Rev

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

Rev 9387 Rev 9390
Line 252... Line 252...
252
            continue
252
            continue
253
        lowest_possible_tp = one_line.our_nlc/0.988+15+6
253
        lowest_possible_tp = one_line.our_nlc/0.988+15+6
254
        lowest_possible_sp = (lowest_possible_tp+courierCost)/0.9597
254
        lowest_possible_sp = (lowest_possible_tp+courierCost)/0.9597
255
        sheet.write(sheet_iterator, 21, round(lowest_possible_tp))
255
        sheet.write(sheet_iterator, 21, round(lowest_possible_tp))
256
        sheet.write(sheet_iterator, 22, round(lowest_possible_sp))
256
        sheet.write(sheet_iterator, 22, round(lowest_possible_sp))
-
 
257
        competitionBasis ='TP'
257
        if (supc_data.lowestOfferPrice == supc_data.lowestSp):
258
        if (supc_data.lowestOfferPrice == supc_data.lowestSp):
-
 
259
            competitionBasis ='SP'
258
            sheet.write(sheet_iterator, 23, 'SP')
260
            sheet.write(sheet_iterator, 23, 'SP')
259
        else:
261
        else:
260
            sheet.write(sheet_iterator, 23, 'TP')
262
            sheet.write(sheet_iterator, 23, 'TP')
261
        proposed_tp = 0
263
        proposed_tp = 0
262
        if lowestTp > lowest_possible_tp:
264
        if lowestTp > lowest_possible_tp:
263
            sheet.write(sheet_iterator, 24, "Yes")
265
            sheet.write(sheet_iterator, 24, "Yes")
-
 
266
            if competitionBasis=='SP':
-
 
267
                proposed_sp = max(supc_data.lowestSp - max((10, supc_data.lowestSp*0.001)), lowest_possible_sp)
-
 
268
                proposed_tp = proposed_sp*.09597-courierCost
-
 
269
                sheet.write(sheet_iterator, 25, round(proposed_tp))
-
 
270
                sheet.write(sheet_iterator, 26, round(proposed_sp))
-
 
271
                sheet.write(sheet_iterator, 27, round(proposed_tp*0.988+21)) 
-
 
272
            else:    
264
            proposed_tp  = max(lowestTp - max((10, lowestTp*0.001)), lowest_possible_tp)
273
                proposed_tp  = max(lowestTp - max((10, lowestTp*0.001)), lowest_possible_tp)
265
            sheet.write(sheet_iterator, 25, round(proposed_tp))
274
                sheet.write(sheet_iterator, 25, round(proposed_tp))
266
            sheet.write(sheet_iterator, 26, round((proposed_tp+courierCost)/0.9597)) 
275
                sheet.write(sheet_iterator, 26, round((proposed_tp+courierCost)/0.9597))
-
 
276
                sheet.write(sheet_iterator, 27, round(proposed_tp*0.988+21)) 
267
        else:
277
        else:
268
            sheet.write(sheet_iterator, 24, "No")
278
            sheet.write(sheet_iterator, 24, "No")
269
        
279
        
270
        sheet.write(sheet_iterator, 27, round(proposed_tp*0.988+21))
-
 
271
        
280
        
272
        if (supc_data.lowestOfferPrice - one_line.our_nlc) < 0:
281
        if (supc_data.lowestOfferPrice - one_line.our_nlc) < 0:
273
            sheet.write(sheet_iterator, 28, "HIGH")
282
            sheet.write(sheet_iterator, 28, "HIGH")
274
        elif (supc_data.lowestOfferPrice - one_line.our_nlc)/supc_data.lowestOfferPrice >=0 and (supc_data.lowestOfferPrice - one_line.our_nlc)/supc_data.lowestOfferPrice <= .02:
283
        elif (supc_data.lowestOfferPrice - one_line.our_nlc)/supc_data.lowestOfferPrice >=0 and (supc_data.lowestOfferPrice - one_line.our_nlc)/supc_data.lowestOfferPrice <= .02:
275
            sheet.write(sheet_iterator, 28, "MEDIUM")
284
            sheet.write(sheet_iterator, 28, "MEDIUM")
Line 457... Line 466...
457
            continue
466
            continue
458
        lowest_possible_tp = one_line.our_nlc/0.988+15+6
467
        lowest_possible_tp = one_line.our_nlc/0.988+15+6
459
        lowest_possible_sp = (lowest_possible_tp+courierCost)/0.9597
468
        lowest_possible_sp = (lowest_possible_tp+courierCost)/0.9597
460
        sheet.write(sheet_iterator, 21, round(lowest_possible_tp))
469
        sheet.write(sheet_iterator, 21, round(lowest_possible_tp))
461
        sheet.write(sheet_iterator, 22, round(lowest_possible_sp))
470
        sheet.write(sheet_iterator, 22, round(lowest_possible_sp))
-
 
471
        competitionBasis ='TP'
462
        if (supc_data.lowestOfferPrice == supc_data.lowestSp):
472
        if (supc_data.lowestOfferPrice == supc_data.lowestSp):
-
 
473
            competitionBasis ='SP'
463
            sheet.write(sheet_iterator, 23, 'SP')
474
            sheet.write(sheet_iterator, 23, 'SP')
464
        else:
475
        else:
465
            sheet.write(sheet_iterator, 23, 'TP')
476
            sheet.write(sheet_iterator, 23, 'TP')
466
        proposed_tp = 0
477
        proposed_tp = 0
467
        if lowestTp > lowest_possible_tp:
478
        if lowestTp > lowest_possible_tp:
468
            sheet.write(sheet_iterator, 24, "Yes")
479
            sheet.write(sheet_iterator, 24, "Yes")
-
 
480
            if competitionBasis=='SP':
-
 
481
                proposed_sp = max(supc_data.lowestSp - max((10, supc_data.lowestSp*0.001)), lowest_possible_sp)
-
 
482
                proposed_tp = proposed_sp*.09597-courierCost
-
 
483
                sheet.write(sheet_iterator, 25, round(proposed_tp))
-
 
484
                sheet.write(sheet_iterator, 26, round(proposed_sp))
-
 
485
                sheet.write(sheet_iterator, 27, round(proposed_tp*0.988+21)) 
-
 
486
            else:
469
            proposed_tp  = max(lowestTp - max((10, lowestTp*0.001)), lowest_possible_tp)
487
                proposed_tp  = max(lowestTp - max((10, lowestTp*0.001)), lowest_possible_tp)
470
            sheet.write(sheet_iterator, 25, round(proposed_tp))
488
                sheet.write(sheet_iterator, 25, round(proposed_tp))
471
            sheet.write(sheet_iterator, 26, round((proposed_tp+courierCost)/0.9597)) 
489
                sheet.write(sheet_iterator, 26, round((proposed_tp+courierCost)/0.9597))
-
 
490
                sheet.write(sheet_iterator, 27, round(proposed_tp*0.988+21)) 
472
        else:
491
        else:
473
            sheet.write(sheet_iterator, 24, "No")
492
            sheet.write(sheet_iterator, 24, "No")
474
        
493
        
475
        sheet.write(sheet_iterator, 27, round(proposed_tp*0.988+21))
-
 
476
        
-
 
477
        if (supc_data.lowestOfferPrice - one_line.our_nlc) < 0:
494
        if (supc_data.lowestOfferPrice - one_line.our_nlc) < 0:
478
            sheet.write(sheet_iterator, 28, "HIGH")
495
            sheet.write(sheet_iterator, 28, "HIGH")
479
        elif (supc_data.lowestOfferPrice - one_line.our_nlc)/supc_data.lowestOfferPrice >=0 and (supc_data.lowestOfferPrice - one_line.our_nlc)/supc_data.lowestOfferPrice <= .02:
496
        elif (supc_data.lowestOfferPrice - one_line.our_nlc)/supc_data.lowestOfferPrice >=0 and (supc_data.lowestOfferPrice - one_line.our_nlc)/supc_data.lowestOfferPrice <= .02:
480
            sheet.write(sheet_iterator, 28, "MEDIUM")
497
            sheet.write(sheet_iterator, 28, "MEDIUM")
481
        else:
498
        else: