Subversion Repositories SmartDukaan

Rev

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

Rev 12657 Rev 12659
Line 694... Line 694...
694
                except:
694
                except:
695
                    daysOfStock = float("inf")
695
                    daysOfStock = float("inf")
696
                if daysInStock >= 4 and daysOfStock > 20 and ratio >=.8:
696
                if daysInStock >= 4 and daysOfStock > 20 and ratio >=.8:
697
                    return amDetails.lowestMfnOffer
697
                    return amDetails.lowestMfnOffer
698
                else:
698
                else:
699
                    print "Unable to calculate competitive pricing for %s"%(amDetails.sku)
699
                    print "Unable to calculate competitive pricing for %s in block 1"%(amDetails.sku)
700
                    return amDetails.lowestMfnOffer
700
                    return amDetails.lowestFbaOffer
701
        elif amDetails.isLowestFba:
701
        elif amDetails.isLowestFba:
702
            return amDetails.lowestFbaOffer
702
            return amDetails.lowestFbaOffer
703
        elif amDetails.isLowestMfn:
703
        elif amDetails.isLowestMfn:
704
            #TODO Check last five days history
704
            #TODO Check last five days history
705
            ratio = getCheapestMfnCount(timestamp,amDetails.sku[3:])
705
            ratio = getCheapestMfnCount(timestamp,amDetails.sku[3:])
Line 709... Line 709...
709
            except:
709
            except:
710
                daysOfStock = float("inf")
710
                daysOfStock = float("inf")
711
            if daysInStock >= 4 and daysOfStock > 20 and ratio >.8:
711
            if daysInStock >= 4 and daysOfStock > 20 and ratio >.8:
712
                return amDetails.lowestMfnOffer
712
                return amDetails.lowestMfnOffer
713
            else:
713
            else:
714
                print "Unable to calculate competitive pricing for %s"%(amDetails.sku)
714
                print "Unable to calculate competitive pricing for %s in block 2"%(amDetails.sku)
715
                return amDetails.lowestMfnOffer
715
                return 0.0
716
        else:
716
        else:
717
            return 0.0
717
            return 0.0
718
 
718
 
719
def getBreakevenPrice(item,val,spm):
719
def getBreakevenPrice(item,val,spm):
720
    breakEvenPrice = (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));
720
    breakEvenPrice = (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));
Line 1293... Line 1293...
1293
    myCostToAmazon = round(data.promoPrice*data.commission/100*(1+getServiceTax(data)/100)+getCourierCost(data)*(1+getServiceTax(data)/100))
1293
    myCostToAmazon = round(data.promoPrice*data.commission/100*(1+getServiceTax(data)/100)+getCourierCost(data)*(1+getServiceTax(data)/100))
1294
    return myCostToAmazon
1294
    return myCostToAmazon
1295
 
1295
 
1296
def getInventoryMovementStatus(amScraping):
1296
def getInventoryMovementStatus(amScraping):
1297
    try:
1297
    try:
1298
        nodStock = (float(amScraping.avgSale))/amScraping.ourInventory
1298
        nodStock = (float(amScraping.ourInventory))/amScraping.avgSale
1299
    except Exception as e:
1299
    except Exception as e:
1300
        print "exception in nod stock"
1300
        print "exception in nod stock"
1301
        print e
1301
        print e
1302
        nodStock = float("inf")
1302
        nodStock = float("inf")
1303
    try:
1303
    try:
1304
        if amScraping.avgSale==0:
1304
        if amScraping.avgSale==0:
1305
            return "Not Moving"
1305
            return "Not Moving"
1306
        elif nodStock > 30:
1306
        elif nodStock > 20:
1307
            return "Slow Moving"
1307
            return "Slow Moving"
1308
        else:
1308
        else:
1309
            return "Fast Moving"
1309
            return "Moving"
1310
    except Exception as e:
1310
    except Exception as e:
1311
        print e
1311
        print e
1312
        print "exception in ims"
1312
        print "exception in ims"
1313
        return ""
1313
        return ""
1314
 
1314