Subversion Repositories SmartDukaan

Rev

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

Rev 12420 Rev 12421
Line 502... Line 502...
502
            else:
502
            else:
503
                ourRank = 999
503
                ourRank = 999
504
            
504
            
505
        
505
        
506
        print "Creating object am details",val.sku
506
        print "Creating object am details",val.sku
507
        amDetails = __AmazonDetails(sku, ourSp, ourRank, lowestSellerName,lowestSellerSp,secondLowestSellerName, secondLowestSellerSp, thirdLowestSellerName, thirdLowestSellerSp,len(scrapInfo),multipleListings)
507
        amDetails = __AmazonDetails(sku, float(ourSp), ourRank, lowestSellerName,float(lowestSellerSp),secondLowestSellerName, float(secondLowestSellerSp), thirdLowestSellerName, float(thirdLowestSellerSp),len(scrapInfo),multipleListings)
508
        print "am details obj created"
508
        print "am details obj created"
509
        try:
509
        try:
510
            print "inside val getter"
510
            print "inside val getter"
511
            itemVatMaster = ItemVatMaster.query.filter(and_(ItemVatMaster.itemId==int(val.sku[3:]), ItemVatMaster.stateId==val.state_id)).first()
511
            itemVatMaster = ItemVatMaster.query.filter(and_(ItemVatMaster.itemId==int(val.sku[3:]), ItemVatMaster.stateId==val.state_id)).first()
512
            if itemVatMaster is None:
512
            if itemVatMaster is None:
Line 587... Line 587...
587
    print "Created category..."
587
    print "Created category..."
588
        
588
        
589
    return exceptionList, negativeMargin, cheapest, amongCheapestAndCanCompete, canCompete, almostCompete, cantCompete
589
    return exceptionList, negativeMargin, cheapest, amongCheapestAndCanCompete, canCompete, almostCompete, cantCompete
590
 
590
 
591
def getOurTp(amazonDetails,val,spm):
591
def getOurTp(amazonDetails,val,spm):
592
    print type(amazonDetails.ourSp)
-
 
593
    ourTp = amazonDetails.ourSp- amazonDetails.ourSp*(spm.commission/100+spm.emiFee/100)*(1+(spm.serviceTax/100));
592
    ourTp = amazonDetails.ourSp- amazonDetails.ourSp*(spm.commission/100+spm.emiFee/100)*(1+(spm.serviceTax/100))-(val.courierCost)*(1+(spm.serviceTax/100))*(1+(spm.serviceTax/100));
594
    print ourTp
-
 
595
    print type(ourTp)
-
 
596
    ourTp = ourTp -(val.courierCost)*(1+(spm.serviceTax/100))*(1+(spm.serviceTax/100))
-
 
597
    return round(ourTp,2)
593
    return round(ourTp,2)
598
 
594
 
599
def getLowestPossibleTp(amazonDetails,val,spm):
595
def getLowestPossibleTp(amazonDetails,val,spm):
600
    vat = (amazonDetails.ourSp/(1+(val.vatRate/100))-(val.nlc/(1+(val.vatRate/100))))*(val.vatRate/100)
596
    vat = (amazonDetails.ourSp/(1+(val.vatRate/100))-(val.nlc/(1+(val.vatRate/100))))*(val.vatRate/100)
601
    inHouseCost = 15+vat+(spm.returnProvision/100)*amazonDetails.ourSp
597
    inHouseCost = 15+vat+(spm.returnProvision/100)*amazonDetails.ourSp