diff --git a/ActorPrefix.ftl b/ActorPrefix.ftl index 700f29c..d177857 100644 --- a/ActorPrefix.ftl +++ b/ActorPrefix.ftl @@ -1,7 +1,126 @@ <#-- --------------------------------------------------------------------------------------- --> -<#-- Prefix 3 cars --> +<#-- Actor Prefix 4 cars --> <#-- --------------------------------------------------------------------------------------- --> -<#assign prefixdepot = "" > -<#assign prefixcarrier = "" > -<#assign prefixsupplier = "" > -<#assign prefixconsignee = "" > \ No newline at end of file + +<#-- For Depot --> +<#function RFXtoRPprefixDepot depot> + <#if uniqueness?? && uniqueness!="" > + <#local actor = depot> + <#else> + <#if text_language_rfx ="fr"> + <#local actor = "DEP_"+depot> + <#else> + <#if text_language_rfx ="it"> + <#local actor = "DEP_"+depot> + <#else> + <#if text_language_rfx ="es"> + <#local actor = "DEP_"+depot> + <#else> + <#if text_language_rfx ="pl"> + <#local actor = "MAG_"+depot> + <#else> + <#if text_language_rfx ="nl"> + <#local actor = "DEP_"+depot> + <#else> + <#local actor = "DEP_"+depot> + + + + + + +<#return (actor)> + + +<#-- For Supplier --> +<#function RFXtoRPprefixSupplier supplier> + <#if uniqueness?? && uniqueness!="" > + <#local actor = supplier> + <#else> + <#if text_language_rfx ="fr"> + <#local actor = "FOU_"+supplier> + <#else> + <#if text_language_rfx ="it"> + <#local actor = "FOR_"+supplier> + <#else> + <#if text_language_rfx ="es"> + <#local actor = "PRO_"+supplier> + <#else> + <#if text_language_rfx ="pl"> + <#local actor = "DOS_"+supplier> + <#else> + <#if text_language_rfx ="nl"> + <#local actor = "LEV_"+supplier> + <#else> + <#local actor = "SUP_"+supplier> + + + + + + +<#return (actor)> + + + +<#-- For Carrier --> +<#function RFXtoRPprefixCarrier carrier> + <#if uniqueness?? && uniqueness!="" > + <#local actor = carrier> + <#else> + <#if text_language_rfx ="fr"> + <#local actor = "TRA_"+carrier> + <#else> + <#if text_language_rfx ="it"> + <#local actor = "VET_"+carrier> + <#else> + <#if text_language_rfx ="es"> + <#local actor = "TRA_"+carrier> + <#else> + <#if text_language_rfx ="pl"> + <#local actor = "PRZ_"+carrier> + <#else> + <#if text_language_rfx ="nl"> + <#local actor = "VER_"+carrier> + <#else> + <#local actor = "CAR_"+carrier> + + + + + + +<#return (actor)> + + + +<#-- For Consignee --> +<#function RFXtoRPprefixConsignee consignee> + <#if uniqueness?? && uniqueness!="" > + <#local actor = consignee> + <#else> + <#if text_language_rfx ="fr"> + <#local actor = "DES_"+consignee> + <#else> + <#if text_language_rfx ="it"> + <#local actor = "DES_"+consignee> + <#else> + <#if text_language_rfx ="es"> + <#local actor = "DES_"+consignee> + <#else> + <#if text_language_rfx ="pl"> + <#local actor = "ODB_"+consignee> + <#else> + <#if text_language_rfx ="nl"> + <#local actor = "ONT_"+consignee> + <#else> + <#local actor = "CON_"+consignee> + + + + + + +<#return (actor)> + + diff --git a/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl b/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl index 806ce6c..23e9a4e 100644 --- a/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl +++ b/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl @@ -8,11 +8,7 @@ "ProjectID": "${projectRP}" }, "ID": { - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${stock.physical_depot_code}" - <#else> - "ActorID": "${prefixdepot}${stock.physical_depot_code}" - + "ActorID": "${RFXtoRPprefixDepot(stock.physical_depot_code)}" }, "Payload": { <#assign generation_date = RfxDateTimetoUTC(stock.generation_date,time_zone_offset_rfx) /> diff --git a/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl b/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl index 27775b7..fcf0f0c 100644 --- a/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl +++ b/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl @@ -8,12 +8,7 @@ "ProjectID": "${projectRP}" }, "Payload": { - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${stock.physical_depot_code}", - <#else> - "ActorID": "${prefixdepot}${stock.physical_depot_code}", - - + "ActorID": "${RFXtoRPprefixDepot(stock.physical_depot_code)}", <#assign generation_date = RfxDateTimetoUTC(stock.generation_date,time_zone_offset_rfx) /> "Snapshot": { "DateTime": { diff --git a/RFXtoRP_HsaCarrier_ActorCreated.ftl b/RFXtoRP_HsaCarrier_ActorCreated.ftl index a1fa2d3..8ac9722 100644 --- a/RFXtoRP_HsaCarrier_ActorCreated.ftl +++ b/RFXtoRP_HsaCarrier_ActorCreated.ftl @@ -7,11 +7,7 @@ "ProjectID": "${projectRP}" }, "ID": { - <#if uniqueness?? && uniqueness!="" > - "RefID": "${carrier.carrier_code?trim?json_string}" - <#else> - "RefID": "${prefixcarrier}${carrier.carrier_code?trim?json_string}" - + "RefID": "${RFXtoRPprefixCarrier(carrier.carrier_code?trim?json_string)}" }, "Payload": { "Name": "${carrier.carrier_designation?json_string}", diff --git a/RFXtoRP_HsaCarrier_ActorDeleted.ftl b/RFXtoRP_HsaCarrier_ActorDeleted.ftl index 89a3c3f..62b69a2 100644 --- a/RFXtoRP_HsaCarrier_ActorDeleted.ftl +++ b/RFXtoRP_HsaCarrier_ActorDeleted.ftl @@ -7,13 +7,8 @@ "ProjectID": "${projectRP}" }, "ID": { - <#if uniqueness?? && uniqueness!="" > - "RefID": "${carrier.carrier_code?trim?json_string}" - <#else> - "RefID": "${prefixcarrier}${carrier.carrier_code?trim?json_string}" - + "RefID": "${RFXtoRPprefixCarrier(carrier.carrier_code?trim?json_string)}" }, - "Payload": {} } ] diff --git a/RFXtoRP_HsaCons_ActorCreated.ftl b/RFXtoRP_HsaCons_ActorCreated.ftl index f342a4e..84df17a 100644 --- a/RFXtoRP_HsaCons_ActorCreated.ftl +++ b/RFXtoRP_HsaCons_ActorCreated.ftl @@ -7,13 +7,8 @@ "ProjectID": "${projectRP}" }, "ID": { - <#if uniqueness?? && uniqueness!="" > - "RefID": "${actor.code?trim?json_string}" - <#else> - "RefID": "${prefixconsignee}${actor.code?trim?json_string}" - + "RefID": "${RFXtoRPprefixConsignee(actor.code?trim?json_string)}" }, - "Payload": { "Name": "${actor.designation?json_string}", "ManagedStock": false, diff --git a/RFXtoRP_HsaCons_ActorDeleted.ftl b/RFXtoRP_HsaCons_ActorDeleted.ftl index f314e77..89d4fce 100644 --- a/RFXtoRP_HsaCons_ActorDeleted.ftl +++ b/RFXtoRP_HsaCons_ActorDeleted.ftl @@ -7,11 +7,7 @@ "ProjectID": "${projectRP}" }, "ID": { - <#if uniqueness?? && uniqueness!="" > - "RefID": "${actor.code?trim?json_string}" - <#else> - "RefID": "${prefixconsignee}${actor.code?trim?json_string}" - + "RefID": "${RFXtoRPprefixConsignee(actor.code?trim?json_string)}" }, "Payload": {} } diff --git a/RFXtoRP_HsaIpgMove_GoodsReceived.ftl b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl index cd36940..fdc74b4 100644 --- a/RFXtoRP_HsaIpgMove_GoodsReceived.ftl +++ b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl @@ -37,11 +37,7 @@ "ExecutionflowID": "${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.ipg_move_year_number}${reflexMvtStockInterface.extended_ipg_move_number}", "LineID": "${reflexMvtStockInterface.receipt_line_number}", - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${reflexMvtStockInterface.physical_depot_code?trim?json_string}", - <#else> - "ActorID": "${prefixdepot}${reflexMvtStockInterface.physical_depot_code?trim?json_string}", - + "ActorID": "${RFXtoRPprefixDepot(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 87d78b7..36b1f0e 100644 --- a/RFXtoRP_HsaIpgMove_StockMoved.ftl +++ b/RFXtoRP_HsaIpgMove_StockMoved.ftl @@ -42,11 +42,7 @@ "LVBranchID": "${reflexMvtStockInterface.lv_code?json_string}" }, - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${reflexMvtStockInterface.physical_depot_code?trim?json_string}", - <#else> - "ActorID": "${prefixdepot}${reflexMvtStockInterface.physical_depot_code?trim?json_string}", - + "ActorID": "${RFXtoRPprefixDepot(reflexMvtStockInterface.physical_depot_code?trim?json_string)}", "Movement": { "DateTime": { diff --git a/RFXtoRP_HsaSup_ActorCreated.ftl b/RFXtoRP_HsaSup_ActorCreated.ftl index 16c2f84..23a560c 100644 --- a/RFXtoRP_HsaSup_ActorCreated.ftl +++ b/RFXtoRP_HsaSup_ActorCreated.ftl @@ -7,11 +7,7 @@ "ProjectID": "${projectRP}" }, "ID": { - <#if uniqueness?? && uniqueness!="" > - "RefID": "${actor.code?trim?json_string}" - <#else> - "RefID": "${prefixsupplier}${actor.code?trim?json_string}" - + "RefID": "${RFXtoRPprefixSupplier(actor.code?trim?json_string)}" }, "Payload": { "Name": "${actor.designation?json_string}", diff --git a/RFXtoRP_HsaSup_ActorDeleted.ftl b/RFXtoRP_HsaSup_ActorDeleted.ftl index e4745a1..9c00b09 100644 --- a/RFXtoRP_HsaSup_ActorDeleted.ftl +++ b/RFXtoRP_HsaSup_ActorDeleted.ftl @@ -7,11 +7,7 @@ "ProjectID": "${projectRP}" }, "ID": { - <#if uniqueness?? && uniqueness!="" > - "RefID": "${actor.code?trim?json_string}" - <#else> - "RefID": "${prefixsupplier}${actor.code?trim?json_string}" - + "RefID": "${RFXtoRPprefixSupplier(actor.code?trim?json_string)}" }, "Payload": {} } diff --git a/RFXtoRP_HsrDepot_ActorCreated.ftl b/RFXtoRP_HsrDepot_ActorCreated.ftl index 56f93f7..3bac4c9 100644 --- a/RFXtoRP_HsrDepot_ActorCreated.ftl +++ b/RFXtoRP_HsrDepot_ActorCreated.ftl @@ -7,11 +7,7 @@ "ProjectID": "${projectRP}" }, "ID": { - <#if uniqueness?? && uniqueness!="" > - "RefID": "${depot.physical_depot_code?trim?json_string}" - <#else> - "RefID": "${prefixdepot}${depot.physical_depot_code?trim?json_string}" - + "RefID": "${RFXtoRPprefixDepot(depot.physical_depot_code?trim?json_string)}" }, "Payload": { "Name": "${depot.physical_depot_designation?json_string}", diff --git a/RFXtoRP_HsrDepot_ActorDeleted.ftl b/RFXtoRP_HsrDepot_ActorDeleted.ftl index d08aa72..2f59741 100644 --- a/RFXtoRP_HsrDepot_ActorDeleted.ftl +++ b/RFXtoRP_HsrDepot_ActorDeleted.ftl @@ -7,11 +7,7 @@ "ProjectID": "${projectRP}" }, "ID": { - <#if uniqueness?? && uniqueness!="" > - "RefID": "${depot.physical_depot_code?trim?json_string}" - <#else> - "RefID": "${prefixdepot}${depot.physical_depot_code?trim?json_string}" - + "RefID": "${RFXtoRPprefixDepot(depot.physical_depot_code?trim?json_string)}" }, "Payload": {} } diff --git a/RFXtoRP_HsrPrepa_CarrierUpdated.ftl b/RFXtoRP_HsrPrepa_CarrierUpdated.ftl index daf74db..112037e 100644 --- a/RFXtoRP_HsrPrepa_CarrierUpdated.ftl +++ b/RFXtoRP_HsrPrepa_CarrierUpdated.ftl @@ -19,11 +19,7 @@ }, "Payload":{ "Carrier": { - <#if uniqueness?? && uniqueness!="" > - "ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}" - <#else> - "ActorID":"${prefixcarrier}${preparationOrder.load_data.carrier_code?trim?json_string}" - + "ActorID": "${RFXtoRPprefixCarrier(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 cb1141c..a8ff88b 100644 --- a/RFXtoRP_HsrPrepa_HandlingunitGoodsPrepared.ftl +++ b/RFXtoRP_HsrPrepa_HandlingunitGoodsPrepared.ftl @@ -118,20 +118,15 @@ <#else> "LineID": "${preparation_line.pro_line_number!0}", - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${preparationOrder.physical_depot_code?trim?json_string}", - <#else> - "ActorID": "${prefixdepot}${preparationOrder.physical_depot_code?trim?json_string}", - - "Quantity": { - "LVID": "${quantity_in_base_lv_RP_Cst}", - "Value": ${despatched_ipg.quantity_lvs} + "ActorID": "${RFXtoRPprefixDepot(preparationOrder.physical_depot_code?trim?json_string)}", + "Quantity": { + "LVID": "${quantity_in_base_lv_RP_Cst}", + "Value": ${despatched_ipg.quantity_lvs} } } ] } - }<#sep>, <#sep>, diff --git a/RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl b/RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl index 905c839..96a5905 100644 --- a/RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl +++ b/RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl @@ -19,11 +19,7 @@ }, "Payload":{ "Carrier": { - <#if uniqueness?? && uniqueness!="" > - "ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}" - <#else> - "ActorID":"${prefixcarrier}${preparationOrder.load_data.carrier_code?trim?json_string}" - + "ActorID": "${RFXtoRPprefixCarrier(preparationOrder.load_data.carrier_code?trim?json_string)}" } } } diff --git a/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl b/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl index ba15a61..de29490 100644 --- a/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl +++ b/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl @@ -32,13 +32,8 @@ <#if preparationOrder.load_data?? && preparationOrder.load_data.carrier_code?? && preparationOrder.load_data.carrier_code!="" > , "HUCarrier":{ - <#if uniqueness?? && uniqueness!="" > - "ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}" - <#else> - "ActorID":"${prefixcarrier}${preparationOrder.load_data.carrier_code?trim?json_string}" - - } - + "ActorID": "${RFXtoRPprefixCarrier(preparationOrder.load_data.carrier_code?trim?json_string)}" + } } } diff --git a/RFXtoRP_HsrPrepa_TrackingHuLabelledHUsAdded.ftl b/RFXtoRP_HsrPrepa_TrackingHuLabelledHUsAdded.ftl index af5278a..f6c8deb 100644 --- a/RFXtoRP_HsrPrepa_TrackingHuLabelledHUsAdded.ftl +++ b/RFXtoRP_HsrPrepa_TrackingHuLabelledHUsAdded.ftl @@ -15,20 +15,13 @@ } }, "Payload": { - "HandlingunitID": "${despatched_ipg.hd_number}" - - <#if preparationOrder.load_data?? && preparationOrder.load_data.carrier_code?? && preparationOrder.load_data.carrier_code!="" > - , - "HUCarrier":{ - <#if uniqueness?? && uniqueness!="" > - "ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}" - <#else> - "ActorID":"${prefixcarrier}${preparationOrder.load_data.carrier_code?trim?json_string}" - - } - - + <#if preparationOrder.load_data?? && preparationOrder.load_data.carrier_code?? && preparationOrder.load_data.carrier_code!="" > + , + "HUCarrier":{ + "ActorID": "${RFXtoRPprefixCarrier(preparationOrder.load_data.carrier_code?trim?json_string)}" + } + } } ] \ No newline at end of file diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl index fa423bb..e55ef72 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl @@ -27,11 +27,7 @@ "CarrierService":"${preparation_order.transport_grade_code?trim?json_string}", --> "ShipFrom": { - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${preparation_order.physical_depot_code?trim?json_string}" - <#else> - "ActorID": "${prefixdepot}${preparation_order.physical_depot_code?trim?json_string}" - + "ActorID": "${RFXtoRPprefixDepot(preparation_order.physical_depot_code?trim?json_string)}" }, "ShipFromAcked": true, "ShipTo": { @@ -53,11 +49,7 @@ preparation_order.address.territorial_division_code == "" && preparation_order.address.postal_code == "" && preparation_order.address.iso_country_code == ""> - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${preparation_order.end_consignee_code}" - <#else> - "ActorID": "${prefixconsignee}${preparation_order.end_consignee_code}" - + "ActorID": "${RFXtoRPprefixConsignee(preparation_order.end_consignee_code)}" <#else> "Actor": { @@ -93,7 +85,6 @@ <#-- Line Metadata inclusion --> <#include "RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl">, - "RequestedContent": { "Goods": @@ -104,10 +95,8 @@ <#assign forced_priority_date = preparation_order_line.optional_attributes.forced_priority_date?datetime(rfx_date_format_default)?iso_utc /> "PriorityDate": "${forced_priority_date}", - <#-- Segmentation Keys inclusion --> <#include "RFXtoRP_HsrPro_ExecutionflowDetected_SegmentationKeys.ftl"> - }, "Quantity" : { @@ -119,7 +108,6 @@ ], - "RequestedMilestones" : { "RequestedDeliveryDateTime" : diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl index 4288f80..e1763ed 100644 --- a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl @@ -26,29 +26,16 @@ "ShipFrom": { - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${receipt.original_code?trim?json_string}" - <#else> - "ActorID": "${prefixsupplier}${receipt.original_code?trim?json_string}" - - + "ActorID": "${RFXtoRPprefixSupplier(receipt.original_code?trim?json_string)}" }, "ShipTo" : { - <#if uniqueness?? && uniqueness!="" > - "ActorID": "${receipt.physical_depot_code?trim?json_string}" - <#else> - "ActorID": "${prefixdepot}${receipt.physical_depot_code?trim?json_string}" - + "ActorID": "${RFXtoRPprefixDepot(receipt.physical_depot_code?trim?json_string)}" }, "ShipToAcked": true, <#if receipt.carrier_informations.carrier_code != ""> - <#if uniqueness?? && uniqueness!="" > - "Carrier" : {"ActorID": "${receipt.carrier_informations.carrier_code?trim?json_string}"}, - <#else> - "Carrier" : {"ActorID": "${prefixcarrier}${receipt.carrier_informations.carrier_code?trim?json_string}"}, - + "Carrier": "${RFXtoRPprefixCarrier(receipt.carrier_informations.carrier_code?trim?json_string)}", <#if receipt.line_list??>