Subversion Repositories SmartDukaan

Rev

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

Rev 5125 Rev 5133
Line 1107... Line 1107...
1107
    at the time of billing.
1107
    at the time of billing.
1108
    '''
1108
    '''
1109
    if(vendorId == -1):
1109
    if(vendorId == -1):
1110
        total = 0
1110
        total = 0
1111
        try:
1111
        try:
-
 
1112
            item_pricings = []
1112
            if item.preferredWarehouse is not None:
1113
            if item.preferredWarehouse is not None:
1113
                warehouse = Warehouse.query.filter_by(id=item.preferredWarehouse).first()
1114
                warehouse = Warehouse.query.filter_by(id=item.preferredWarehouse).first()
1114
                vendors = warehouse.vendors
-
 
1115
                item_pricings = []
-
 
1116
                for vendor in vendors :
-
 
1117
                    item_pricing = VendorItemPricing.query.filter_by(item=item, vendor=vendor).first()
1115
                item_pricing = VendorItemPricing.query.filter_by(item=item, vendor=warehouse.vendor).first()
1118
                    if item_pricing :
1116
                if item_pricing:
1119
                        item_pricings.append(item_pricing)
1117
                    item_pricings.append(item_pricing)                    
1120
            else :
1118
            else :
1121
                item_pricings = VendorItemPricing.query.filter_by(item=item).all()
1119
                item_pricings = VendorItemPricing.query.filter_by(item=item).all()
1122
            if item_pricings:
1120
            if item_pricings:
1123
                for item_pricing in item_pricings:
1121
                for item_pricing in item_pricings:
1124
                    total += item_pricing.transfer_price
1122
                    total += item_pricing.transfer_price