| Line 3314... |
Line 3314... |
| 3314 |
lineitem = order.lineitems[0]
|
3314 |
lineitem = order.lineitems[0]
|
| 3315 |
if lineitem.item_id == itemId and lineitem.quantity <= quantity:
|
3315 |
if lineitem.item_id == itemId and lineitem.quantity <= quantity:
|
| 3316 |
warehouse = inventoryClient.getWarehouse(order.fulfilmentWarehouseId)
|
3316 |
warehouse = inventoryClient.getWarehouse(order.fulfilmentWarehouseId)
|
| 3317 |
if not warehouse.billingWarehouseId and warehouse.warehouseType == WarehouseType.THIRD_PARTY:
|
3317 |
if not warehouse.billingWarehouseId and warehouse.warehouseType == WarehouseType.THIRD_PARTY:
|
| 3318 |
if (inventory.availability[fulfilmentWarehouseId] >= inventory.reserved[fulfilmentWarehouseId] + lineitem.quantity) and inventory.availability[order.fulfilmentWarehouseId] < inventory.reserved[order.fulfilmentWarehouseId]:
|
3318 |
if (inventory.availability[fulfilmentWarehouseId] >= inventory.reserved[fulfilmentWarehouseId] + lineitem.quantity) and inventory.availability[order.fulfilmentWarehouseId] < inventory.reserved[order.fulfilmentWarehouseId]:
|
| 3319 |
inventoryClient.reduceReservationCount(itemId, order.fulfilmentWarehouseId, quantity)
|
3319 |
inventoryClient.reduceReservationCount(itemId, order.fulfilmentWarehouseId, lineitem.quantity)
|
| 3320 |
inventoryClient.reserveItemInWarehouse(itemId, fulfilmentWarehouseId, quantity)
|
3320 |
inventoryClient.reserveItemInWarehouse(itemId, fulfilmentWarehouseId, lineitem.quantity)
|
| 3321 |
order.fulfilmentWarehouseId = fulfilmentWarehouseId
|
3321 |
order.fulfilmentWarehouseId = fulfilmentWarehouseId
|
| 3322 |
quantity -= lineitem.quantity
|
3322 |
quantity -= lineitem.quantity
|
| 3323 |
session.commit()
|
3323 |
session.commit()
|
| 3324 |
if not quantity:
|
3324 |
if not quantity:
|
| 3325 |
break
|
3325 |
break
|