From c05a4653ba559d76c140fcd7f85335b6c95302fa Mon Sep 17 00:00:00 2001 From: Laurie Montant Date: Tue, 17 Sep 2024 10:25:53 +0200 Subject: [PATCH] modifs --- ActorPrefix.ftl | 7 ++++ ...RP_HfDtlStockLs_ActorSnapshotCompleted.ftl | 33 +++++-------------- RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl | 26 +++------------ RFXtoRP_HsaCarrier_ActorCreated.ftl | 19 ++++------- RFXtoRP_HsaCarrier_ActorDeleted.ftl | 19 ++++------- RFXtoRP_HsaCons_ActorCreated.ftl | 19 ++++------- RFXtoRP_HsaCons_ActorDeleted.ftl | 19 ++++------- RFXtoRP_HsaIpgMove_GoodsReceived.ftl | 30 +++-------------- RFXtoRP_HsaIpgMove_StockMoved.ftl | 18 +++------- RFXtoRP_HsaSup_ActorCreated.ftl | 21 ++++-------- RFXtoRP_HsaSup_ActorDeleted.ftl | 19 ++++------- RFXtoRP_HsrDepot_ActorCreated.ftl | 17 +++------- RFXtoRP_HsrDepot_ActorDeleted.ftl | 20 ++++------- RFXtoRP_HsrPrepa_CarrierUpdated.ftl | 16 +++------ ...oRP_HsrPrepa_HandlingunitGoodsPrepared.ftl | 17 +++------- RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl | 17 +++------- RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl | 15 +++------ RFXtoRP_HsrPro_ExecutionflowDetected.ftl | 30 ++++------------- ...P_HsrReceiptList_ExecutionflowDetected.ftl | 33 +++++-------------- ReflexUtils.ftl | 6 ++-- 20 files changed, 113 insertions(+), 288 deletions(-) create mode 100644 ActorPrefix.ftl diff --git a/ActorPrefix.ftl b/ActorPrefix.ftl new file mode 100644 index 0000000..986ef01 --- /dev/null +++ b/ActorPrefix.ftl @@ -0,0 +1,7 @@ +<#-- --------------------------------------------------------------------------------------- --> +<#-- Prefix --> +<#-- --------------------------------------------------------------------------------------- --> +<#assign depot = "" > +<#assign carrier = "" > +<#assign supplier = "" > +<#assign consignee = "" > \ No newline at end of file diff --git a/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl b/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl index 64f5ed7..85dcd70 100644 --- a/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl +++ b/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl @@ -1,6 +1,6 @@ <#include "ReflexUtils.ftl"> <#include "HfRpConfig.ftl"> - +<#include "ActorPrefix.ftl"> [ <#list reflexStockPicturesInterface.detailled_stock_list as stock> { @@ -8,18 +8,10 @@ "ProjectID": "${projectRP}" }, "ID": { - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${stock.physical_depot_code}" - <#else> - "ActorID": "DEP${stock.physical_depot_code}" - - <#else> - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${stock.physical_depot_code}" - <#else> - "ActorID": "DEP${stock.physical_depot_code}" - + <#if uniqueness?? && uniqueness!="" > + "ActorID": "${stock.physical_depot_code}" + <#else> + "ActorID": "${depot}${stock.physical_depot_code}" }, "Payload": { @@ -29,18 +21,11 @@ "DateTime": "${generation_date}", "AuthorTimeZone": "${time_zone_rfx}" }, - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "ID": "${stock.physical_depot_code}-${idSnapshot}", - <#else> - "ID": "DEP${stock.physical_depot_code}-${idSnapshot}", - + + <#if uniqueness?? && uniqueness!="" > + "ID": "${stock.physical_depot_code}-${idSnapshot}", <#else> - <#if uniqueness?? && uniqueness!="" > - "ID": "${stock.physical_depot_code}-${idSnapshot}", - <#else> - "ID": "DEP${stock.physical_depot_code}-${idSnapshot}", - + "ID": "${depot}${stock.physical_depot_code}-${idSnapshot}", "MessageNb": ${sum_elt} } diff --git a/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl b/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl index 882466e..cd500e1 100644 --- a/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl +++ b/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl @@ -1,5 +1,6 @@ <#include "ReflexUtils.ftl"> <#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ <#list reflexStockPicturesInterface.detailled_stock_list as stock> { @@ -7,18 +8,10 @@ "ProjectID": "${projectRP}" }, "Payload": { - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${stock.physical_depot_code}", - <#else> - "ActorID": "DEP${stock.physical_depot_code}", - - <#else> <#if uniqueness?? && uniqueness!="" > - "ActorID": "${stock.physical_depot_code}", - <#else> - "ActorID": "DEP${stock.physical_depot_code}", - + "ActorID": "${stock.physical_depot_code}", + <#else> + "ActorID": "${depot}${stock.physical_depot_code}", <#assign generation_date = RfxDateTimetoUTC(stock.generation_date,time_zone_offset_rfx) /> @@ -27,20 +20,11 @@ "DateTime": "${generation_date}", "AuthorTimeZone": "${time_zone_rfx}" }, - <#if text_language_rfx="fr"> <#if uniqueness?? && uniqueness!="" > "ID": "${stock.physical_depot_code}-${idSnapshot}", <#else> - "ID": "DEP${stock.physical_depot_code}-${idSnapshot}", + "ID": "${depot}${stock.physical_depot_code}-${idSnapshot}", - <#else> - <#if uniqueness?? && uniqueness!="" > - "ID": "${stock.physical_depot_code}-${idSnapshot}", - <#else> - "ID": "DEP${stock.physical_depot_code}-${idSnapshot}", - - - "Quantity": { "Value" : "${stock.quantity_in_base_lvs!"0"}", diff --git a/RFXtoRP_HsaCarrier_ActorCreated.ftl b/RFXtoRP_HsaCarrier_ActorCreated.ftl index 8869d32..7cd7dd2 100644 --- a/RFXtoRP_HsaCarrier_ActorCreated.ftl +++ b/RFXtoRP_HsaCarrier_ActorCreated.ftl @@ -1,25 +1,18 @@ +<#include "ReflexUtils.ftl"> <#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "RefID": "${carrier.carrier_code?trim?json_string}" - <#else> - "RefID": "TRA${carrier.carrier_code?trim?json_string}" - - <#else> - <#if uniqueness?? && uniqueness!="" > - "RefID": "${carrier.carrier_code?trim?json_string}" - <#else> - "RefID": "CAR${carrier.carrier_code?trim?json_string}" - + <#if uniqueness?? && uniqueness!="" > + "RefID": "${carrier.carrier_code?trim?json_string}" + <#else> + "RefID": "${carrier}${carrier.carrier_code?trim?json_string}" }, - "Payload": { "Name": "${carrier.carrier_designation?json_string}", "ManagedStock": false, diff --git a/RFXtoRP_HsaCarrier_ActorDeleted.ftl b/RFXtoRP_HsaCarrier_ActorDeleted.ftl index bccbc47..9b8559a 100644 --- a/RFXtoRP_HsaCarrier_ActorDeleted.ftl +++ b/RFXtoRP_HsaCarrier_ActorDeleted.ftl @@ -1,24 +1,17 @@ +<#include "ReflexUtils.ftl"> <#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "RefID": "${carrier.carrier_code?trim?json_string}" - <#else> - "RefID": "TRA${carrier.carrier_code?trim?json_string}" - - <#else> - <#if uniqueness?? && uniqueness!="" > - "RefID": "${carrier.carrier_code?trim?json_string}" - <#else> - "RefID": "CAR${carrier.carrier_code?trim?json_string}" - + <#if uniqueness?? && uniqueness!="" > + "RefID": "${carrier.carrier_code?trim?json_string}" + <#else> + "RefID": "${carrier}${carrier.carrier_code?trim?json_string}" - }, "Payload": {} diff --git a/RFXtoRP_HsaCons_ActorCreated.ftl b/RFXtoRP_HsaCons_ActorCreated.ftl index bf287d4..9cbe7e5 100644 --- a/RFXtoRP_HsaCons_ActorCreated.ftl +++ b/RFXtoRP_HsaCons_ActorCreated.ftl @@ -1,24 +1,17 @@ +<#include "ReflexUtils.ftl"> <#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "RefID": "${actor.code?trim?json_string}" - <#else> - "RefID": "DES${actor.code?trim?json_string}" - - <#else> - <#if uniqueness?? && uniqueness!="" > - "RefID": "${actor.code?trim?json_string}" - <#else> - "RefID": "CON${actor.code?trim?json_string}" - + <#if uniqueness?? && uniqueness!="" > + "RefID": "${actor.code?trim?json_string}" + <#else> + "RefID": "${consignee}${actor.code?trim?json_string}" - }, "Payload": { diff --git a/RFXtoRP_HsaCons_ActorDeleted.ftl b/RFXtoRP_HsaCons_ActorDeleted.ftl index 46b44cb..4d1956d 100644 --- a/RFXtoRP_HsaCons_ActorDeleted.ftl +++ b/RFXtoRP_HsaCons_ActorDeleted.ftl @@ -1,25 +1,18 @@ +<#include "ReflexUtils.ftl"> <#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "RefID": "${actor.code?trim?json_string}" - <#else> - "RefID": "DES${actor.code?trim?json_string}" - - <#else> - <#if uniqueness?? && uniqueness!="" > - "RefID": "${actor.code?trim?json_string}" - <#else> - "RefID": "CON${actor.code?trim?json_string}" - + <#if uniqueness?? && uniqueness!="" > + "RefID": "${actor.code?trim?json_string}" + <#else> + "RefID": "${consignee}${actor.code?trim?json_string}" }, - "Payload": {} } ] diff --git a/RFXtoRP_HsaIpgMove_GoodsReceived.ftl b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl index 516bc26..f63084d 100644 --- a/RFXtoRP_HsaIpgMove_GoodsReceived.ftl +++ b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl @@ -1,5 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> +<#include "ActorPrefix.ftl"> [ <#assign receipt_confirmation_datetime = RfxDateTimetoUTC(reflexMvtStockInterface.ipg_move_creation_datetime,time_zone_offset_rfx) /> <#assign priority_date = reflexMvtStockInterface.ipg_priority_date?datetime(rfx_date_format_default)?iso_utc /> @@ -33,35 +34,14 @@ <#if reflexMvtStockInterface.receipt_reference!=""> "ExecutionflowID": "${reflexMvtStockInterface.receipt_reference?trim?json_string}", <#else> - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "ExecutionflowID": "${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.ipg_move_year_number}${reflexMvtStockInterface.extended_ipg_move_number}", - <#else> - "ExecutionflowID": "DEP${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.ipg_move_year_number}${reflexMvtStockInterface.extended_ipg_move_number}", - - <#else> - <#if uniqueness?? && uniqueness!="" > - "ExecutionflowID": "${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.ipg_move_year_number}${reflexMvtStockInterface.extended_ipg_move_number}", - <#else> - "ExecutionflowID": "DEP${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.ipg_move_year_number}${reflexMvtStockInterface.extended_ipg_move_number}", - - + "ExecutionflowID": "${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.ipg_move_year_number}${reflexMvtStockInterface.extended_ipg_move_number}", "LineID": "${reflexMvtStockInterface.receipt_line_number}", - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${reflexMvtStockInterface.physical_depot_code?trim?json_string}", - <#else> - "ActorID": "DEP${reflexMvtStockInterface.physical_depot_code?trim?json_string}", - + <#if uniqueness?? && uniqueness!="" > + "ActorID": "${reflexMvtStockInterface.physical_depot_code?trim?json_string}", <#else> - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${reflexMvtStockInterface.physical_depot_code?trim?json_string}", - <#else> - "ActorID": "DEP${reflexMvtStockInterface.physical_depot_code?trim?json_string}", - + "ActorID": "${depot}${reflexMvtStockInterface.physical_depot_code?trim?json_string}", - "Quantity": { "LVID": "${quantity_in_base_lv_RP_Cst}", "Value": ${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs} diff --git a/RFXtoRP_HsaIpgMove_StockMoved.ftl b/RFXtoRP_HsaIpgMove_StockMoved.ftl index 467ee19..4ee24aa 100644 --- a/RFXtoRP_HsaIpgMove_StockMoved.ftl +++ b/RFXtoRP_HsaIpgMove_StockMoved.ftl @@ -1,5 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> +<#include "ActorPrefix.ftl"> <#assign MoveType_KV = {"130":"STOCK_MOVEMENT_TYPE_PRODUCTION", "200":"STOCK_MOVEMENT_TYPE_FIX", @@ -42,20 +43,11 @@ "LVBranchID": "${reflexMvtStockInterface.lv_code?json_string}" }, - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${reflexMvtStockInterface.physical_depot_code?trim?json_string}", - <#else> - "ActorID": "DEP${reflexMvtStockInterface.physical_depot_code?trim?json_string}", - - <#else> - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${reflexMvtStockInterface.physical_depot_code?trim?json_string}", - <#else> - "ActorID": "DEP${reflexMvtStockInterface.physical_depot_code?trim?json_string}", - + <#if uniqueness?? && uniqueness!="" > + "ActorID": "${reflexMvtStockInterface.physical_depot_code?trim?json_string}", + <#else> + "ActorID": "${depot}${reflexMvtStockInterface.physical_depot_code?trim?json_string}", - "Movement": { "DateTime": { diff --git a/RFXtoRP_HsaSup_ActorCreated.ftl b/RFXtoRP_HsaSup_ActorCreated.ftl index 97329af..490d254 100644 --- a/RFXtoRP_HsaSup_ActorCreated.ftl +++ b/RFXtoRP_HsaSup_ActorCreated.ftl @@ -1,25 +1,18 @@ +<#include "ReflexUtils.ftl"> <#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "RefID": "${actor.code?trim?json_string}" - <#else> - "RefID": "FOU${actor.code?trim?json_string}" - - <#else> - <#if uniqueness?? && uniqueness!="" > - "RefID": "${actor.code?trim?json_string}" - <#else> - "RefID": "SUP${actor.code?trim?json_string}" - + <#if uniqueness?? && uniqueness!="" > + "RefID": "${actor.code?trim?json_string}" + <#else> + "RefID": "${supplier}${actor.code?trim?json_string}" }, - "Payload": { "Name": "${actor.designation?json_string}", "ManagedStock": false, @@ -27,10 +20,8 @@ <#-- ***Partner ID could be added here *** --> <#-- "PartnerID": "${}", --> - <#include "RFXtoRP_HsaSup_ActorCreated_Metadata.ftl">, - "Address": { <#-- if Reflex WMS address is structured --> diff --git a/RFXtoRP_HsaSup_ActorDeleted.ftl b/RFXtoRP_HsaSup_ActorDeleted.ftl index 109bc2f..94179b2 100644 --- a/RFXtoRP_HsaSup_ActorDeleted.ftl +++ b/RFXtoRP_HsaSup_ActorDeleted.ftl @@ -1,25 +1,18 @@ +<#include "ReflexUtils.ftl"> <#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "RefID": "${actor.code?trim?json_string}" - <#else> - "RefID": "FOU${actor.code?trim?json_string}" - - <#else> - <#if uniqueness?? && uniqueness!="" > - "RefID": "${actor.code?trim?json_string}" - <#else> - "RefID": "SUP${actor.code?trim?json_string}" - + <#if uniqueness?? && uniqueness!="" > + "RefID": "${actor.code?trim?json_string}" + <#else> + "RefID": "${supplier}${actor.code?trim?json_string}" }, - "Payload": {} } ] diff --git a/RFXtoRP_HsrDepot_ActorCreated.ftl b/RFXtoRP_HsrDepot_ActorCreated.ftl index ecf47aa..28bbb91 100644 --- a/RFXtoRP_HsrDepot_ActorCreated.ftl +++ b/RFXtoRP_HsrDepot_ActorCreated.ftl @@ -1,25 +1,18 @@ +<#include "ReflexUtils.ftl"> <#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "RefID": "${depot.physical_depot_code?trim?json_string}" - <#else> - "RefID": "DEP${depot.physical_depot_code?trim?json_string}" - - <#else> <#if uniqueness?? && uniqueness!="" > - "RefID": "${depot.physical_depot_code?trim?json_string}" - <#else> - "RefID": "DEP${depot.physical_depot_code?trim?json_string}" - + "RefID": "${depot.physical_depot_code?trim?json_string}" + <#else> + "RefID": "${depot}${depot.physical_depot_code?trim?json_string}" }, - "Payload": { "Name": "${depot.physical_depot_designation?json_string}", "ManagedStock": true, diff --git a/RFXtoRP_HsrDepot_ActorDeleted.ftl b/RFXtoRP_HsrDepot_ActorDeleted.ftl index 9523b0a..7dcb8eb 100644 --- a/RFXtoRP_HsrDepot_ActorDeleted.ftl +++ b/RFXtoRP_HsrDepot_ActorDeleted.ftl @@ -1,26 +1,18 @@ +<#include "ReflexUtils.ftl"> <#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "RefID": "${depot.physical_depot_code?trim?json_string}" - <#else> - "RefID": "DEP${depot.physical_depot_code?trim?json_string}" - - <#else> - <#if uniqueness?? && uniqueness!="" > - "RefID": "${depot.physical_depot_code?trim?json_string}" - <#else> - "RefID": "DEP${depot.physical_depot_code?trim?json_string}" - + <#if uniqueness?? && uniqueness!="" > + "RefID": "${depot.physical_depot_code?trim?json_string}" + <#else> + "RefID": "${depot}${depot.physical_depot_code?trim?json_string}" - }, - "Payload": {} } ] diff --git a/RFXtoRP_HsrPrepa_CarrierUpdated.ftl b/RFXtoRP_HsrPrepa_CarrierUpdated.ftl index 547813b..cc16cdd 100644 --- a/RFXtoRP_HsrPrepa_CarrierUpdated.ftl +++ b/RFXtoRP_HsrPrepa_CarrierUpdated.ftl @@ -1,5 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> +<#include "ActorPrefix.ftl"> [ <#assign refIDHmap_local ={}> <#list preparationOrder.preparation_line_lst?filter(l ->l.preparation_order_originator_reference!="") as preparation_line> @@ -18,20 +19,11 @@ }, "Payload":{ "Carrier": { - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}" - <#else> - "ActorID":"TRA${preparationOrder.load_data.carrier_code?trim?json_string}" - + <#if uniqueness?? && uniqueness!="" > + "ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}" <#else> - <#if uniqueness?? && uniqueness!="" > - "ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}" - <#else> - "ActorID":"CAR${preparationOrder.load_data.carrier_code?trim?json_string}" - + "ActorID":"${carrier}${preparationOrder.load_data.carrier_code?trim?json_string}" - } <#-- Add transport grade code <#if preparationOrder.transport_grade_code!=""> diff --git a/RFXtoRP_HsrPrepa_HandlingunitGoodsPrepared.ftl b/RFXtoRP_HsrPrepa_HandlingunitGoodsPrepared.ftl index 7f84b32..bfd6160 100644 --- a/RFXtoRP_HsrPrepa_HandlingunitGoodsPrepared.ftl +++ b/RFXtoRP_HsrPrepa_HandlingunitGoodsPrepared.ftl @@ -1,4 +1,6 @@ +<#include "ReflexUtils.ftl"> <#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ <#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> @@ -116,20 +118,11 @@ <#else> "LineID": "${preparation_line.pro_line_number!0}", - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${preparationOrder.physical_depot_code?trim?json_string}", - <#else> - "ActorID": "DEP${preparationOrder.physical_depot_code?trim?json_string}", - + <#if uniqueness?? && uniqueness!="" > + "ActorID": "${preparationOrder.physical_depot_code?trim?json_string}", <#else> - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${preparationOrder.physical_depot_code?trim?json_string}", - <#else> - "ActorID": "DEP${preparationOrder.physical_depot_code?trim?json_string}", - + "ActorID": "${depot}${preparationOrder.physical_depot_code?trim?json_string}", - "Quantity": { "LVID": "${quantity_in_base_lv_RP_Cst}", "Value": ${despatched_ipg.quantity_lvs} diff --git a/RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl b/RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl index e723198..de08ad2 100644 --- a/RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl +++ b/RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl @@ -1,5 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> +<#include "ActorPrefix.ftl"> [ <#assign refIDHmap_local ={}> <#list preparationOrder.preparation_line_lst?filter(l ->l.preparation_order_originator_reference!="") as preparation_line> @@ -18,21 +19,11 @@ }, "Payload":{ "Carrier": { - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}" - <#else> - "ActorID":"TRA${preparationOrder.load_data.carrier_code?trim?json_string}" - + <#if uniqueness?? && uniqueness!="" > + "ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}" <#else> - <#if uniqueness?? && uniqueness!="" > - "ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}" - <#else> - "ActorID":"CAR${preparationOrder.load_data.carrier_code?trim?json_string}" - + "ActorID":"${carrier}${preparationOrder.load_data.carrier_code?trim?json_string}" - - } } } diff --git a/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl b/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl index 37ecb2f..0498bbb 100644 --- a/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl +++ b/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl @@ -1,5 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> +<#include "ActorPrefix.ftl"> [ { @@ -18,18 +19,10 @@ <#if preparationOrder.load_data?? && preparationOrder.load_data.carrier_code?? && preparationOrder.load_data.carrier_code!="" > , "HUCarrier":{ - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}" - <#else> - "ActorID":"TRA${preparationOrder.load_data.carrier_code?trim?json_string}" - + <#if uniqueness?? && uniqueness!="" > + "ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}" <#else> - <#if uniqueness?? && uniqueness!="" > - "ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}" - <#else> - "ActorID":"CAR${preparationOrder.load_data.carrier_code?trim?json_string}" - + "ActorID":"${carrier}${preparationOrder.load_data.carrier_code?trim?json_string}" } diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl index 5c73f6b..dc2cb46 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl @@ -1,5 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> +<#include "ActorPrefix.ftl"> [ { <#assign planned_final_delivery_start_datetime = RfxDateTimetoUTC(preparation_order.planned_final_delivery_start_datetime,time_zone_offset_rfx) /> @@ -26,20 +27,11 @@ "CarrierService":"${preparation_order.transport_grade_code?trim?json_string}", --> "ShipFrom": { - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${preparation_order.physical_depot_code?trim?json_string}" - <#else> - "ActorID": "DEP${preparation_order.physical_depot_code?trim?json_string}" - + <#if uniqueness?? && uniqueness!="" > + "ActorID": "${preparation_order.physical_depot_code?trim?json_string}" <#else> - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${preparation_order.physical_depot_code?trim?json_string}" - <#else> - "ActorID": "DEP${preparation_order.physical_depot_code?trim?json_string}" - + "ActorID": "${depot}${preparation_order.physical_depot_code?trim?json_string}" - }, "ShipFromAcked": true, "ShipTo": { @@ -61,18 +53,10 @@ preparation_order.address.territorial_division_code == "" && preparation_order.address.postal_code == "" && preparation_order.address.iso_country_code == ""> - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${preparation_order.end_consignee_code}" - <#else> - "ActorID": "DES${preparation_order.end_consignee_code}" - + <#if uniqueness?? && uniqueness!="" > + "ActorID": "${preparation_order.end_consignee_code}" <#else> - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${preparation_order.end_consignee_code}" - <#else> - "ActorID": "CON${preparation_order.end_consignee_code}" - + "ActorID": "${consignee}${preparation_order.end_consignee_code}" <#else> "Actor": diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl index e52daef..3d647f8 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl @@ -1,5 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> +<#include "ActorPrefix.ftl"> [ { <#assign receipt_datetime = RfxDateTimetoUTC(receipt.receipt_datetime,time_zone_offset_rfx) /> @@ -29,40 +30,22 @@ }, "ShipTo" : { - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${receipt.physical_depot_code?trim?json_string}" - <#else> - "ActorID": "DEP${receipt.physical_depot_code?trim?json_string}" - - <#else> - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${receipt.physical_depot_code?trim?json_string}" - <#else> - "ActorID": "DEP${receipt.physical_depot_code?trim?json_string}" - + <#if uniqueness?? && uniqueness!="" > + "ActorID": "${receipt.physical_depot_code?trim?json_string}" + <#else> + "ActorID": "${depot}${receipt.physical_depot_code?trim?json_string}" - }, "ShipToAcked": true, <#if receipt.carrier_informations.carrier_code != ""> - <#if text_language_rfx="fr"> - <#if uniqueness?? && uniqueness!="" > - "Carrier" : {"ActorID": "${receipt.carrier_informations.carrier_code?trim?json_string}"}, - <#else> - "Carrier" : {"ActorID": "TRA${receipt.carrier_informations.carrier_code?trim?json_string}"}, - + <#if uniqueness?? && uniqueness!="" > + "Carrier" : {"ActorID": "${receipt.carrier_informations.carrier_code?trim?json_string}"}, <#else> - <#if uniqueness?? && uniqueness!="" > - "Carrier" : {"ActorID": "${receipt.carrier_informations.carrier_code?trim?json_string}"}, - <#else> - "Carrier" : {"ActorID": "CAR${receipt.carrier_informations.carrier_code?trim?json_string}"}, - + "Carrier" : {"ActorID": "${carrier}${receipt.carrier_informations.carrier_code?trim?json_string}"}, - <#if receipt.line_list??> "Lines" : [ <#list receipt.line_list as line> diff --git a/ReflexUtils.ftl b/ReflexUtils.ftl index b7071f6..afa299e 100644 --- a/ReflexUtils.ftl +++ b/ReflexUtils.ftl @@ -17,14 +17,14 @@ <#function splitEmailsIntoArray emails > <#local str = "["> <#list emails?split(";|,| |à|/","r")?filter(l -> l != "") as email> -<#if email?matches("^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$")> -<#if str != "["> +<#if email?matches("^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$")> +<#if str != "["> <#local str += ","> <#local str += "\""> <#local str += email> <#local str += "\""> - + <#local str += "]"> <#return (str)>