Subversion Repositories SmartDukaan

Rev

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

Rev 12499 Rev 12500
Line 369... Line 369...
369
    inventory_client = InventoryClient().get_client()
369
    inventory_client = InventoryClient().get_client()
370
    fbaAvailableInventorySnapshot = inventory_client.getAllAvailableAmazonFbaItemInventory()
370
    fbaAvailableInventorySnapshot = inventory_client.getAllAvailableAmazonFbaItemInventory()
371
    if runType=='FAVOURITE':
371
    if runType=='FAVOURITE':
372
        favourites = session.query(Amazonlisted.itemId).filter(or_(Amazonlisted.autoFavourite==True, Amazonlisted.manualFavourite==True)).all()
372
        favourites = session.query(Amazonlisted.itemId).filter(or_(Amazonlisted.autoFavourite==True, Amazonlisted.manualFavourite==True)).all()
373
    for fbaInventoryItem in fbaAvailableInventorySnapshot:
373
    for fbaInventoryItem in fbaAvailableInventorySnapshot:
374
        if fbaInventoryItem.item_id!=12248:
-
 
375
            continue
-
 
376
        if runType=='FAVOURITE':
374
        if runType=='FAVOURITE':
377
            if not (fbaInventoryItem.item_id in favourites):
375
            if not (fbaInventoryItem.item_id in favourites):
378
                continue 
376
                continue 
379
        d_amazon_listed = Amazonlisted.get_by(itemId=fbaInventoryItem.item_id)
377
        d_amazon_listed = Amazonlisted.get_by(itemId=fbaInventoryItem.item_id)
380
        if d_amazon_listed is None:
378
        if d_amazon_listed is None:
Line 610... Line 608...
610
        
608
        
611
    return exceptionList, negativeMargin, cheapest, amongCheapestAndCanCompete, canCompete, almostCompete, cantCompete
609
    return exceptionList, negativeMargin, cheapest, amongCheapestAndCanCompete, canCompete, almostCompete, cantCompete
612
 
610
 
613
 
611
 
614
def getLowestPossibleSp(amazonDetails,val,spm):
612
def getLowestPossibleSp(amazonDetails,val,spm):
615
    print "lowest possible sp ",val.sku
-
 
616
    print val.nlc
-
 
617
    print val.courierCost
-
 
618
    print spm.serviceTax
-
 
619
    print val.vatRate
-
 
620
    print val.otherCost
-
 
621
    print spm.commission
-
 
622
    print spm.emiFee
-
 
623
    print spm.returnProvision
-
 
624
    lowestPossibleSp = (val.nlc+(val.courierCost)*(1+(spm.serviceTax/100))*(1+(val.vatRate/100))+(15.0+val.otherCost)*(1+(val.vatRate)/100))/(1-(spm.commission/100+spm.emiFee/100)*(1+(spm.serviceTax/100))*(1+(val.vatRate)/100)-(spm.returnProvision/100)*(1+(val.vatRate)/100));
613
    lowestPossibleSp = (val.nlc+(val.courierCost)*(1+(spm.serviceTax/100))*(1+(val.vatRate/100))+(15.0+val.otherCost)*(1+(val.vatRate)/100))/(1-(spm.commission/100+spm.emiFee/100)*(1+(spm.serviceTax/100))*(1+(val.vatRate)/100)-(spm.returnProvision/100)*(1+(val.vatRate)/100));
625
    print (val.courierCost)*(1+(spm.serviceTax/100))
-
 
626
    print (1+(val.vatRate/100))
-
 
627
    print (val.courierCost)*(1+(spm.serviceTax/100))*(1+(val.vatRate/100))
-
 
628
    print (15.0+val.otherCost)*(1+(val.vatRate)/100)
-
 
629
    
-
 
630
    if val.isPromo:
614
    if val.isPromo:
631
        if amazonLongTermActivePromotions.has_key(val.sku):
615
        if amazonLongTermActivePromotions.has_key(val.sku):
632
            subsidy = (amazonLongTermActivePromotions.get(val.sku)).subsidy
616
            subsidy = (amazonLongTermActivePromotions.get(val.sku)).subsidy
633
        else:
617
        else:
634
            subsidy = (amazonShortTermActivePromotions.get(val.sku)).subsidy
618
            subsidy = (amazonShortTermActivePromotions.get(val.sku)).subsidy