Академический Документы
Профессиональный Документы
Культура Документы
update invent
updateinventship
updateinventship_del
*****************INSERT NEW SHIPMENT LOGIC***************************
1. INSERT RECORD INTO WHM_SHIPMENT
2. For each item in shipment Add a record in the shipment_items table.
3.Follow the following logic to update inventory
if status is STARTED
IF (FROM_LOC_TYPE == WAREHOUSE)
REDUCE INVENTORY AT FROM WAREHOUSE (call update_inventory for
each item in the shipment with direction 'out'.)
END IF
End IF
if status is REACHED
IF (FROM_LOC_TYPE == WAREHOUSE)
REDUCE INVENTORY AT FROM WAREHOUSE (call update_inventory for
each item in the shipment with direction 'out'.)
END IF
IF (TO_LOC_TYPE == WAREHOUSE)
INCREASE INVENTORY AT TO WAREHOUSE (call update_inventory for
each item in the shipment with direction 'in'.)
END IF
End IF
if old_status is STARTED
IF (OLD_FROM_LOC_TYP == WAREHOUSE)
REVERT Quantity each item from for OLD_FROM_LOC
END IF
End if
if old_status is REACHED
IF (OLD_FROM_LOC_TYP == WAREHOUSE)
REVERT Quantity for each item from OLD_FROM_LOC
END IF
IF (OLD_TO_LOC == WAREHOUSE)
REVERT Quantity for each item from OLD_TO_LOC
END IF
End if
End IF
END IF
if old_status is STARTED
IF (OLD_FROM_LOC != NEW_FROM_LOC) OR (OLD_TO_LOC_TYP !=
NEW_TO_LOC_TYP) //this condition does not matter. Ignore in implementation.
END IF
IF (OLD_FROM_LOC_TYP == WAREHOUSE)
REVERT Quantity for OLD_FROM_LOC
END IF
End if
if old_status is REACHED
IF (OLD_FROM_LOC_TYP == WAREHOUSE)
REVERT Quantity for each item from OLD_FROM_LOC
END IF
IF (OLD_TO_LOC == WAREHOUSE)
REVERT Quantity for OLD_TO_LOC
END IF
End if
End IF
if old_status is STARTED
IF (OLD_FROM_LOC_TYP == WAREHOUSE)
REVERT Quantity for OLD_FROM_LOC
END IF
End if
if old_status is REACHED
IF (OLD_FROM_LOC_TYP == WAREHOUSE)
REVERT Quantity for OLD_FROM_LOC
END IF
IF (OLD_TO_LOC == WAREHOUSE)
REVERT Quantity for OLD_TO_LOC
END IF
End if
End IF
3. Delete all the existing records from shipment_items for the particular shipment.
4.Insert 1 record in shipment items for each item in the shipment.