Subversion Repositories SmartDukaan

Rev

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

Rev 13726 Rev 15958
Line 258... Line 258...
258
    if ignore:
258
    if ignore:
259
        return 0
259
        return 0
260
    
260
    
261
    try:
261
    try:
262
        current_inventory_snapshot = CurrentInventorySnapshot.query.filter_by(warehouse_id = warehouse_id).filter_by(item_id = item_id).one()
262
        current_inventory_snapshot = CurrentInventorySnapshot.query.filter_by(warehouse_id = warehouse_id).filter_by(item_id = item_id).one()
263
        return current_inventory_snapshot.availability - current_inventory_snapshot.reserved
263
        return current_inventory_snapshot.availability - current_inventory_snapshot.reserved - current_inventory_snapshot.held
264
    except:
264
    except:
265
        return 0
265
        return 0
266
 
266
 
267
def get_item_availability_for_our_warehouses(item_ids):
267
def get_item_availability_for_our_warehouses(item_ids):
268
    our_warehouses = Warehouse.query.filter_by(warehouseType = 'OURS', inventoryType = 'GOOD').all()
268
    our_warehouses = Warehouse.query.filter_by(warehouseType = 'OURS', inventoryType = 'GOOD').all()