| Line 400... |
Line 400... |
| 400 |
warehouses = Warehouse.query.filter_by(logisticsLocation=warehouse_loc).all()
|
400 |
warehouses = Warehouse.query.filter_by(logisticsLocation=warehouse_loc).all()
|
| 401 |
warehouse_ids = [warehouse.id for warehouse in warehouses]
|
401 |
warehouse_ids = [warehouse.id for warehouse in warehouses]
|
| 402 |
warehouse_retid = -1
|
402 |
warehouse_retid = -1
|
| 403 |
global_availability = 0
|
403 |
global_availability = 0
|
| 404 |
for warehouse_id in warehouse_ids:
|
404 |
for warehouse_id in warehouse_ids:
|
| - |
|
405 |
try:
|
| 405 |
availability = CurrentInventorySnapshot.query.filter_by(warehouse_id = warehouse_id, item_id = item_id).one().availibility
|
406 |
availability = CurrentInventorySnapshot.query.filter_by(warehouse_id = warehouse_id, item_id = item_id).one().availibility
|
| - |
|
407 |
except:
|
| - |
|
408 |
availability = 0
|
| 406 |
if availability > global_availability:
|
409 |
if availability > global_availability:
|
| 407 |
warehouse_retid = warehouse_id
|
410 |
warehouse_retid = warehouse_id
|
| 408 |
global_availability = availability
|
411 |
global_availability = availability
|
| 409 |
if warehouse_retid == -1:
|
412 |
if warehouse_retid == -1:
|
| 410 |
# This is the case when all warehouses have exhausted their
|
413 |
# This is the case when all warehouses have exhausted their
|