Details
Description
Use Case: When we create a serialized inventory item and the serial number is not provided, it should be created in "INV_ON_HOLD" status to exclude this item from being count in ATP.
As per the current implementation in service receiveInventoryProduct if status provided is "INV_ON_HOLD" for inventory item of type "SERIALIZED_INV_ITEM" it should not update to "INV_AVAILABLE" but it's not working expectedly. Here is the logic to check for the same:
<if> <condition> <and> <if-compare value="SERIALIZED_INV_ITEM" operator="equals" field="parameters.inventoryItemTypeId"/> <if-empty field="parameters.returnId"/> </and> </condition> <then> <!-- Retrieve the new inventoryItem --> <entity-one entity-name="InventoryItem" value-field="inventoryItem"> <field-map field-name="inventoryItemId" from-field="currentInventoryItemId"/> </entity-one> <!-- Don't reset the status if it's already set to INV_PROMISED or INV_ON_HOLD --> <if> <condition> <and> <if-compare value="INV_PROMISED" operator="not-equals" field="inventoryItem.statusId"/> <if-compare value="INV_ON_HOLD" operator="not-equals" field="inventoryItem.statusId"/> </and> </condition> <then> <clear-field field="serviceInMap"/> <set field="serviceInMap.inventoryItemId" from-field="currentInventoryItemId"/> <set field="serviceInMap.statusId" value="INV_AVAILABLE"/> <!-- XXX set to returned instead --> <call-service service-name="updateInventoryItem" in-map-name="serviceInMap"/> </then> </if> </then> </if>