| Line 1438... |
Line 1438... |
| 1438 |
elif order.status == OrderStatus.DOA_CERT_INVALID:
|
1438 |
elif order.status == OrderStatus.DOA_CERT_INVALID:
|
| 1439 |
new_order = __clone_order(order, True, False)
|
1439 |
new_order = __clone_order(order, True, False)
|
| 1440 |
order.status = OrderStatus.DOA_INVALID_RESHIPPED
|
1440 |
order.status = OrderStatus.DOA_INVALID_RESHIPPED
|
| 1441 |
order.statusDescription = "Order Reshipped"
|
1441 |
order.statusDescription = "Order Reshipped"
|
| 1442 |
session.commit()
|
1442 |
session.commit()
|
| - |
|
1443 |
warehouseClient = WarehouseClient().get_client()
|
| - |
|
1444 |
inventoryItem = warehouseClient.getInventoryItemFromOrder(order_id)
|
| - |
|
1445 |
warehouseClient.scanForOrder(inventoryItem, ScanType.SALE, new_order.lineitems[0].quantity, new_order.id, new_order.fulfilmentWarehouseId, new_order.warehouse_id)
|
| 1443 |
elif order.status == OrderStatus.DOA_CERT_VALID:
|
1446 |
elif order.status == OrderStatus.DOA_CERT_VALID:
|
| 1444 |
new_order = __clone_order(order, False, False)
|
1447 |
new_order = __clone_order(order, False, False)
|
| 1445 |
ret_order = __create_return_order(order)
|
1448 |
ret_order = __create_return_order(order)
|
| 1446 |
order.status = OrderStatus.DOA_VALID_RESHIPPED
|
1449 |
order.status = OrderStatus.DOA_VALID_RESHIPPED
|
| 1447 |
order.statusDescription = "Order Reshipped"
|
1450 |
order.statusDescription = "Order Reshipped"
|
| Line 1456... |
Line 1459... |
| 1456 |
new_order = __clone_order(order, False, False)
|
1459 |
new_order = __clone_order(order, False, False)
|
| 1457 |
order.status = OrderStatus.DOA_RESHIPPED_LOST_IN_TRANSIT
|
1460 |
order.status = OrderStatus.DOA_RESHIPPED_LOST_IN_TRANSIT
|
| 1458 |
order.statusDescription = "Order Reshipped Lost In Transit"
|
1461 |
order.statusDescription = "Order Reshipped Lost In Transit"
|
| 1459 |
session.commit()
|
1462 |
session.commit()
|
| 1460 |
elif order.status == OrderStatus.RET_PRODUCT_USABLE:
|
1463 |
elif order.status == OrderStatus.RET_PRODUCT_USABLE:
|
| 1461 |
new_order = __clone_order(order, True, False)
|
1464 |
new_order = __clone_order(order, False, False)
|
| 1462 |
order.status = OrderStatus.RET_PRODUCT_USABLE_RESHIPPED
|
1465 |
order.status = OrderStatus.RET_PRODUCT_USABLE_RESHIPPED
|
| 1463 |
order.statusDescription = "Order Reshipped"
|
1466 |
order.statusDescription = "Order Reshipped"
|
| 1464 |
session.commit()
|
1467 |
session.commit()
|
| 1465 |
elif order.status == OrderStatus.RET_PRODUCT_UNUSABLE:
|
1468 |
elif order.status == OrderStatus.RET_PRODUCT_UNUSABLE:
|
| 1466 |
new_order = __clone_order(order, False, False)
|
1469 |
new_order = __clone_order(order, False, False)
|
| Line 1731... |
Line 1734... |
| 1731 |
new_order.vendorId = order.vendorId
|
1734 |
new_order.vendorId = order.vendorId
|
| 1732 |
new_order.invoice_number = order.invoice_number
|
1735 |
new_order.invoice_number = order.invoice_number
|
| 1733 |
new_order.billed_by = order.billed_by
|
1736 |
new_order.billed_by = order.billed_by
|
| 1734 |
new_order.warehouse_id = order.warehouse_id
|
1737 |
new_order.warehouse_id = order.warehouse_id
|
| 1735 |
new_order.fulfilmentWarehouseId = order.fulfilmentWarehouseId
|
1738 |
new_order.fulfilmentWarehouseId = order.fulfilmentWarehouseId
|
| - |
|
1739 |
new_order.jacket_number = order.jacket_number
|
| - |
|
1740 |
new_order.lineitems[0].serial_number = order.lineitems[0].serial_number
|
| - |
|
1741 |
new_order.lineitems[0].item_number = order.lineitems[0].item_number
|
| 1736 |
new_order.accepted_timestamp = current_time
|
1742 |
new_order.accepted_timestamp = current_time
|
| 1737 |
new_order.billing_timestamp = current_time
|
1743 |
new_order.billing_timestamp = current_time
|
| 1738 |
new_order.status = OrderStatus.BILLED
|
1744 |
new_order.status = OrderStatus.BILLED
|
| 1739 |
new_order.statusDescription = 'Order Billed'
|
1745 |
new_order.statusDescription = 'Order Billed'
|
| 1740 |
else:
|
1746 |
else:
|
| Line 1911... |
Line 1917... |
| 1911 |
raise TransactionServiceException(119, "No warehouse with id" + str(warehouse_id))
|
1917 |
raise TransactionServiceException(119, "No warehouse with id" + str(warehouse_id))
|
| 1912 |
|
1918 |
|
| 1913 |
if warehouse.billingWarehouseId is None:
|
1919 |
if warehouse.billingWarehouseId is None:
|
| 1914 |
raise TransactionServiceException(119, "Shifting of warehouse allowed to warehouse with billing support only")
|
1920 |
raise TransactionServiceException(119, "Shifting of warehouse allowed to warehouse with billing support only")
|
| 1915 |
|
1921 |
|
| 1916 |
# If One gives a shipping location for warehouse shift, we should assign order to the GOOD warehouse
|
1922 |
# If One gives a billing warehouse for warehouse shift, we should assign order to the GOOD warehouse
|
| 1917 |
# present with this shipping location with maximum availability
|
1923 |
# present within it with maximum availability
|
| 1918 |
if warehouse.inventoryType != InventoryType.GOOD:
|
1924 |
if warehouse.id == warehouse.billingWarehouseId:
|
| 1919 |
warehouses = catalog_client.getWarehouses(None, InventoryType.GOOD, 0, 0, warehouse.id)
|
1925 |
warehouses = catalog_client.getWarehouses(None, InventoryType.GOOD, 0, 0, warehouse.id)
|
| 1920 |
if warehouses:
|
1926 |
if warehouses:
|
| 1921 |
itemInventory = catalog_client.getItemInventoryByItemId(lineitem.item_id)
|
1927 |
itemInventory = catalog_client.getItemInventoryByItemId(lineitem.item_id)
|
| 1922 |
warehouse = warehouses[0]
|
1928 |
warehouse = warehouses[0]
|
| 1923 |
maxAvailability = 0
|
1929 |
maxAvailability = 0
|