Subversion Repositories SmartDukaan

Rev

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

Rev 12652 Rev 12656
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
                    return 0.0
700
                    return amDetails.lowestMfnOffer
700
        elif amDetails.isLowestFba:
701
        elif amDetails.isLowestFba:
701
            return amDetails.lowestFbaOffer
702
            return amDetails.lowestFbaOffer
702
        elif amDetails.isLowestMfn:
703
        elif amDetails.isLowestMfn:
703
            #TODO Check last five days history
704
            #TODO Check last five days history
704
            ratio = getCheapestMfnCount(timestamp,amDetails.sku[3:])
705
            ratio = getCheapestMfnCount(timestamp,amDetails.sku[3:])
Line 708... Line 709...
708
            except:
709
            except:
709
                daysOfStock = float("inf")
710
                daysOfStock = float("inf")
710
            if daysInStock >= 4 and daysOfStock > 20 and ratio >.8:
711
            if daysInStock >= 4 and daysOfStock > 20 and ratio >.8:
711
                return amDetails.lowestMfnOffer
712
                return amDetails.lowestMfnOffer
712
            else:
713
            else:
-
 
714
                print "Unable to calculate competitive pricing for %s"%(amDetails.sku)
713
                return 0.0
715
                return amDetails.lowestMfnOffer
714
        else:
716
        else:
715
            return 0.0
717
            return 0.0
716
 
718
 
717
def getBreakevenPrice(item,val,spm):
719
def getBreakevenPrice(item,val,spm):
718
    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));