Subversion Repositories SmartDukaan

Rev

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

Rev 723 Rev 759
Line 402... Line 402...
402
        availability = CurrentInventorySnapshot.query.filter_by(warehouse_id = warehouse_id, item_id = item_id).one().availibility
402
        availability = CurrentInventorySnapshot.query.filter_by(warehouse_id = warehouse_id, item_id = item_id).one().availibility
403
        if availability > global_availability:
403
        if availability > global_availability:
404
            warehouse_retid = warehouse_id
404
            warehouse_retid = warehouse_id
405
            global_availability = availability
405
            global_availability = availability
406
    if warehouse_retid == -1:
406
    if warehouse_retid == -1:
407
        #This is the case when all warehouses have exhausted their inventory of this item.
407
        # This is the case when all warehouses have exhausted their
-
 
408
        # inventory of this item or no warehouse is available in this
-
 
409
        # location.
408
        #TODO: Change 1 to be a constant read from the Config client.
410
        #TODO: Change 1 to be a constant read from the Config client.
409
        warehouse_retid = 1
411
        warehouse_retid = 1
410
    return [warehouse_retid, global_availability]
412
    return [warehouse_retid, global_availability]
411
 
413
 
412
def get_warehouses_for_item(item_id):
414
def get_warehouses_for_item(item_id):