From 03953258d68326f03adbce3fc4333f8e42ee962a Mon Sep 17 00:00:00 2001 From: Laurie Montant Date: Mon, 18 Mar 2024 10:06:06 +0100 Subject: [PATCH 1/3] modifs --- RFXtoRP_HsrPrepa.ftl | 8 +++----- RFXtoRP_HsrPrepa_CarrierUpdated.ftl | 1 - RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl | 10 +++++----- RFXtoRP_HsrPrepa_HandlingunitGoodsPrepared.ftl | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/RFXtoRP_HsrPrepa.ftl b/RFXtoRP_HsrPrepa.ftl index eccfac8..133ba4f 100644 --- a/RFXtoRP_HsrPrepa.ftl +++ b/RFXtoRP_HsrPrepa.ftl @@ -15,7 +15,7 @@ <#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign preparationOrder = JsonUtil.jsonToMap(dataRfx)> -<#if preparationOrder.preparation_line_lst[0].preparation_order_originator_reference?? && preparationOrder.preparation_line_lst[0].preparation_order_originator_reference!=""> + <#if preparationOrder.total_lv_validated !=0> [ { @@ -47,7 +47,7 @@ } - <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> + <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list?? && l.preparation_order_originator_reference!="") as preparation_line> <#list preparation_line.despatched_ipg_list as despatched_ipg> <#if despatched_ipg.consignment_unit_id!=""> , @@ -80,9 +80,7 @@ <#else> <#stop "no confirmed quantity for the preparation - preparation closed"> -<#else> - <#stop "PRO reference is empty"> - + <#break> <#case "D"> diff --git a/RFXtoRP_HsrPrepa_CarrierUpdated.ftl b/RFXtoRP_HsrPrepa_CarrierUpdated.ftl index 50d8214..3186074 100644 --- a/RFXtoRP_HsrPrepa_CarrierUpdated.ftl +++ b/RFXtoRP_HsrPrepa_CarrierUpdated.ftl @@ -1,7 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> [ - { "Header": { "ProjectID": "${projectRP}" diff --git a/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl b/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl index d4c3d21..22948cb 100644 --- a/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl +++ b/RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl @@ -2,22 +2,22 @@ <#include "ReflexUtils.ftl"> [ <#assign dispatched_datetime = RfxDateTimetoUTC(preparationOrder.stock_despatch_at_preparation_datetime,time_zone_offset_rfx) /> - <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> + <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list?? && l.preparation_order_originator_reference!="") as preparation_line> <#list preparation_line.despatched_ipg_list as despatched_ipg> - { + { "Header": { - "ProjectID": "${projectRP}" + "ProjectID": "${projectRP}" }, "ID": { "RefID": "${despatched_ipg.hd_number}", "RefDate": { "DateTime": "${dispatched_datetime}", - "AuthorTimeZone": "${time_zone_rfx}" + "AuthorTimeZone": "${time_zone_rfx}" } }, "Payload": { } }<#sep>, <#sep>, - + ] diff --git a/RFXtoRP_HsrPrepa_HandlingunitGoodsPrepared.ftl b/RFXtoRP_HsrPrepa_HandlingunitGoodsPrepared.ftl index ecd7bb4..feb6c2e 100644 --- a/RFXtoRP_HsrPrepa_HandlingunitGoodsPrepared.ftl +++ b/RFXtoRP_HsrPrepa_HandlingunitGoodsPrepared.ftl @@ -1,7 +1,7 @@ <#include "HfRpConfig.ftl"> [ - <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> + <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list?? && l.preparation_order_originator_reference!="") as preparation_line> <#list preparation_line.despatched_ipg_list as despatched_ipg> { "Header": { From 0067755ee446824465f20a7ecc1b7e39e92cdf83 Mon Sep 17 00:00:00 2001 From: Laurie Montant Date: Mon, 18 Mar 2024 15:36:55 +0100 Subject: [PATCH 2/3] Modifs --- RFXtoRP_HsrPrepa.ftl | 2 +- RFXtoRP_HsrPrepa_CarrierUpdated.ftl | 6 +++++- RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl | 7 +++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/RFXtoRP_HsrPrepa.ftl b/RFXtoRP_HsrPrepa.ftl index 133ba4f..1781f53 100644 --- a/RFXtoRP_HsrPrepa.ftl +++ b/RFXtoRP_HsrPrepa.ftl @@ -31,7 +31,7 @@ <#include "RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl"> } - <#if preparationOrder.load_data?? && preparationOrder.load_data.carrier_code?? && preparationOrder.load_data.carrier_code!="" > + <#if preparationOrder.load_data?? && preparationOrder.load_data.carrier_code?? && preparationOrder.load_data.carrier_code!=""> , { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCarrierUpdated> diff --git a/RFXtoRP_HsrPrepa_CarrierUpdated.ftl b/RFXtoRP_HsrPrepa_CarrierUpdated.ftl index 3186074..b058352 100644 --- a/RFXtoRP_HsrPrepa_CarrierUpdated.ftl +++ b/RFXtoRP_HsrPrepa_CarrierUpdated.ftl @@ -1,12 +1,14 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> [ + <#list preparationOrder.preparation_line_lst?filter(l ->l.preparation_order_originator_reference!="") as preparation_line> + <#assign OrderOriginReference = preparation_line.preparation_order_originator_reference?trim?json_string> { "Header": { "ProjectID": "${projectRP}" }, "ID":{ - "RefID": "${preparationOrder.preparation_line_lst[0].preparation_order_originator_reference?trim?json_string}" + "RefID": "${OrderOriginReference}" }, "Payload":{ "Carrier": { @@ -19,4 +21,6 @@ --> } } + <#sep>, + ] \ No newline at end of file diff --git a/RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl b/RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl index 51675ba..42b3f85 100644 --- a/RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl +++ b/RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl @@ -1,13 +1,14 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> [ - + <#list preparationOrder.preparation_line_lst?filter(l ->l.preparation_order_originator_reference!="") as preparation_line> + <#assign OrderOriginReference = preparation_line.preparation_order_originator_reference?trim?json_string> { "Header": { "ProjectID": "${projectRP}" }, "ID":{ - "RefID": "${preparationOrder.preparation_line_lst[0].preparation_order_originator_reference?trim?json_string}" + "RefID": "${OrderOriginReference}" }, "Payload":{ "Carrier": { @@ -15,4 +16,6 @@ } } } + <#sep>, + ] \ No newline at end of file From be2229d184be65bf34c4724bd1bf628ebd5b3d05 Mon Sep 17 00:00:00 2001 From: Laurie Montant Date: Mon, 18 Mar 2024 17:19:26 +0100 Subject: [PATCH 3/3] Modifs --- RFXtoRP_HsaIpgMove.ftl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/RFXtoRP_HsaIpgMove.ftl b/RFXtoRP_HsaIpgMove.ftl index 03cbfb8..c1a22d7 100644 --- a/RFXtoRP_HsaIpgMove.ftl +++ b/RFXtoRP_HsaIpgMove.ftl @@ -39,10 +39,9 @@ ] <#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"> + <#if (reflexMvtStockInterface.ipg_move_type == "100" || + reflexMvtStockInterface.ipg_move_type == "110" || + reflexMvtStockInterface.ipg_move_type == "120") && reflexMvtStockInterface.receipt_reference?? && reflexMvtStockInterface.receipt_reference!=""> [ { <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitGoodsReceived> @@ -52,13 +51,14 @@ } ] <#else> - <#-- Case of IPG move type volontarilly ignored--> - <#stop> + <#if reflexMvtStockInterface.receipt_reference?? && reflexMvtStockInterface.receipt_reference!=""> + <#-- Case of IPG move type volontarilly ignored--> + <#stop " Reference receipt is empty"> + <#else> + <#stop> + - <#else> - <#stop "Receipt reference is empty"> - - + <#else> <#-- cases of an IPG move with quantity = 0 (weight modification)--> <#stop>