Subversion Repositories SmartDukaan

Rev

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

Rev 12404 Rev 12408
Line 415... Line 415...
415
        sku = val.sku
415
        sku = val.sku
416
        scrapedSkuLocation = None
416
        scrapedSkuLocation = None
417
        multipleListings = False
417
        multipleListings = False
418
        for info in scrapInfo:
418
        for info in scrapInfo:
419
            print "iterating scrap info"
419
            print "iterating scrap info"
-
 
420
            if iterator ==3:
-
 
421
                break
420
            if (info['sellerName']).strip()=='Saholic':
422
            if (info['sellerName']).strip()=='Saholic':
421
                if ourRank>0:
423
                if ourRank>0:
422
                    multipleListings = True
424
                    multipleListings = True
423
                ourSp = info['sellerPrice']
425
                ourSp = info['sellerPrice']
424
                ourRank = iterator+1
426
                ourRank = iterator+1
Line 498... Line 500...
498
                ourRank = 3
500
                ourRank = 3
499
            else:
501
            else:
500
                ourRank = 999
502
                ourRank = 999
501
            
503
            
502
        
504
        
-
 
505
        print "Creating object am details",val.sku
503
        amDetails = __AmazonDetails(sku, ourSp, ourRank, lowestSellerName,lowestSellerSp,secondLowestSellerName, secondLowestSellerSp, thirdLowestSellerName, thirdLowestSellerSp,len(scrapInfo),multipleListings)
506
        amDetails = __AmazonDetails(sku, ourSp, ourRank, lowestSellerName,lowestSellerSp,secondLowestSellerName, secondLowestSellerSp, thirdLowestSellerName, thirdLowestSellerSp,len(scrapInfo),multipleListings)
504
        try:
507
        try:
505
            val.vatRate = catalog_client.getVatPercentageForItem(int(val.sku[3:]), val.state_id, amDetails.ourSp)
508
            val.vatRate = catalog_client.getVatPercentageForItem(int(val.sku[3:]), val.state_id, amDetails.ourSp)
506
        except:
509
        except:
507
            temp = []
510
            temp = []
Line 511... Line 514...
511
            continue
514
            continue
512
        
515
        
513
        ourTp = getOurTp(amDetails,val,val.sourcePercentage)
516
        ourTp = getOurTp(amDetails,val,val.sourcePercentage)
514
        lowestPossibleTp = getLowestPossibleTp(amDetails,val,val.sourcePercentage)
517
        lowestPossibleTp = getLowestPossibleTp(amDetails,val,val.sourcePercentage)
515
        lowestPossibleSp = getLowestPossibleSp(amDetails,val,val.sourcePercentage)
518
        lowestPossibleSp = getLowestPossibleSp(amDetails,val,val.sourcePercentage)
-
 
519
        print "Creating pricing obj"
516
        amPricing = __AmazonPricing(ourSp,ourTp,lowestPossibleTp,lowestPossibleSp)
520
        amPricing = __AmazonPricing(ourSp,ourTp,lowestPossibleTp,lowestPossibleSp)
517
        
521
        
518
        if amPricing.ourTp < amPricing.lowestPossibleTp:
522
        if amPricing.ourTp < amPricing.lowestPossibleTp:
519
            temp = []
523
            temp = []
520
            temp.append(val)
524
            temp.append(val)
Line 559... Line 563...
559
        temp = []
563
        temp = []
560
        temp.append(val)
564
        temp.append(val)
561
        temp.append(amDetails)
565
        temp.append(amDetails)
562
        temp.append(amPricing)
566
        temp.append(amPricing)
563
        cantCompete.append(temp)
567
        cantCompete.append(temp)
-
 
568
        print "Created category..."
564
        
569
        
565
    itemInfo[:]=[]
570
    itemInfo[:]=[]
566
    return exceptionList, negativeMargin, cheapest, amongCheapestAndCanCompete, canCompete, almostCompete, cantCompete
571
    return exceptionList, negativeMargin, cheapest, amongCheapestAndCanCompete, canCompete, almostCompete, cantCompete
567
 
572
 
568
def getOurTp(amazonDetails,val,spm):
573
def getOurTp(amazonDetails,val,spm):