<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign projectRP = project> <#assign organisationRP = organisation> <#assign aDateTime = .now> <#switch cloudEventMsg.action> <#case "C"> <#case "U"> <#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign reflexMvtStockInterface = JsonUtil.jsonToMap(dataRfx)> <#-- exclusion of the cases of an IPG move with quantity = 0 (weight modification) --> <#if reflexMvtStockInterface.ipg_move_quantity_in_base_lvs != 0> <#-- IPG moves translated into Stock moves --> <#if reflexMvtStockInterface.ipg_move_type == "130" || reflexMvtStockInterface.ipg_move_type == "200" || reflexMvtStockInterface.ipg_move_type == "210" || reflexMvtStockInterface.ipg_move_type == "220" || reflexMvtStockInterface.ipg_move_type == "230" || reflexMvtStockInterface.ipg_move_type == "240" || reflexMvtStockInterface.ipg_move_type == "260" || reflexMvtStockInterface.ipg_move_type == "290" || reflexMvtStockInterface.ipg_move_type == "300" || reflexMvtStockInterface.ipg_move_type == "400" || reflexMvtStockInterface.ipg_move_type == "410" || reflexMvtStockInterface.ipg_move_type == "420" > [ { <#assign apiReflexPlatformID = ApiReflexPlatformID.MovementCreated> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsaIpgMove_StockMoved.ftl"> } ] <#else> <#-- IPG moves translated into goods received (all type of receipt) --> <#if (reflexMvtStockInterface.ipg_move_type == "100" || reflexMvtStockInterface.ipg_move_type == "110" || reflexMvtStockInterface.ipg_move_type == "120") > <#if reflexMvtStockInterface.receipt_reference?? && reflexMvtStockInterface.receipt_reference!=""> [ { <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitGoodsReceived> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : <#include "RFXtoRP_HsaIpgMove_GoodsReceived.ftl"> } ] <#else> <#-- Case of IPG move type volontarilly ignored--> <#stop " Reference receipt is empty"> <#else> <#stop> <#else> <#-- cases of an IPG move with quantity = 0 (weight modification)--> <#stop> <#break> <#case "D"> <#-- *********************************************** Action = DELETE ******************** --> <#stop "event not supported - Case D "> <#break> <#default> <#stop "event not supported">