Subversion Repositories SmartDukaan

Rev

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

Rev 11617 Rev 11618
Line 821... Line 821...
821
        
821
        
822
        if (flipkartDetails.ourBuyTrend == 'PrefNCheap'):
822
        if (flipkartDetails.ourBuyTrend == 'PrefNCheap'):
823
            temp=[]
823
            temp=[]
824
            temp.append(flipkartDetails)
824
            temp.append(flipkartDetails)
825
            temp.append(val)
825
            temp.append(val)
-
 
826
            secondLowestTp=0 if flipkartDetails.totalAvailableSeller==1 else getSecondLowestSellerTp(flipkartDetails,val,spm,False)
826
            lowestTp=0 if flipkartDetails.totalAvailableSeller==1 else getOtherTp(flipkartDetails,val,spm,False)
827
            lowestTp=0 if flipkartDetails.totalAvailableSeller==1 else getOtherTp(flipkartDetails,val,spm,False)
827
            prefSellerTp=0 if flipkartDetails.totalAvailableSeller < 2 else getOtherTp(flipkartDetails,val,spm,True)  
828
            prefSellerTp=0 if flipkartDetails.totalAvailableSeller < 2 else getOtherTp(flipkartDetails,val,spm,True)  
828
            flipkartPricing = __FlipkartPricing(flipkartDetails.ourSp,getOurTp(flipkartDetails,val,spm,mpItem),None,getLowestPossibleTp(flipkartDetails,val,spm,mpItem),secondLowestTp,getLowestPossibleSp(flipkartDetails,val,spm,mpItem),prefSellerTp)
829
            flipkartPricing = __FlipkartPricing(flipkartDetails.ourSp,getOurTp(flipkartDetails,val,spm,mpItem),None,getLowestPossibleTp(flipkartDetails,val,spm,mpItem),secondLowestTp,getLowestPossibleSp(flipkartDetails,val,spm,mpItem),prefSellerTp)
829
            temp.append(flipkartPricing)
830
            temp.append(flipkartPricing)
830
            temp.append(mpItem)
831
            temp.append(mpItem)
Line 900... Line 901...
900
    if prefferedSeller:
901
    if prefferedSeller:
901
        otherTp = flipkartDetails.prefSellerSp- flipkartDetails.prefSellerSp*(commissionPercentage/100+spm.emiFee/100)*(1+(spm.serviceTax/100))-(val.courierCost+spm.closingFee)*(1+(spm.serviceTax/100))
902
        otherTp = flipkartDetails.prefSellerSp- flipkartDetails.prefSellerSp*(commissionPercentage/100+spm.emiFee/100)*(1+(spm.serviceTax/100))-(val.courierCost+spm.closingFee)*(1+(spm.serviceTax/100))
902
        return round(otherTp,2)
903
        return round(otherTp,2)
903
    otherTp = flipkartDetails.lowestSellerSp- flipkartDetails.lowestSellerSp*(commissionPercentage/100+spm.emiFee/100)*(1+(spm.serviceTax/100))-(val.courierCost+spm.closingFee)*(1+(spm.serviceTax/100))
904
    otherTp = flipkartDetails.lowestSellerSp- flipkartDetails.lowestSellerSp*(commissionPercentage/100+spm.emiFee/100)*(1+(spm.serviceTax/100))-(val.courierCost+spm.closingFee)*(1+(spm.serviceTax/100))
904
    return round(otherTp,2)
905
    return round(otherTp,2)
-
 
906
 
-
 
907
def getSecondLowestSellerTp(flipkartDetails,val,spm,prefferedSeller):
-
 
908
    if val.parent_category==10011 or val.parent_category==12001:
-
 
909
        commissionPercentage = spm.competitorCommissionAccessory
-
 
910
    else:
-
 
911
        commissionPercentage = spm.competitorCommissionOther
-
 
912
    otherTp = flipkartDetails.secondLowestSellerSp- flipkartDetails.secondLowestSellerSp*(commissionPercentage/100+spm.emiFee/100)*(1+(spm.serviceTax/100))-(val.courierCost+spm.closingFee)*(1+(spm.serviceTax/100))
-
 
913
    return round(otherTp,2)
905
    
914
    
906
def getLowestPossibleTp(flipkartDetails,val,spm,mpItem):
915
def getLowestPossibleTp(flipkartDetails,val,spm,mpItem):
907
    if flipkartDetails.rank==0:
916
    if flipkartDetails.rank==0:
908
        return mpItem.minimumPossibleTp
917
        return mpItem.minimumPossibleTp
909
    vat = (flipkartDetails.ourSp/(1+(val.vatRate/100))-(val.nlc/(1+(val.vatRate/100))))*(val.vatRate/100);
918
    vat = (flipkartDetails.ourSp/(1+(val.vatRate/100))-(val.nlc/(1+(val.vatRate/100))))*(val.vatRate/100);