| Line 1686... |
Line 1686... |
| 1686 |
lineitem = order.lineitems[0]
|
1686 |
lineitem = order.lineitems[0]
|
| 1687 |
if quantity >= lineitem.quantity and itemId == lineitem.item_id:
|
1687 |
if quantity >= lineitem.quantity and itemId == lineitem.item_id:
|
| 1688 |
if estimate > 0:
|
1688 |
if estimate > 0:
|
| 1689 |
add_delay_reason(order.id, DelayReason.OTHERS, estimate)
|
1689 |
add_delay_reason(order.id, DelayReason.OTHERS, estimate)
|
| 1690 |
order.status = OrderStatus.LOW_INV_PO_RAISED
|
1690 |
order.status = OrderStatus.LOW_INV_PO_RAISED
|
| - |
|
1691 |
order.statusDescription = "PO Raised"
|
| 1691 |
quantity = quantity - lineitem.quantity
|
1692 |
quantity = quantity - lineitem.quantity
|
| 1692 |
store_inventory_action(order, itemId, HotspotAction.PO_RAISED, estimate, lineitem.quantity)
|
1693 |
store_inventory_action(order, itemId, HotspotAction.PO_RAISED, estimate, lineitem.quantity)
|
| 1693 |
session.commit()
|
1694 |
session.commit()
|
| 1694 |
|
1695 |
|
| 1695 |
def mark_orders_as_reversal_initiated(vendorId, itemId, quantity, estimate):
|
1696 |
def mark_orders_as_reversal_initiated(vendorId, itemId, quantity, estimate):
|
| Line 1698... |
Line 1699... |
| 1698 |
lineitem = order.lineitems[0]
|
1699 |
lineitem = order.lineitems[0]
|
| 1699 |
if quantity >= lineitem.quantity and itemId == lineitem.item_id:
|
1700 |
if quantity >= lineitem.quantity and itemId == lineitem.item_id:
|
| 1700 |
if estimate > 0:
|
1701 |
if estimate > 0:
|
| 1701 |
add_delay_reason(order.id, DelayReason.OTHERS, estimate)
|
1702 |
add_delay_reason(order.id, DelayReason.OTHERS, estimate)
|
| 1702 |
order.status = OrderStatus.LOW_INV_REVERSAL_IN_PROCESS
|
1703 |
order.status = OrderStatus.LOW_INV_REVERSAL_IN_PROCESS
|
| - |
|
1704 |
order.statusDescription = "Reversal Initiated"
|
| 1703 |
quantity = quantity - lineitem.quantity
|
1705 |
quantity = quantity - lineitem.quantity
|
| 1704 |
store_inventory_action(order, itemId, HotspotAction.REVERSAL_INITIATED, estimate, lineitem.quantity)
|
1706 |
store_inventory_action(order, itemId, HotspotAction.REVERSAL_INITIATED, estimate, lineitem.quantity)
|
| 1705 |
session.commit()
|
1707 |
session.commit()
|
| 1706 |
|
1708 |
|
| 1707 |
def mark_orders_as_not_available(vendorId, itemId, quantity, estimate):
|
1709 |
def mark_orders_as_not_available(vendorId, itemId, quantity, estimate):
|
| 1708 |
orders = Order.query.filter(Order.status.in_(tuple([OrderStatus.SUBMITTED_FOR_PROCESSING, OrderStatus.INVENTORY_LOW]))).order_by(Order.expected_shipping_time).all()
|
1710 |
orders = Order.query.filter(Order.status.in_(tuple([OrderStatus.SUBMITTED_FOR_PROCESSING, OrderStatus.INVENTORY_LOW]))).order_by(Order.expected_shipping_time).all()
|
| 1709 |
for order in orders:
|
1711 |
for order in orders:
|
| 1710 |
lineitem = order.lineitems[0]
|
1712 |
lineitem = order.lineitems[0]
|
| 1711 |
if quantity >= lineitem.quantity and itemId == lineitem.item_id:
|
1713 |
if quantity >= lineitem.quantity and itemId == lineitem.item_id:
|
| 1712 |
order.status = OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT
|
1714 |
order.status = OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT
|
| - |
|
1715 |
order.statusDescription = "Not Available"
|
| 1713 |
quantity = quantity - lineitem.quantity
|
1716 |
quantity = quantity - lineitem.quantity
|
| 1714 |
store_inventory_action(order, itemId, HotspotAction.NOT_AVAILABLE, estimate, lineitem.quantity)
|
1717 |
store_inventory_action(order, itemId, HotspotAction.NOT_AVAILABLE, estimate, lineitem.quantity)
|
| 1715 |
session.commit()
|
1718 |
session.commit()
|
| 1716 |
|
1719 |
|
| 1717 |
def store_inventory_action(order, itemId, hotspotAction, estimate, quantity):
|
1720 |
def store_inventory_action(order, itemId, hotspotAction, estimate, quantity):
|