| Line 633... |
Line 633... |
| 633 |
expectedDelay = expectedDelay + __get_vendor_holiday_delay(warehouse.vendor_id, expectedDelay)
|
633 |
expectedDelay = expectedDelay + __get_vendor_holiday_delay(warehouse.vendor_id, expectedDelay)
|
| 634 |
|
634 |
|
| 635 |
total_availability = 0
|
635 |
total_availability = 0
|
| 636 |
for entry in CurrentInventorySnapshot.query.filter_by(item_id = item_id).all():
|
636 |
for entry in CurrentInventorySnapshot.query.filter_by(item_id = item_id).all():
|
| 637 |
if entry.warehouse_id not in ignoredWhs:
|
637 |
if entry.warehouse_id not in ignoredWhs:
|
| 638 |
total_availability += entry.availability - entry.reserved
|
638 |
total_availability += entry.availability - entry.reserved - entry.held
|
| 639 |
|
639 |
|
| 640 |
item_availability_cache = ItemAvailabilityCache.get_by(itemId=item_id, sourceId=source_id)
|
640 |
item_availability_cache = ItemAvailabilityCache.get_by(itemId=item_id, sourceId=source_id)
|
| 641 |
if item_availability_cache is None:
|
641 |
if item_availability_cache is None:
|
| 642 |
item_availability_cache = ItemAvailabilityCache()
|
642 |
item_availability_cache = ItemAvailabilityCache()
|
| 643 |
item_availability_cache.itemId = item_id
|
643 |
item_availability_cache.itemId = item_id
|