From 0211b910691a1e6e610eef275dfc4db7652e3a7f Mon Sep 17 00:00:00 2001 From: Laurie Montant Date: Fri, 15 Mar 2024 09:38:15 +0100 Subject: [PATCH] modifs --- RFXtoRP_HsaIpgMove.ftl | 66 ++++++++++++++++++------------------ RFXtoRP_HsrReceiptList.ftl | 68 +++++++++++++++++++++----------------- 2 files changed, 71 insertions(+), 63 deletions(-) diff --git a/RFXtoRP_HsaIpgMove.ftl b/RFXtoRP_HsaIpgMove.ftl index be73034..00fdfd5 100644 --- a/RFXtoRP_HsaIpgMove.ftl +++ b/RFXtoRP_HsaIpgMove.ftl @@ -12,50 +12,52 @@ <#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.StockMoved> - "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.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.HandlingunitGoodsReceived> + <#assign apiReflexPlatformID = ApiReflexPlatformID.StockMoved> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_HsaIpgMove_GoodsReceived.ftl"> + <#include "RFXtoRP_HsaIpgMove_StockMoved.ftl"> } ] + <#else> + <#-- IPG moves translated into goods received (all type of receipt) --> + <#if reflexMvtStockInterface.receipt_reference?? && reflexMvtStockInterface.receipt_reference!=""> + <#if reflexMvtStockInterface.ipg_move_type == "100" || + reflexMvtStockInterface.ipg_move_type == "110" || + reflexMvtStockInterface.ipg_move_type == "120"> + [ + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitGoodsReceived> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaIpgMove_GoodsReceived.ftl"> + } + ] + <#else> + <#-- Case of IPG move type volontarilly ignored--> + <#stop> + <#else> - <#-- Case of IPG move type volontarilly ignored--> - <#stop> + <#stop Receipt reference is empty> - <#else> <#-- cases of an IPG move with quantity = 0 (weight modification)--> <#stop> diff --git a/RFXtoRP_HsrReceiptList.ftl b/RFXtoRP_HsrReceiptList.ftl index abcab30..d25cd93 100644 --- a/RFXtoRP_HsrReceiptList.ftl +++ b/RFXtoRP_HsrReceiptList.ftl @@ -45,31 +45,34 @@ <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign receipt = JsonUtil.jsonToMap(dataRfx)> [ - <#if receipt.receipt_confirmed == "true" > - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptCompleted> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrReceiptList_ExecutionflowReceiptCompleted.ftl"> - } - <#else> - <#if receipt.receipt_type = "030"> - <#stop "ignored message because receipt type = transfert"> + <#if receipt.receipt_reference?? && receipt.receipt_reference!=""> + <#if receipt.receipt_confirmed == "true" > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptCompleted> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrReceiptList_ExecutionflowReceiptCompleted.ftl"> + } <#else> - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> - }, - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl"> - - } - + <#if receipt.receipt_type = "030"> + <#stop "ignored message because receipt type = transfert"> + <#else> + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl"> + } + + + <#else> + <#stop "Receipt reference is empty"> ] <#break> @@ -79,14 +82,17 @@ <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign receipt = JsonUtil.jsonToMap(dataRfx)> [ - { + <#if receipt.receipt_reference?? && receipt.receipt_reference!=""> + { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl"> - - } + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl"> + } + <#else> + <#stop "Receipt reference is empty"> + ] <#break>