| Line 359... |
Line 359... |
| 359 |
try:
|
359 |
try:
|
| 360 |
order_client = TransactionClient().get_client()
|
360 |
order_client = TransactionClient().get_client()
|
| 361 |
order = order_client.getOrder(order_id)
|
361 |
order = order_client.getOrder(order_id)
|
| 362 |
if order.source:
|
362 |
if order.source:
|
| 363 |
holdInventoryDetail = HoldInventoryDetail.query.filter_by(item_id = item_id, warehouse_id = warehouse_id, source = order.source).first()
|
363 |
holdInventoryDetail = HoldInventoryDetail.query.filter_by(item_id = item_id, warehouse_id = warehouse_id, source = order.source).first()
|
| - |
|
364 |
if holdInventoryDetail is None or holdInventoryDetail.held<=0:
|
| - |
|
365 |
holdInventoryDetails = HoldInventoryDetail.query.filter_by(item_id = item_id, source = order.source).all()
|
| - |
|
366 |
if holdInventoryDetails:
|
| - |
|
367 |
for hID in holdInventoryDetails:
|
| - |
|
368 |
if hID.held>0:
|
| - |
|
369 |
holdInventoryDetail = hID
|
| 364 |
if holdInventoryDetail is not None and holdInventoryDetail.held>0:
|
370 |
if holdInventoryDetail is not None and holdInventoryDetail.held>0:
|
| 365 |
previousHeld = holdInventoryDetail.held
|
371 |
previousHeld = holdInventoryDetail.held
|
| 366 |
holdInventoryDetail.held = max(0, holdInventoryDetail.held -quantity)
|
372 |
holdInventoryDetail.held = max(0, holdInventoryDetail.held -quantity)
|
| 367 |
diff = previousHeld-holdInventoryDetail.held
|
373 |
diff = previousHeld-holdInventoryDetail.held
|
| 368 |
current_inventory_snapshot = CurrentInventorySnapshot.get_by(item_id=item_id, warehouse_id=warehouse_id)
|
374 |
current_inventory_snapshot = CurrentInventorySnapshot.get_by(item_id=item_id, warehouse_id=warehouse_id)
|
| Line 407... |
Line 413... |
| 407 |
try:
|
413 |
try:
|
| 408 |
order_client = TransactionClient().get_client()
|
414 |
order_client = TransactionClient().get_client()
|
| 409 |
order = order_client.getOrder(order_id)
|
415 |
order = order_client.getOrder(order_id)
|
| 410 |
if order.source:
|
416 |
if order.source:
|
| 411 |
holdInventoryDetail = HoldInventoryDetail.query.filter_by(item_id = item_id, warehouse_id = warehouse_id, source = order.source).first()
|
417 |
holdInventoryDetail = HoldInventoryDetail.query.filter_by(item_id = item_id, warehouse_id = warehouse_id, source = order.source).first()
|
| - |
|
418 |
if holdInventoryDetail is None or holdInventoryDetail.held<=0:
|
| - |
|
419 |
holdInventoryDetails = HoldInventoryDetail.query.filter_by(item_id = item_id, source = order.source).all()
|
| - |
|
420 |
if holdInventoryDetails:
|
| - |
|
421 |
for hID in holdInventoryDetails:
|
| - |
|
422 |
if hID.held>0:
|
| - |
|
423 |
holdInventoryDetail = hID
|
| 412 |
if holdInventoryDetail is not None and holdInventoryDetail.held>0:
|
424 |
if holdInventoryDetail is not None and holdInventoryDetail.held>0:
|
| 413 |
previousHeld = holdInventoryDetail.held
|
425 |
previousHeld = holdInventoryDetail.held
|
| 414 |
holdInventoryDetail.held = max(0, holdInventoryDetail.held -quantity)
|
426 |
holdInventoryDetail.held = max(0, holdInventoryDetail.held -quantity)
|
| 415 |
diff = previousHeld-holdInventoryDetail.held
|
427 |
diff = previousHeld-holdInventoryDetail.held
|
| 416 |
current_inventory_snapshot = CurrentInventorySnapshot.get_by(item_id=item_id, warehouse_id=warehouse_id)
|
428 |
current_inventory_snapshot = CurrentInventorySnapshot.get_by(item_id=item_id, warehouse_id=warehouse_id)
|