Subversion Repositories SmartDukaan

Rev

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

Rev 4310 Rev 4315
Line 829... Line 829...
829
    at the time of billing.
829
    at the time of billing.
830
    '''
830
    '''
831
    if(vendorId == -1):
831
    if(vendorId == -1):
832
        try:
832
        try:
833
            item_pricings = VendorItemPricing.query.filter_by(item=item).all()
833
            item_pricings = VendorItemPricing.query.filter_by(item=item).all()
834
            if (item_pricings.length != 0):
834
            if item_pricings:
835
                for item_pricing in item_pricings:
835
                for item_pricing in item_pricings:
836
                    total =+ item_pricing
836
                    total =+ item_pricing.transfer_price
837
                avg = total / (item_pricings.length)
837
                avg = total / len(item_pricings)
838
            else:
-
 
839
                avg = item.sellingPrice
838
                item_pricing.transfer_price = avg
840
            return avg
839
                return item_pricing
841
        except:
840
        except:
842
            raise InventoryServiceException(101, "Item pricing not found ")
841
            raise InventoryServiceException(101, "Item pricing not found ")
843
    vendor = Vendor.get_by(id=vendorId)    
842
    vendor = Vendor.get_by(id=vendorId)    
844
    try:
843
    try:
845
        item_pricing = VendorItemPricing.query.filter_by(vendor=vendor, item=item).one()
844
        item_pricing = VendorItemPricing.query.filter_by(vendor=vendor, item=item).one()