From 173deec755e6eedace39d6aee62014c18c8765f4 Mon Sep 17 00:00:00 2001 From: frea Date: Wed, 4 Dec 2024 08:08:26 +0100 Subject: [PATCH] pour 1.9 --- ActorPrefix.ftl | 162 ++++++++++++++++++ RFXtoRP_HfDtlStockLs.ftl | 4 +- ...RP_HfDtlStockLs_ActorSnapshotCompleted.ftl | 24 +-- RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl | 16 +- RFXtoRP_HfGrade.ftl | 10 +- RFXtoRP_HfLvTypeList.ftl | 2 +- RFXtoRP_HfOwner.ftl | 10 +- RFXtoRP_HfRpConfig.ftl | 14 +- RFXtoRP_HsaCarrier.ftl | 34 ++-- RFXtoRP_HsaCarrier_ActorCreated.ftl | 12 +- RFXtoRP_HsaCarrier_ActorDeleted.ftl | 6 +- RFXtoRP_HsaCons.ftl | 34 ++-- RFXtoRP_HsaCons_ActorCreated.ftl | 14 +- RFXtoRP_HsaCons_ActorDeleted.ftl | 6 +- RFXtoRP_HsaDispute.ftl | 47 +++++ RFXtoRP_HsaDispute_Created.ftl | 70 ++++++++ RFXtoRP_HsaDispute_MessageSent.ftl | 124 ++++++++++++++ ...saDispute_TableReasonCodeToClaimTypeID.ftl | 7 + RFXtoRP_HsaIpgMove.ftl | 9 +- RFXtoRP_HsaIpgMove_GoodsReceived.ftl | 4 +- ...IpgMove_GoodsReceived_SegmentationKeys.ftl | 8 +- RFXtoRP_HsaIpgMove_StockMoved.ftl | 10 +- RFXtoRP_HsaItm.ftl | 32 ++-- RFXtoRP_HsaItmLv.ftl | 30 ++-- RFXtoRP_HsaItm_ItemCreated.ftl | 4 +- RFXtoRP_HsaLstCarSta.ftl | 40 +++++ RFXtoRP_HsaProStatus.ftl | 4 +- RFXtoRP_HsaSup.ftl | 34 ++-- RFXtoRP_HsaSup_ActorCreated.ftl | 12 +- RFXtoRP_HsaSup_ActorDeleted.ftl | 6 +- RFXtoRP_HsrCarrierApt.ftl | 40 +++++ RFXtoRP_HsrDepot.ftl | 34 ++-- RFXtoRP_HsrDepot_ActorCreated.ftl | 23 ++- RFXtoRP_HsrDepot_ActorDeleted.ftl | 6 +- RFXtoRP_HsrLoadInfo.ftl | 40 +++++ RFXtoRP_HsrPrepa.ftl | 36 ++-- RFXtoRP_HsrPrepa_CarrierUpdated.ftl | 3 +- ...epa_GoodsPrepared_HandlingUnitMetadata.ftl | 4 +- ...srPrepa_GoodsPrepared_SegmentationKeys.ftl | 7 +- ...P_HsrPrepa_HUsAdded_TrackingHuLabelled.ftl | 27 +++ ...oRP_HsrPrepa_HandlingunitGoodsPrepared.ftl | 13 +- RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl | 3 +- RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl | 19 +- RFXtoRP_HsrPro.ftl | 12 +- RFXtoRP_HsrPro_ExecutionflowDetected.ftl | 9 +- RFXtoRP_HsrReceiptList.ftl | 2 +- ...P_HsrReceiptList_ExecutionflowDetected.ftl | 11 +- RFXtoRP_PlatformLogCreate.ftl | 15 +- RFXtoRP_RestResponse.ftl | 76 +++++++- RFXtoRP_RestResponseAllocationError.ftl | 2 +- RFXtoRP_RfxConfigurationRp.ftl | 38 ++-- RPtoRFX_ExecutionflowEvent.ftl | 26 +-- RPtoRFX_PrepOrder.ftl | 6 +- RPtoRFX_Receipt.ftl | 8 +- RPtoRFX_Receipt_DefaultLineData.ftl | 2 +- ReflexUtils.ftl | 6 +- Table.ftl | 15 ++ 57 files changed, 979 insertions(+), 293 deletions(-) create mode 100644 ActorPrefix.ftl create mode 100644 RFXtoRP_HsaDispute.ftl create mode 100644 RFXtoRP_HsaDispute_Created.ftl create mode 100644 RFXtoRP_HsaDispute_MessageSent.ftl create mode 100644 RFXtoRP_HsaDispute_TableReasonCodeToClaimTypeID.ftl create mode 100644 RFXtoRP_HsaLstCarSta.ftl create mode 100644 RFXtoRP_HsrCarrierApt.ftl create mode 100644 RFXtoRP_HsrLoadInfo.ftl create mode 100644 RFXtoRP_HsrPrepa_HUsAdded_TrackingHuLabelled.ftl create mode 100644 Table.ftl diff --git a/ActorPrefix.ftl b/ActorPrefix.ftl new file mode 100644 index 0000000..e12b76d --- /dev/null +++ b/ActorPrefix.ftl @@ -0,0 +1,162 @@ + +<#-- --------------------------------------------------------------------------------------- --> +<#-- Actor Prefix 4 cars --> +<#-- --------------------------------------------------------------------------------------- --> + +<#-- For Depot --> +<#function RFXtoRPprefixDepot depot> + <#if 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)> + + +<#function RPtoRFXprefixDepot actor> + <#if uniqueness> + <#local depot = actor> + <#else> + <#local depot = actor[4..]> + +<#return (depot)> + + + + +<#-- For Supplier --> +<#function RFXtoRPprefixSupplier supplier> + <#if 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)> + + +<#function RPtoRFXprefixSupplier actor> + <#if uniqueness> + <#local supplier = actor> + <#else> + <#local supplier = actor[4..]> + +<#return (supplier)> + + +<#-- For Carrier --> +<#function RFXtoRPprefixCarrier carrier> + <#if 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)> + + +<#function RPtoRFXprefixCarrier actor> + <#if uniqueness> + <#local carrier = actor> + <#else> + <#local carrier = actor[4..]> + +<#return (carrier)> + + +<#-- For Consignee --> +<#function RFXtoRPprefixConsignee consignee> + <#if 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)> + + +<#function RPtoRFXprefixConsignee actor> + <#if uniqueness> + <#local consignee = actor> + <#else> + <#local consignee = actor[4..]> + +<#return (consignee)> + \ No newline at end of file diff --git a/RFXtoRP_HfDtlStockLs.ftl b/RFXtoRP_HfDtlStockLs.ftl index 1c514ab..28d6d61 100644 --- a/RFXtoRP_HfDtlStockLs.ftl +++ b/RFXtoRP_HfDtlStockLs.ftl @@ -50,11 +50,11 @@ <#case "D"> <#-- *********************************************** Action = DELETE ******************** --> - <#stop "event not supported"> + <#stop > <#break> <#default> - <#stop "event not supported"> + <#stop > diff --git a/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl b/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl index 6e6600b..e248350 100644 --- a/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl +++ b/RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl @@ -1,27 +1,29 @@ <#include "ReflexUtils.ftl"> +<#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ <#list reflexStockPicturesInterface.detailled_stock_list as stock> { "Header": { - "ProjectID": "${projectRP}" + "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${stock.physical_depot_code}" - }, - "Payload": { + "RefID": "${RFXtoRPprefixDepot(stock.physical_depot_code)}" + }, + "Payload": { <#assign generation_date = RfxDateTimetoUTC(stock.generation_date,time_zone_offset_rfx) /> "Snapshot": { "EndDateTime": { - "DateTime": "${generation_date}", - "AuthorTimeZone": "${time_zone_rfx}" - }, - "ID": "${stock.physical_depot_code}-${idSnapshot}", - "MessageNb": ${sum_elt} + "DateTime": "${generation_date}", + "AuthorTimeZone": "${time_zone_rfx}" + }, + "ID": "${stock.physical_depot_code}-${idSnapshot}", + "MessageNb": ${sum_elt} } - + } } <#break> - + ] diff --git a/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl b/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl index deed817..fcf0f0c 100644 --- a/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl +++ b/RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl @@ -1,4 +1,6 @@ <#include "ReflexUtils.ftl"> +<#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ <#list reflexStockPicturesInterface.detailled_stock_list as stock> { @@ -6,19 +8,19 @@ "ProjectID": "${projectRP}" }, "Payload": { - "ActorID": "${stock.physical_depot_code}", + "ActorID": "${RFXtoRPprefixDepot(stock.physical_depot_code)}", <#assign generation_date = RfxDateTimetoUTC(stock.generation_date,time_zone_offset_rfx) /> "Snapshot": { "DateTime": { "DateTime": "${generation_date}", "AuthorTimeZone": "${time_zone_rfx}" }, - "ID": "${stock.physical_depot_code}-${idSnapshot}", - "Quantity": - { - "Value" : "${stock.quantity_in_base_lvs!"0"}", - "LVID": "${quantity_in_base_lv_RP_Cst}" - } + "ID": "${stock.physical_depot_code}-${idSnapshot}", + "Quantity": + { + "Value" : "${stock.quantity_in_base_lvs!"0"}", + "LVID": "${quantity_in_base_lv_RP_Cst}" + } }, "Goods": { diff --git a/RFXtoRP_HfGrade.ftl b/RFXtoRP_HfGrade.ftl index ee9990d..39f6d2f 100644 --- a/RFXtoRP_HfGrade.ftl +++ b/RFXtoRP_HfGrade.ftl @@ -1,5 +1,5 @@ <#-- *********************************************** Parameter global ******************** --> -<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign projectRP = project> <#assign organisationRP = organisation> @@ -9,11 +9,11 @@ <#case "C"> <#case "U"> <#case "D"> - <#stop "no generic FTL file available yet for Grades"> + <#stop "no generic FTL file available yet for Grades"> <#break> - - + + <#default> - <#stop "event not supported"> + <#stop > diff --git a/RFXtoRP_HfLvTypeList.ftl b/RFXtoRP_HfLvTypeList.ftl index 584df9a..f9b3b04 100644 --- a/RFXtoRP_HfLvTypeList.ftl +++ b/RFXtoRP_HfLvTypeList.ftl @@ -16,6 +16,6 @@ <#default> - <#stop "event not supported"> + <#stop > diff --git a/RFXtoRP_HfOwner.ftl b/RFXtoRP_HfOwner.ftl index 571248a..6d23fd2 100644 --- a/RFXtoRP_HfOwner.ftl +++ b/RFXtoRP_HfOwner.ftl @@ -1,5 +1,5 @@ <#-- *********************************************** Parameter global ******************** --> -<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign projectRP = project> <#assign organisationRP = organisation> @@ -9,11 +9,11 @@ <#case "C"> <#case "U"> <#case "D"> - <#stop "no generic FTL file available yet for Owners"> + <#stop "no generic FTL file available yet for Owners"> <#break> - - + + <#default> - <#stop "event not supported"> + <#stop > diff --git a/RFXtoRP_HfRpConfig.ftl b/RFXtoRP_HfRpConfig.ftl index 8792d92..0d0751e 100644 --- a/RFXtoRP_HfRpConfig.ftl +++ b/RFXtoRP_HfRpConfig.ftl @@ -4,7 +4,7 @@ those parameters are stored in FTL file HfRpConfig.ftl for later use in some of *** --> <#-- *********************************************** Parameter global ******************** --> -<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign projectRP = project> <#assign organisationRP = organisation> @@ -16,18 +16,18 @@ those parameters are stored in FTL file HfRpConfig.ftl for later use in some of <#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign file = JsonUtil.jsonToMap(dataRfx)> - + <#include "RFXtoRP_RfxConfigurationRp.ftl"> - + <#break> - + <#case "D"> <#-- *********************************************** Action = DELETE ******************** --> <#stop "deletion of config not supported"> <#break> - - + + <#default> - <#stop "event not supported"> + <#stop > diff --git a/RFXtoRP_HsaCarrier.ftl b/RFXtoRP_HsaCarrier.ftl index c0b031b..6b47034 100644 --- a/RFXtoRP_HsaCarrier.ftl +++ b/RFXtoRP_HsaCarrier.ftl @@ -3,7 +3,7 @@ <#-- project : projectId in ReflexPlatform --> <#-- organisation : organisationtId in ReflexPlatform --> -<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign projectRP = project> <#assign organisationRP = organisation> @@ -14,33 +14,33 @@ <#case "U"> <#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign carrier = JsonUtil.jsonToMap(dataRfx)> - [ + <#assign carrier = JsonUtil.jsonToMap(dataRfx)> + [ { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaCarrier_ActorCreated.ftl"> + "datas" : + <#include "RFXtoRP_HsaCarrier_ActorCreated.ftl"> } - ] + ] <#break> - + <#case "D"> <#-- *********************************************** Action = DELETE ******************************* --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign carrier = JsonUtil.jsonToMap(dataRfx)> - [ + <#assign carrier = JsonUtil.jsonToMap(dataRfx)> + [ { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaCarrier_ActorDeleted.ftl"> + "datas" : + <#include "RFXtoRP_HsaCarrier_ActorDeleted.ftl"> } - ] + ] <#break> - - + + <#default> - <#stop "event not supported"> + <#stop > diff --git a/RFXtoRP_HsaCarrier_ActorCreated.ftl b/RFXtoRP_HsaCarrier_ActorCreated.ftl index c516655..8ac9722 100644 --- a/RFXtoRP_HsaCarrier_ActorCreated.ftl +++ b/RFXtoRP_HsaCarrier_ActorCreated.ftl @@ -1,12 +1,14 @@ +<#include "ReflexUtils.ftl"> +<#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${carrier.carrier_code?trim?json_string}" + "RefID": "${RFXtoRPprefixCarrier(carrier.carrier_code?trim?json_string)}" }, - "Payload": { "Name": "${carrier.carrier_designation?json_string}", "ManagedStock": false, @@ -14,10 +16,8 @@ <#-- ***Partner ID could be added here *** --> <#-- "PartnerID": "${}", --> - <#-- - <#include "RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl">, - --> + <#include "RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl">, "Address": { @@ -45,7 +45,7 @@ "StreetAddressOne" : "${carrier.address.address_1?json_string}", "StreetAddressTwo" : "${carrier.address.address_2?json_string}", "StreetAddressThree" : "${carrier.address.address_3?json_string}", - "CountryCode" : "" + "CountryCode" : "" }, diff --git a/RFXtoRP_HsaCarrier_ActorDeleted.ftl b/RFXtoRP_HsaCarrier_ActorDeleted.ftl index 5e131c4..62b69a2 100644 --- a/RFXtoRP_HsaCarrier_ActorDeleted.ftl +++ b/RFXtoRP_HsaCarrier_ActorDeleted.ftl @@ -1,12 +1,14 @@ +<#include "ReflexUtils.ftl"> +<#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${carrier.carrier_code?trim?json_string}" + "RefID": "${RFXtoRPprefixCarrier(carrier.carrier_code?trim?json_string)}" }, - "Payload": {} } ] diff --git a/RFXtoRP_HsaCons.ftl b/RFXtoRP_HsaCons.ftl index 1c7b34b..8932eb4 100644 --- a/RFXtoRP_HsaCons.ftl +++ b/RFXtoRP_HsaCons.ftl @@ -3,7 +3,7 @@ <#-- project : projectId in ReflexPlatform --> <#-- organisation : organisationtId in ReflexPlatform --> -<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign projectRP = project> <#assign organisationRP = organisation> @@ -14,33 +14,33 @@ <#case "U"> <#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign actor = JsonUtil.jsonToMap(dataRfx)> - [ + <#assign actor = JsonUtil.jsonToMap(dataRfx)> + [ { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaCons_ActorCreated.ftl"> + "datas" : + <#include "RFXtoRP_HsaCons_ActorCreated.ftl"> } - ] + ] <#break> - + <#case "D"> <#-- *********************************************** Action = DELETE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign actor = JsonUtil.jsonToMap(dataRfx)> - [ + <#assign actor = JsonUtil.jsonToMap(dataRfx)> + [ { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaCons_ActorDeleted.ftl"> + "datas" : + <#include "RFXtoRP_HsaCons_ActorDeleted.ftl"> } - ] + ] <#break> - - + + <#default> - <#stop "event not supported"> + <#stop > diff --git a/RFXtoRP_HsaCons_ActorCreated.ftl b/RFXtoRP_HsaCons_ActorCreated.ftl index e317219..84df17a 100644 --- a/RFXtoRP_HsaCons_ActorCreated.ftl +++ b/RFXtoRP_HsaCons_ActorCreated.ftl @@ -1,12 +1,14 @@ +<#include "ReflexUtils.ftl"> +<#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${actor.code?trim?json_string}" + "RefID": "${RFXtoRPprefixConsignee(actor.code?trim?json_string)}" }, - "Payload": { "Name": "${actor.designation?json_string}", "ManagedStock": false, @@ -14,9 +16,9 @@ <#-- ***Partner ID could be added here *** --> <#-- "PartnerID": "${}", --> - <#-- + <#include "RFXtoRP_HsaCons_ActorCreated_Metadata.ftl">, - --> + "Address": { @@ -31,7 +33,7 @@ "City" : "${actor.consignee_structured_address.post_code_area_name?json_string}", <#assign isCountryCode = JsonUtil.isCountryCode(actor.consignee_structured_address.country_code?upper_case) /> <#if isCountryCode> - "CountryCode" : "${actor.consignee_structured_address.country_code?upper_case?json_string}", + "CountryCode" : "${actor.consignee_structured_address.country_code?upper_case?json_string}", <#else> "CountryCode" : "", @@ -46,7 +48,7 @@ "StreetAddressOne" : "${actor.address.address_1?json_string}", "StreetAddressTwo" : "${actor.address.address_2?json_string}", "StreetAddressThree" : "${actor.address.address_3?json_string}", - "CountryCode" : "" + "CountryCode" : "" }, diff --git a/RFXtoRP_HsaCons_ActorDeleted.ftl b/RFXtoRP_HsaCons_ActorDeleted.ftl index 6fbfb45..89d4fce 100644 --- a/RFXtoRP_HsaCons_ActorDeleted.ftl +++ b/RFXtoRP_HsaCons_ActorDeleted.ftl @@ -1,12 +1,14 @@ +<#include "ReflexUtils.ftl"> +<#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${actor.code?trim?json_string}" + "RefID": "${RFXtoRPprefixConsignee(actor.code?trim?json_string)}" }, - "Payload": {} } ] diff --git a/RFXtoRP_HsaDispute.ftl b/RFXtoRP_HsaDispute.ftl new file mode 100644 index 0000000..18ea1ec --- /dev/null +++ b/RFXtoRP_HsaDispute.ftl @@ -0,0 +1,47 @@ +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + +<#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 dispute = JsonUtil.jsonToMap(dataRfx)> + [ + <#if dispute.dispute_closed == true > + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ClaimCreated> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaDispute_Created.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ClaimMessageSent> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsaDispute_MessageSent.ftl"> + } + <#else> + <#stop> + + ] + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE ******************** --> + <#stop> + <#break> + + + <#default> + <#stop> + + diff --git a/RFXtoRP_HsaDispute_Created.ftl b/RFXtoRP_HsaDispute_Created.ftl new file mode 100644 index 0000000..c85da89 --- /dev/null +++ b/RFXtoRP_HsaDispute_Created.ftl @@ -0,0 +1,70 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +<#include "Table.ftl"> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if dispute.dispute_preparation??> + <#if dispute.dispute_preparation.preparation_order_list?? && dispute.dispute_preparation.preparation_order_list?size != 0> + "RefID": "${dispute.dispute_preparation.preparation_physical_depot_code?replace(" ","")?json_string}${dispute.dispute_preparation.preparation_activity_code?replace(" ","")?json_string}${dispute.dispute_preparation.preparation_order_list[0].preparation_order_contractor_code?replace(" ","")?json_string}${dispute.dispute_year_number?replace(" ","")?json_string}${dispute.dispute_number?replace(" ","")?json_string}" + <#else> + <#stop "preparation order list is empty" > + + <#else> + <#if dispute.dispute_reception??> + "RefID": "${dispute.dispute_reception.reception_physical_depot_code?replace(" ","")?json_string}${dispute.dispute_reception.reception_activity_code?replace(" ","")?json_string}${dispute.dispute_reception.reception_contractor_code?replace(" ","")?json_string}${dispute.dispute_year_number?replace(" ","")?json_string}${dispute.dispute_number?replace(" ","")?json_string}" + + + }, + "Payload": { + <#if dispute.dispute_reference?? && dispute.dispute_reference!=""> + "Title":"${dispute.dispute_reference?trim?json_string}", + <#else> + "Title":"", + + "Criticality":"${TableCriticality[dispute.dispute_criticity]}", + "Amount": { + <#assign isCurrencyCode = JsonUtil.isCurrencyCode(dispute.dispute_amount_unit?upper_case) /> + <#if isCurrencyCode> + "Currency" : "${dispute.dispute_amount_unit?upper_case?json_string}", + <#else> + <#if TableAmount[dispute.dispute_amount_unit?json_string]??> + "Currency" : "${TableAmount[dispute.dispute_amount_unit?json_string]}", + <#else> + "Currency" : "XXX", + + + "Value": "${dispute.dispute_amount}" + }, + <#if dispute.dispute_type_code=="050" > + <#if dispute.dispute_preparation.preparation_order_list?? && dispute.dispute_preparation.preparation_order_list?size != 0> + "EntityID":"${dispute.dispute_preparation.preparation_order_list[0].preparation_order_contractor_reference?trim?json_string}", + <#else> + <#stop "preparation order list is empty" > + + <#else> + <#if dispute.dispute_type_code=="070" || dispute.dispute_type_code=="030" > + "EntityID":"${dispute.dispute_reception.reception_reference?trim?json_string}", + <#else> + <#stop "Type not supported" > + + + <#-- To configure --> + <#include "RFXtoRP_HsaDispute_TableReasonCodeToClaimTypeID.ftl"> + + <#if TableReasonCode[dispute.dispute_reason_code]??> + "ClaimTypeID":"${TableReasonCode[dispute.dispute_reason_code]}" + <#else> + <#stop "Claim reason code not supported" > + + + + } + } +] + + + diff --git a/RFXtoRP_HsaDispute_MessageSent.ftl b/RFXtoRP_HsaDispute_MessageSent.ftl new file mode 100644 index 0000000..6b59ba0 --- /dev/null +++ b/RFXtoRP_HsaDispute_MessageSent.ftl @@ -0,0 +1,124 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if dispute.dispute_preparation??> + <#if dispute.dispute_preparation.preparation_order_list?? && dispute.dispute_preparation.preparation_order_list?size != 0> + "RefID": "${dispute.dispute_preparation.preparation_physical_depot_code?replace(" ","")?json_string}${dispute.dispute_preparation.preparation_activity_code?replace(" ","")?json_string}${dispute.dispute_preparation.preparation_order_list[0].preparation_order_contractor_code?replace(" ","")?json_string}${dispute.dispute_year_number?replace(" ","")?json_string}${dispute.dispute_number?replace(" ","")?json_string}" + <#else> + <#stop "preparation order list is empty" > + + <#else> + <#if dispute.dispute_reception??> + "RefID": "${dispute.dispute_reception.reception_physical_depot_code?replace(" ","")?json_string}${dispute.dispute_reception.reception_activity_code?replace(" ","")?json_string}${dispute.dispute_reception.reception_contractor_code?replace(" ","")?json_string}${dispute.dispute_year_number?replace(" ","")?json_string}${dispute.dispute_number?replace(" ","")?json_string}" + + + }, + "Payload": { + + <#if dispute.dispute_preparation??> + "Message": "${dispute.dispute_reference?trim?json_string}" + <#else> + <#if dispute.dispute_reception??> + "Message": "${dispute.dispute_reception.reception_reference?trim?json_string}" + + + + } + }, + <#if dispute.dispute_quantity!=0 && dispute.dispute_item??> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if dispute.dispute_preparation??> + <#if dispute.dispute_preparation.preparation_order_list?? && dispute.dispute_preparation.preparation_order_list?size != 0> + "RefID": "${dispute.dispute_preparation.preparation_physical_depot_code?replace(" ","")?json_string}${dispute.dispute_preparation.preparation_activity_code?replace(" ","")?json_string}${dispute.dispute_preparation.preparation_order_list[0].preparation_order_contractor_code?replace(" ","")?json_string}${dispute.dispute_year_number?replace(" ","")?json_string}${dispute.dispute_number?replace(" ","")?json_string}" + <#else> + <#stop "preparation order list is empty" > + + <#else> + <#if dispute.dispute_reception??> + "RefID": "${dispute.dispute_reception.reception_physical_depot_code?replace(" ","")?json_string}${dispute.dispute_reception.reception_activity_code?replace(" ","")?json_string}${dispute.dispute_reception.reception_contractor_code?replace(" ","")?json_string}${dispute.dispute_year_number?replace(" ","")?json_string}${dispute.dispute_number?replace(" ","")?json_string}" + + + }, + "Payload": { + "Message": "${dispute.dispute_item.item_code?trim?json_string} - ${dispute.dispute_quantity}${dispute.dispute_quantity_unit}" + } + }, + <#elseif dispute.dispute_item??> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if dispute.dispute_preparation??> + <#if dispute.dispute_preparation.preparation_order_list?? && dispute.dispute_preparation.preparation_order_list?size != 0> + "RefID": "${dispute.dispute_preparation.preparation_physical_depot_code?replace(" ","")?json_string}${dispute.dispute_preparation.preparation_activity_code?replace(" ","")?json_string}${dispute.dispute_preparation.preparation_order_list[0].preparation_order_contractor_code?replace(" ","")?json_string}${dispute.dispute_year_number?replace(" ","")?json_string}${dispute.dispute_number?replace(" ","")?json_string}" + <#else> + <#stop "preparation order list is empty" > + + <#else> + <#if dispute.dispute_reception??> + "RefID": "${dispute.dispute_reception.reception_physical_depot_code?replace(" ","")?json_string}${dispute.dispute_reception.reception_activity_code?replace(" ","")?json_string}${dispute.dispute_reception.reception_contractor_code?replace(" ","")?json_string}${dispute.dispute_year_number?replace(" ","")?json_string}${dispute.dispute_number?replace(" ","")?json_string}" + + + }, + "Payload": { + "Message": "${dispute.dispute_item.item_code?trim?json_string}" + } + }, + <#elseif dispute.dispute_quantity!=0> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if dispute.dispute_preparation??> + <#if dispute.dispute_preparation.preparation_order_list?? && dispute.dispute_preparation.preparation_order_list?size != 0> + "RefID": "${dispute.dispute_preparation.preparation_physical_depot_code?replace(" ","")?json_string}${dispute.dispute_preparation.preparation_activity_code?replace(" ","")?json_string}${dispute.dispute_preparation.preparation_order_list[0].preparation_order_contractor_code?replace(" ","")?json_string}${dispute.dispute_year_number?replace(" ","")?json_string}${dispute.dispute_number?replace(" ","")?json_string}" + <#else> + <#stop "preparation order list is empty" > + + <#else> + <#if dispute.dispute_reception??> + "RefID": "${dispute.dispute_reception.reception_physical_depot_code?replace(" ","")?json_string}${dispute.dispute_reception.reception_activity_code?replace(" ","")?json_string}${dispute.dispute_reception.reception_contractor_code?replace(" ","")?json_string}${dispute.dispute_year_number?replace(" ","")?json_string}${dispute.dispute_number?replace(" ","")?json_string}" + + + }, + "Payload": { + "Message": "${dispute.dispute_quantity}${dispute.dispute_quantity_unit}" + } + }, + + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if dispute.dispute_preparation??> + <#if dispute.dispute_preparation.preparation_order_list?? && dispute.dispute_preparation.preparation_order_list?size != 0> + "RefID": "${dispute.dispute_preparation.preparation_physical_depot_code?replace(" ","")?json_string}${dispute.dispute_preparation.preparation_activity_code?replace(" ","")?json_string}${dispute.dispute_preparation.preparation_order_list[0].preparation_order_contractor_code?replace(" ","")?json_string}${dispute.dispute_year_number?replace(" ","")?json_string}${dispute.dispute_number?replace(" ","")?json_string}" + <#else> + <#stop "preparation order list is empty" > + + <#else> + <#if dispute.dispute_reception??> + "RefID": "${dispute.dispute_reception.reception_physical_depot_code?replace(" ","")?json_string}${dispute.dispute_reception.reception_activity_code?replace(" ","")?json_string}${dispute.dispute_reception.reception_contractor_code?replace(" ","")?json_string}${dispute.dispute_year_number?replace(" ","")?json_string}${dispute.dispute_number?replace(" ","")?json_string}" + + + }, + "Payload": { + + "Message": " ${dispute.dispute_description?trim?json_string}" + + } + } + +] \ No newline at end of file diff --git a/RFXtoRP_HsaDispute_TableReasonCodeToClaimTypeID.ftl b/RFXtoRP_HsaDispute_TableReasonCodeToClaimTypeID.ftl new file mode 100644 index 0000000..9b2f13a --- /dev/null +++ b/RFXtoRP_HsaDispute_TableReasonCodeToClaimTypeID.ftl @@ -0,0 +1,7 @@ +<#-- Specify table for reason code --> +<#assign TableReasonCode = {}/> + + + + + diff --git a/RFXtoRP_HsaIpgMove.ftl b/RFXtoRP_HsaIpgMove.ftl index 18a4a46..0582ada 100644 --- a/RFXtoRP_HsaIpgMove.ftl +++ b/RFXtoRP_HsaIpgMove.ftl @@ -28,7 +28,10 @@ reflexMvtStockInterface.ipg_move_type == "370" || reflexMvtStockInterface.ipg_move_type == "400" || reflexMvtStockInterface.ipg_move_type == "410" || - reflexMvtStockInterface.ipg_move_type == "420" + reflexMvtStockInterface.ipg_move_type == "420" || + reflexMvtStockInterface.ipg_move_type == "455" || + reflexMvtStockInterface.ipg_move_type == "460" || + reflexMvtStockInterface.ipg_move_type == "465" > [ { @@ -68,11 +71,11 @@ <#case "D"> <#-- *********************************************** Action = DELETE ******************** --> - <#stop "event not supported - Case D "> + <#stop > <#break> <#default> - <#stop "event not supported"> + <#stop> diff --git a/RFXtoRP_HsaIpgMove_GoodsReceived.ftl b/RFXtoRP_HsaIpgMove_GoodsReceived.ftl index c74a760..8653828 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 /> @@ -29,13 +30,14 @@ <#-- Goods received Segmentation Keys inclusion --> <#include "RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl"> }, + <#if reflexMvtStockInterface.receipt_reference!=""> "ExecutionflowID": "${reflexMvtStockInterface.receipt_reference?trim?json_string}", <#else> "ExecutionflowID": "${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.ipg_move_year_number}${reflexMvtStockInterface.extended_ipg_move_number}", "LineID": "${reflexMvtStockInterface.receipt_line_number}", - "ActorID": "${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_GoodsReceived_SegmentationKeys.ftl b/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl index bee18d4..4fa3d1d 100644 --- a/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl +++ b/RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl @@ -18,21 +18,21 @@ "Value": { "String" : "no batch"} <#else> "Value": { "String" : "${reflexMvtStockInterface.batch_1}"} - + }, { "Key": "HeldForSpecificCode", "Value": { "Bool" : "${reflexMvtStockInterface.ipg_specific_code_held}"} }, - + { - <#assign manufacturing_date = reflexMvtStockInterface.manufacture_date?datetime(rfx_date_format_default)?iso_utc /> + <#assign manufacturing_date = reflexMvtStockInterface.manufacture_date?datetime(rfx_date_format_default)?iso_utc /> "Key": "ManufacturingDate", "Value": "Timestamp": { "AuthorTimeZone": "${time_zone_rfx}", "DateTime": "${manufacturing_date}" } - } + } ] --> diff --git a/RFXtoRP_HsaIpgMove_StockMoved.ftl b/RFXtoRP_HsaIpgMove_StockMoved.ftl index bbc1677..f45d3c1 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", @@ -14,10 +15,13 @@ "370":"STOCK_MOVEMENT_TYPE_USE_OF_GOODS", "400":"STOCK_MOVEMENT_TYPE_FIX", "410":"STOCK_MOVEMENT_TYPE_FIX", - "420":"STOCK_MOVEMENT_TYPE_REQUALIFICATION"}> + "420":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", + "455":"STOCK_MOVEMENT_TYPE_FIX", + "460":"STOCK_MOVEMENT_TYPE_FIX", + "465":"STOCK_MOVEMENT_TYPE_FIX" + }> <#assign generation_date = RfxDateTimetoUTC(reflexMvtStockInterface.ipg_move_creation_datetime,time_zone_offset_rfx) /> <#assign ipg_priority_datetime = reflexMvtStockInterface.ipg_priority_date?datetime(rfx_date_format_default)?iso_utc /> - [ { "Header": { @@ -38,7 +42,7 @@ "LVBranchID": "${reflexMvtStockInterface.lv_code?json_string}" }, - "ActorID": "${reflexMvtStockInterface.physical_depot_code?trim?json_string}", + "ActorID": "${RFXtoRPprefixDepot(reflexMvtStockInterface.physical_depot_code?trim?json_string)}", "Movement": { "DateTime": { diff --git a/RFXtoRP_HsaItm.ftl b/RFXtoRP_HsaItm.ftl index d495402..66effc7 100644 --- a/RFXtoRP_HsaItm.ftl +++ b/RFXtoRP_HsaItm.ftl @@ -3,7 +3,7 @@ <#-- project : projectId in ReflexPlatform --> <#-- organisation : organisationtId in ReflexPlatform --> -<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign projectRP = project> <#assign organisationRP = organisation> @@ -15,37 +15,37 @@ <#case "U"> <#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign item = JsonUtil.jsonToMap(dataRfx)> - [ + <#assign item = JsonUtil.jsonToMap(dataRfx)> + [ { <#if item.logistical_variant_list?? > - <#assign apiReflexPlatformID = ApiReflexPlatformID.ItemCreated> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ItemCreated> "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaItm_ItemCreated.ftl"> + "datas" : + <#include "RFXtoRP_HsaItm_ItemCreated.ftl"> <#else> <#stop "no LV for the item"> } ] <#break> - + <#case "D"> <#-- *********************************************** Action = DELETE ******************************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign item = JsonUtil.jsonToMap(dataRfx)> - [ + <#assign item = JsonUtil.jsonToMap(dataRfx)> + [ { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ItemDeleted> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ItemDeleted> "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaItm_ItemDeleted.ftl"> + "datas" : + <#include "RFXtoRP_HsaItm_ItemDeleted.ftl"> } - ] + ] <#break> - - + + <#default> - <#stop "event not supported"> + <#stop > diff --git a/RFXtoRP_HsaItmLv.ftl b/RFXtoRP_HsaItmLv.ftl index 2b91ca2..4b914aa 100644 --- a/RFXtoRP_HsaItmLv.ftl +++ b/RFXtoRP_HsaItmLv.ftl @@ -3,7 +3,7 @@ <#-- project : projectId in ReflexPlatform --> <#-- organisation : organisationtId in ReflexPlatform --> -<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign projectRP = project> <#assign organisationRP = organisation> @@ -15,31 +15,31 @@ <#case "U"> <#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign lv = JsonUtil.jsonToMap(dataRfx)> - [ + <#assign lv = JsonUtil.jsonToMap(dataRfx)> + [ { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ItemLogisticVariantUpdated> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ItemLogisticVariantUpdated> "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl"> + "datas" : + <#include "RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl"> } - ] + ] <#break> - + <#case "D"> <#-- *********************************************** Action = DELETE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign lv = JsonUtil.jsonToMap(dataRfx)> - [ + <#assign lv = JsonUtil.jsonToMap(dataRfx)> + [ { <#assign apiReflexPlatformID = ApiReflexPlatformID.ItemLogisticVariantRemoved> "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl"> + "datas" : + <#include "RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl"> } - ] - <#break> + ] + <#break> <#default> - <#stop "event not supported"> + <#stop > diff --git a/RFXtoRP_HsaItm_ItemCreated.ftl b/RFXtoRP_HsaItm_ItemCreated.ftl index a8ce5c9..c2d33a9 100644 --- a/RFXtoRP_HsaItm_ItemCreated.ftl +++ b/RFXtoRP_HsaItm_ItemCreated.ftl @@ -24,7 +24,9 @@ <#include "RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl">, <#-- Item Photo URI could be added here --> - <#--"PhotoURI": " ", --> + <#if item.url?? && item.url!=""> + "PhotoURI": "${item.url?json_string}", + <#-- Loop for the Logistical Variants - LV --> <#if item.logistical_variant_list??> diff --git a/RFXtoRP_HsaLstCarSta.ftl b/RFXtoRP_HsaLstCarSta.ftl new file mode 100644 index 0000000..635e62b --- /dev/null +++ b/RFXtoRP_HsaLstCarSta.ftl @@ -0,0 +1,40 @@ +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#stop> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign depot = JsonUtil.jsonToMap(dataRfx)> + [ + { + + } + ] + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE *************************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign depot = JsonUtil.jsonToMap(dataRfx)> + [ + { + + } + ] + <#break> + + <#default> + <#stop > + \ No newline at end of file diff --git a/RFXtoRP_HsaProStatus.ftl b/RFXtoRP_HsaProStatus.ftl index 99a4993..87d072c 100644 --- a/RFXtoRP_HsaProStatus.ftl +++ b/RFXtoRP_HsaProStatus.ftl @@ -72,10 +72,10 @@ <#case "D"> <#-- *********************************************** Action = DELETE ******************** --> - <#stop "event not supported (case D)"> + <#stop > <#break> <#default> - <#stop "event not supported"> + <#stop > diff --git a/RFXtoRP_HsaSup.ftl b/RFXtoRP_HsaSup.ftl index 52fe20f..7250b4e 100644 --- a/RFXtoRP_HsaSup.ftl +++ b/RFXtoRP_HsaSup.ftl @@ -3,7 +3,7 @@ <#-- project : projectId in ReflexPlatform --> <#-- organisation : organisationtId in ReflexPlatform --> -<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign projectRP = project> <#assign organisationRP = organisation> @@ -14,33 +14,33 @@ <#case "U"> <#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign actor = JsonUtil.jsonToMap(dataRfx)> - [ + <#assign actor = JsonUtil.jsonToMap(dataRfx)> + [ { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaSup_ActorCreated.ftl"> + "datas" : + <#include "RFXtoRP_HsaSup_ActorCreated.ftl"> } - ] + ] <#break> - + <#case "D"> <#-- *********************************************** Action = DELETE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign actor = JsonUtil.jsonToMap(dataRfx)> - [ + <#assign actor = JsonUtil.jsonToMap(dataRfx)> + [ { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsaSup_ActorDeleted.ftl"> + "datas" : + <#include "RFXtoRP_HsaSup_ActorDeleted.ftl"> } - ] + ] <#break> - - + + <#default> - <#stop "event not supported"> + <#stop > diff --git a/RFXtoRP_HsaSup_ActorCreated.ftl b/RFXtoRP_HsaSup_ActorCreated.ftl index 4a48aec..23a560c 100644 --- a/RFXtoRP_HsaSup_ActorCreated.ftl +++ b/RFXtoRP_HsaSup_ActorCreated.ftl @@ -1,12 +1,14 @@ +<#include "ReflexUtils.ftl"> +<#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${actor.code?trim?json_string}" + "RefID": "${RFXtoRPprefixSupplier(actor.code?trim?json_string)}" }, - "Payload": { "Name": "${actor.designation?json_string}", "ManagedStock": false, @@ -14,9 +16,7 @@ <#-- ***Partner ID could be added here *** --> <#-- "PartnerID": "${}", --> - <#-- <#include "RFXtoRP_HsaSup_ActorCreated_Metadata.ftl">, - --> "Address": { @@ -31,7 +31,7 @@ <#assign isCountryCode = JsonUtil.isCountryCode(actor.supplier_structured_address.country_code?upper_case) /> <#if isCountryCode> "CountryCode" : "${actor.supplier_structured_address.country_code?upper_case?json_string}", - <#else> + <#else> "CountryCode" : "", "ProvinceCode": "${actor.supplier_structured_address.territorial_div_code?json_string}", @@ -44,7 +44,7 @@ "StreetAddressOne" : "${actor.optional_attributes.address_1?json_string}", "StreetAddressTwo" : "${actor.optional_attributes.address_2?json_string}", "StreetAddressThree" : "${actor.optional_attributes.address_3?json_string}", - "CountryCode" : "" + "CountryCode" : "" diff --git a/RFXtoRP_HsaSup_ActorDeleted.ftl b/RFXtoRP_HsaSup_ActorDeleted.ftl index 6fbfb45..9c00b09 100644 --- a/RFXtoRP_HsaSup_ActorDeleted.ftl +++ b/RFXtoRP_HsaSup_ActorDeleted.ftl @@ -1,12 +1,14 @@ +<#include "ReflexUtils.ftl"> +<#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${actor.code?trim?json_string}" + "RefID": "${RFXtoRPprefixSupplier(actor.code?trim?json_string)}" }, - "Payload": {} } ] diff --git a/RFXtoRP_HsrCarrierApt.ftl b/RFXtoRP_HsrCarrierApt.ftl new file mode 100644 index 0000000..635e62b --- /dev/null +++ b/RFXtoRP_HsrCarrierApt.ftl @@ -0,0 +1,40 @@ +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#stop> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign depot = JsonUtil.jsonToMap(dataRfx)> + [ + { + + } + ] + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE *************************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign depot = JsonUtil.jsonToMap(dataRfx)> + [ + { + + } + ] + <#break> + + <#default> + <#stop > + \ No newline at end of file diff --git a/RFXtoRP_HsrDepot.ftl b/RFXtoRP_HsrDepot.ftl index 08a4082..cd822b3 100644 --- a/RFXtoRP_HsrDepot.ftl +++ b/RFXtoRP_HsrDepot.ftl @@ -3,7 +3,7 @@ <#-- project : projectId in ReflexPlatform --> <#-- organisation : organisationtId in ReflexPlatform --> -<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign projectRP = project> <#assign organisationRP = organisation> @@ -14,33 +14,33 @@ <#case "U"> <#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign depot = JsonUtil.jsonToMap(dataRfx)> - [ + <#assign depot = JsonUtil.jsonToMap(dataRfx)> + [ { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated> "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrDepot_ActorCreated.ftl"> + "datas" : + <#include "RFXtoRP_HsrDepot_ActorCreated.ftl"> } - ] + ] <#break> - + <#case "D"> <#-- *********************************************** Action = DELETE *************************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign depot = JsonUtil.jsonToMap(dataRfx)> - [ + <#assign depot = JsonUtil.jsonToMap(dataRfx)> + [ { - <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> + <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted> "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrDepot_ActorDeleted.ftl"> + "datas" : + <#include "RFXtoRP_HsrDepot_ActorDeleted.ftl"> } - ] + ] <#break> - - + + <#default> - <#stop "event not supported"> + <#stop > diff --git a/RFXtoRP_HsrDepot_ActorCreated.ftl b/RFXtoRP_HsrDepot_ActorCreated.ftl index 86379b1..e64bb6b 100644 --- a/RFXtoRP_HsrDepot_ActorCreated.ftl +++ b/RFXtoRP_HsrDepot_ActorCreated.ftl @@ -1,12 +1,14 @@ +<#include "ReflexUtils.ftl"> +<#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${depot.physical_depot_code?trim?json_string}" + "RefID": "${RFXtoRPprefixDepot(depot.physical_depot_code?trim?json_string)}" }, - "Payload": { "Name": "${depot.physical_depot_designation?json_string}", "ManagedStock": true, @@ -14,9 +16,9 @@ <#-- ***Partner ID could be added here *** --> <#-- "PartnerID": "${}", --> - <#-- + <#include "RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl">, - --> + "Address": { @@ -39,17 +41,20 @@ <#-- if Reflex WMS address is not structured --> <#else> + <#if depot.physical_depot_address??> "Name": "${depot.physical_depot_address.company_name?json_string}", "StreetAddressOne" : "${depot.physical_depot_address.address_1?json_string}", "StreetAddressTwo" : "${depot.physical_depot_address.address_2?json_string}", "StreetAddressThree" : "${depot.physical_depot_address.address_3?json_string}", - "CountryCode" : "" + "CountryCode" : "" + - }, - "Phones": ["${depot.physical_depot_address.telephone?json_string}", - "${depot.physical_depot_address.other_number?json_string}" - ], + <#if depot.physical_depot_address??> + "Phones": ["${depot.physical_depot_address.telephone?json_string}", + "${depot.physical_depot_address.other_number?json_string}" + ], + "Typology": "TYPOLOGY_UNKNOWN" } } diff --git a/RFXtoRP_HsrDepot_ActorDeleted.ftl b/RFXtoRP_HsrDepot_ActorDeleted.ftl index d4e070a..2f59741 100644 --- a/RFXtoRP_HsrDepot_ActorDeleted.ftl +++ b/RFXtoRP_HsrDepot_ActorDeleted.ftl @@ -1,12 +1,14 @@ +<#include "ReflexUtils.ftl"> +<#include "HfRpConfig.ftl"> +<#include "ActorPrefix.ftl"> [ { "Header": { "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${depot.physical_depot_code?trim?json_string}" + "RefID": "${RFXtoRPprefixDepot(depot.physical_depot_code?trim?json_string)}" }, - "Payload": {} } ] diff --git a/RFXtoRP_HsrLoadInfo.ftl b/RFXtoRP_HsrLoadInfo.ftl new file mode 100644 index 0000000..635e62b --- /dev/null +++ b/RFXtoRP_HsrLoadInfo.ftl @@ -0,0 +1,40 @@ +<#-- **** input parameters ***** --> +<#-- input : message RFX --> +<#-- project : projectId in ReflexPlatform --> +<#-- organisation : organisationtId in ReflexPlatform --> + +<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> +<#assign projectRP = project> +<#assign organisationRP = organisation> + +<#assign aDateTime = .now> + +<#stop> + +<#switch cloudEventMsg.action> + <#case "C"> + <#case "U"> + <#-- *********************************************** Action = CREATE or UPDATE ******************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign depot = JsonUtil.jsonToMap(dataRfx)> + [ + { + + } + ] + <#break> + + <#case "D"> + <#-- *********************************************** Action = DELETE *************************** --> + <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> + <#assign depot = JsonUtil.jsonToMap(dataRfx)> + [ + { + + } + ] + <#break> + + <#default> + <#stop > + \ No newline at end of file diff --git a/RFXtoRP_HsrPrepa.ftl b/RFXtoRP_HsrPrepa.ftl index f7834cc..d9afb7f 100644 --- a/RFXtoRP_HsrPrepa.ftl +++ b/RFXtoRP_HsrPrepa.ftl @@ -50,20 +50,19 @@ <#assign refIDHmap ={}> <#assign hd_numberHmap ={}> + <#assign hd_numberHmapHUadded ={}> <#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> <#assign HUadded_packing_datetime = RfxDateTimetoUTC(preparation_line.confirmation_datetime,time_zone_offset_rfx) /> - <#if despatched_ipg.consignment_unit_id!=""> - <#if !hd_numberHmap[despatched_ipg.hd_number]?? > - <#assign hd_numberHmap += {despatched_ipg.hd_number,despatched_ipg.hd_number}> - , - { - <#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingHULabeled> - "apiReflexPlatformID" : "${apiReflexPlatformID}", - "datas" : - <#include "RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl"> - } - + <#if !hd_numberHmap[despatched_ipg.hd_number]?? > + <#assign hd_numberHmap += {despatched_ipg.hd_number,despatched_ipg.hd_number}> + , + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingHULabeled> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl"> + } <#if despatched_ipg.carton_number != "000000000000000000" && despatched_ipg.carton_number!=despatched_ipg.hd_number > , @@ -79,6 +78,17 @@ "datas" : <#include "RFXtoRP_HsrPrepa_HUsAdded_HandlingUnitDispatched.ftl"> } + <#if !hd_numberHmapHUadded[despatched_ipg.hd_number]??> + <#assign hd_numberHmapHUadded += {despatched_ipg.hd_number,despatched_ipg.hd_number}> + , + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingHULabeled> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrPrepa_HUsAdded_TrackingHuLabelled.ftl"> + } + + @@ -92,9 +102,9 @@ <#break> <#case "D"> <#-- *********************************************** Action = DELETE ******************** --> -<#stop "event not supported (Case D)"> +<#stop> <#break> <#default> -<#stop "event not supported"> +<#stop> \ No newline at end of file diff --git a/RFXtoRP_HsrPrepa_CarrierUpdated.ftl b/RFXtoRP_HsrPrepa_CarrierUpdated.ftl index ca87415..112037e 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,7 +19,7 @@ }, "Payload":{ "Carrier": { - "ActorID":"${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_GoodsPrepared_HandlingUnitMetadata.ftl b/RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl index 22d1c4d..9f6c877 100644 --- a/RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl +++ b/RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl @@ -2,8 +2,6 @@ <#-- "MetaData" :[ - - ] - +] --> "MetaData": [ ] \ No newline at end of file diff --git a/RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl b/RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl index e3a46d3..0d28cf4 100644 --- a/RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl +++ b/RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl @@ -15,7 +15,7 @@ "Value": { "String" : "no batch"} <#else> "Value": { "String" : "${despatched_ipg.batch_number}"} - + }, { "Key": "HeldForSpecificCode", @@ -24,15 +24,14 @@ <#else> "Value": { "Bool" : "False"} }, - { - <#assign manufacturing_date = despatched_ipg.ipg_manufacture_date?datetime(rfx_date_format_default)?iso_utc /> + <#assign manufacturing_date = despatched_ipg.ipg_manufacture_date?datetime(rfx_date_format_default)?iso_utc /> "Key": "ManufacturingDate", "Value": "Timestamp": { "AuthorTimeZone": "${time_zone_rfx}", "DateTime": "${manufacturing_date}" } - } + } ] diff --git a/RFXtoRP_HsrPrepa_HUsAdded_TrackingHuLabelled.ftl b/RFXtoRP_HsrPrepa_HUsAdded_TrackingHuLabelled.ftl new file mode 100644 index 0000000..f6c8deb --- /dev/null +++ b/RFXtoRP_HsrPrepa_HUsAdded_TrackingHuLabelled.ftl @@ -0,0 +1,27 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +<#include "ActorPrefix.ftl"> +[ +<#assign dispatched_datetime5 = RfxDateTimetoUTC(preparationOrder.stock_despatch_at_preparation_datetime,time_zone_offset_rfx) /> + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + "RefID":"${despatched_ipg.hd_number}", + "RefDate": { + "DateTime": "${dispatched_datetime5}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + "Payload": { + "HandlingunitID": "${despatched_ipg.hd_number}" + <#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_HsrPrepa_HandlingunitGoodsPrepared.ftl b/RFXtoRP_HsrPrepa_HandlingunitGoodsPrepared.ftl index b5e3f74..a8ff88b 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> @@ -74,7 +76,7 @@ "Goods": { "ItemID": "${preparation_line.item_code?trim?json_string}", "LVBranchID": "${preparation_line.item_lv_code?json_string}", - + <#if (despatched_ipg.ipg_use_by_date?length != 0) && (despatched_ipg.ipg_use_by_date?starts_with("00")== false)> <#assign priority_date = despatched_ipg.ipg_use_by_date?datetime(rfx_date_format_default)?iso_utc /> "PriorityDate": "${priority_date}", @@ -116,16 +118,15 @@ <#else> "LineID": "${preparation_line.pro_line_number!0}", - "ActorID": "${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 7a41e47..96a5905 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,7 +19,7 @@ }, "Payload":{ "Carrier": { - "ActorID":"${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 584a500..de29490 100644 --- a/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl +++ b/RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl @@ -1,5 +1,6 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> +<#include "ActorPrefix.ftl"> [ <#assign dispatched_datetime4 = RfxDateTimetoUTC(preparationOrder.stock_despatch_at_preparation_datetime,time_zone_offset_rfx) /> { @@ -7,11 +8,20 @@ "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${despatched_ipg.consignment_unit_id?trim?json_string}", + <#if despatched_ipg.consignment_unit_id!=""> + "RefID": "${despatched_ipg.consignment_unit_id?trim?json_string}", + <#else> + <#if despatched_ipg.carton_number != "000000000000000000"> + "RefID":"${despatched_ipg.carton_number}", + <#else> + "RefID":"${despatched_ipg.hd_number}", + + + "RefDate": { "DateTime": "${dispatched_datetime4}", "AuthorTimeZone": "${time_zone_rfx}" - } + } }, "Payload": { <#if despatched_ipg.carton_number != "000000000000000000"> @@ -22,9 +32,8 @@ <#if preparationOrder.load_data?? && preparationOrder.load_data.carrier_code?? && preparationOrder.load_data.carrier_code!="" > , "HUCarrier":{ - "ActorID": "${preparationOrder.load_data.carrier_code?json_string}" - } - + "ActorID": "${RFXtoRPprefixCarrier(preparationOrder.load_data.carrier_code?trim?json_string)}" + } } } diff --git a/RFXtoRP_HsrPro.ftl b/RFXtoRP_HsrPro.ftl index 3258db3..1ef9917 100644 --- a/RFXtoRP_HsrPro.ftl +++ b/RFXtoRP_HsrPro.ftl @@ -28,18 +28,18 @@ "datas" : <#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl"> } - <#else> - <#stop "preparation order already confirmed"> + <#else> + <#-- preparation order already confirmed --> + <#stop> <#else> - <#stop "preparation order type not supported"> + <#-- preparation order type not supported --> + <#stop> <#else> <#stop "PRO reference is empty"> - - ] <#break> @@ -63,6 +63,6 @@ <#default> - <#stop "event not supported"> + <#stop > diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl index a4d6321..53f554a 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,7 +27,7 @@ "CarrierService":"${preparation_order.transport_grade_code?trim?json_string}", --> "ShipFrom": { - "ActorID": "${preparation_order.physical_depot_code?trim?json_string}" + "ActorID": "${RFXtoRPprefixDepot(preparation_order.physical_depot_code?trim?json_string)}" }, "ShipFromAcked": true, "ShipTo": { @@ -48,7 +49,7 @@ preparation_order.address.territorial_division_code == "" && preparation_order.address.postal_code == "" && preparation_order.address.iso_country_code == ""> - "ActorID": "${preparation_order.end_consignee_code?trim?json_string}" + "ActorID": "${RFXtoRPprefixConsignee(preparation_order.end_consignee_code?json_string)}" <#else> "Actor": { @@ -89,7 +90,6 @@ <#-- Line Metadata inclusion --> <#include "RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl">, - "RequestedContent": { "Goods": @@ -100,10 +100,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" : { @@ -115,7 +113,6 @@ ], - "RequestedMilestones" : { "RequestedDeliveryDateTime" : diff --git a/RFXtoRP_HsrReceiptList.ftl b/RFXtoRP_HsrReceiptList.ftl index d25cd93..18279c7 100644 --- a/RFXtoRP_HsrReceiptList.ftl +++ b/RFXtoRP_HsrReceiptList.ftl @@ -98,6 +98,6 @@ <#default> - <#stop "event not supported"> + <#stop > diff --git a/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl b/RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl index d941559..b5568df 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) /> @@ -25,19 +26,21 @@ "ShipFrom": { - "ActorID": "${receipt.original_code?trim?json_string}" + "ActorID": "${RFXtoRPprefixSupplier(receipt.original_code?trim?json_string)}" }, "ShipTo" : { - "ActorID": "${receipt.physical_depot_code?trim?json_string}" + "ActorID": "${RFXtoRPprefixDepot(receipt.physical_depot_code?trim?json_string)}" }, "ShipToAcked": true, <#if receipt.carrier_informations.carrier_code != ""> - "Carrier" : {"ActorID": "${receipt.carrier_informations.carrier_code?trim?json_string}"}, + "Carrier": + { + "ActorID":"${RFXtoRPprefixCarrier(receipt.carrier_informations.carrier_code?trim?json_string)}" + }, - <#if receipt.line_list??> "Lines" : [ <#list receipt.line_list as line> diff --git a/RFXtoRP_PlatformLogCreate.ftl b/RFXtoRP_PlatformLogCreate.ftl index 9e657f1..f48b2b9 100644 --- a/RFXtoRP_PlatformLogCreate.ftl +++ b/RFXtoRP_PlatformLogCreate.ftl @@ -22,22 +22,21 @@ "AuthorTimeZone": "${time_zone_rfx}" }, "TechMessage": { - "Code": "${restResponsetMsg.status}", + "Code": "${restResponsetMsg.status!"no Code"}", "Label": ${strJsonBody} }, "UserMessage": { - "Code": "${restResponsetMsg.status}", + "Code": "${restResponsetMsg.status!"no Code"}", "Label": ${strJsonBody}, "Params": [] }, "DetailElements": [], - "CorrelationID": "${id.correlationid}", - "ContextPayload": "rfxresponse", + "CorrelationID": "${id.correlationid!"no Correlationid"}", + "ContextPayload": ${strJsonBody}, "Type": "RP_EXECUTIONFLOW_EVENT", - "Task": "${id.apiRestReflexID}", - "OriginalID": "${id.refid?trim?json_string}", + "Task": "${id.apiRestReflexID!"no Task"}", + "OriginalID": "${id.refid!"no OriginalID"?trim?json_string}", "StackTrace": "" } } -] - +] \ No newline at end of file diff --git a/RFXtoRP_RestResponse.ftl b/RFXtoRP_RestResponse.ftl index 69983ef..489cedb 100644 --- a/RFXtoRP_RestResponse.ftl +++ b/RFXtoRP_RestResponse.ftl @@ -4,16 +4,57 @@ <#-- organisation : organisationtId in ReflexPlatform --> <#assign restResponsetMsg = JsonUtil.jsonToMap(input)> -<#assign id = JsonUtil.jsonToMap(restResponsetMsg.id)> +<#assign id = JsonUtil.jsonToMap(restResponsetMsg.id!"{}")> <#assign projectRP = project> <#assign organisationRP = organisation> <#assign aDateTime = .now> +<#assign no_apiRestReflexID = "no apiRestReflexID"> +<#assign no_status = -99999> -<#switch id.apiRestReflexID> + +<#switch id.apiRestReflexID!no_apiRestReflexID> + <#case no_apiRestReflexID> + [ + { + <#if restResponsetMsg.body?? > + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#else> + <#assign restResponseBody = "${restResponsetMsg?trim?json_string}" /> + + <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_PlatformLogCreate.ftl"> + } + ] + <#break> + <#case "preparation_orders_post"> - <#switch restResponsetMsg.status> + <#switch restResponsetMsg.status!no_status> + <#case no_status> + [ + { + <#if restResponsetMsg.body?? > + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#else> + <#assign restResponseBody = "${restResponsetMsg?trim?json_string}" /> + + <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAllocationError.ftl"> + } + ] + <#break> + <#case 200> <#case 201> <#-- *********************************************** ApiRestID = preparation_orders_post ******************** --> @@ -63,7 +104,7 @@ <#if restResponsetMsg.body?? > <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#else> - <#assign restResponseBody = "{}" /> + <#assign restResponseBody = "${restResponsetMsg?trim?json_string}}" /> <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> "apiReflexPlatformID" : "${apiReflexPlatformID}", @@ -81,7 +122,29 @@ <#break> <#case "receipts_post"> - <#switch restResponsetMsg.status> + <#switch restResponsetMsg.status!no_status> + <#case no_status> + [ + { + <#if restResponsetMsg.body?? > + <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> + <#else> + <#assign restResponseBody = "${restResponsetMsg?trim?json_string}" /> + + <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_PlatformLogCreate.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_RestResponseAllocationError.ftl"> + } + ] + <#break> + <#case 200> <#case 201> <#-- *********************************************** ApiRestID = receipts_post ******************** --> @@ -121,7 +184,7 @@ <#if restResponsetMsg.body?? > <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#else> - <#assign restResponseBody = "{}" /> + <#assign restResponseBody = "${restResponsetMsg?trim?json_string}" /> <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> "apiReflexPlatformID" : "${apiReflexPlatformID}", @@ -137,7 +200,6 @@ ] <#break> - <#default> <#stop> diff --git a/RFXtoRP_RestResponseAllocationError.ftl b/RFXtoRP_RestResponseAllocationError.ftl index 56626f1..1a31357 100644 --- a/RFXtoRP_RestResponseAllocationError.ftl +++ b/RFXtoRP_RestResponseAllocationError.ftl @@ -7,7 +7,7 @@ "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${id.refid?trim?json_string}", + "RefID": "${id.refid!"no RefID"?trim?json_string}", "RefDate": { "DateTime": "${aDateTime?iso_utc}", "AuthorTimeZone": "${time_zone_rfx}" diff --git a/RFXtoRP_RfxConfigurationRp.ftl b/RFXtoRP_RfxConfigurationRp.ftl index 36b9cb8..d89dac8 100644 --- a/RFXtoRP_RfxConfigurationRp.ftl +++ b/RFXtoRP_RfxConfigurationRp.ftl @@ -4,40 +4,40 @@ <#noparse> <#-- if LVID is egal to **quantity_in_base_lv** keyword then LVID is egal to base VL of the item --> - <#assign quantity_in_base_lv_RP_Cst = "**quantity_in_base_lv**" > - <#assign rfx_date_format_default = "yyyy-MM-dd" > +<#assign quantity_in_base_lv_RP_Cst = "**quantity_in_base_lv**" > +<#assign rfx_date_format_default = "yyyy-MM-dd" > - <#assign length_unit_KV_rfx = {"MET":"MILLIMETER","CM":"CENTIMETER","MM":"METER","DM":"DECIMETER","KM":"KILOMETER","MIL":"MILE","YAR":"YARD","INC":"INCH","FT":"FOOT"}> - <#assign weight_unit_KV_rfx = {"GR":"GRAMME","DG":"DECIGRAM","KG":"KILOGRAM","TON":"TONNE","OCE":"ONCE","LTO":"LONG_TON","STO":"SHORT_TON","PND":"POUND"}> - <#assign area_unit_KV_rfx = {"MM²":"SQUARE_MILLIMETER","CM²":"SQUARE_CENTIMETER","DM²":"SQUARE_DECIMETER","M²":"SQUARE_METER","SQI":"SQUARE_INCH","SQF":"SQUARE_FOOT","SQY":"SQUARE_YARD"}> - <#assign volume_unit_KV_rfx = {"MM³":"CUBIC_MILLIMETER","CM³":"CUBIC_CENTIMETER","DM³":"CUBIC_DECIMETER","M³":"CUBIC_METER","CI":"CUBIC_INCH","CF":"CUBIC_FOOT","CY":"CUBIC_YARD","ML":"MILLI_LITER","CL":"CENTI_LITER","DL":"DECI_LITER","LIT":"LITER","HL":"HECTO_LITER","FT":"US_FLUID_OUNCE","USG":"US_GAL","PI":"IMPERIAL_PINT","GL":"IMPERIAL_GAL"}> +<#assign length_unit_KV_rfx = {"MET":"MILLIMETER","CM":"CENTIMETER","MM":"METER","DM":"DECIMETER","KM":"KILOMETER","MIL":"MILE","YAR":"YARD","INC":"INCH","FT":"FOOT"}> +<#assign weight_unit_KV_rfx = {"GR":"GRAMME","DG":"DECIGRAM","KG":"KILOGRAM","TON":"TONNE","OCE":"ONCE","LTO":"LONG_TON","STO":"SHORT_TON","PND":"POUND"}> +<#assign area_unit_KV_rfx = {"MM²":"SQUARE_MILLIMETER","CM²":"SQUARE_CENTIMETER","DM²":"SQUARE_DECIMETER","M²":"SQUARE_METER","SQI":"SQUARE_INCH","SQF":"SQUARE_FOOT","SQY":"SQUARE_YARD"}> +<#assign volume_unit_KV_rfx = {"MM³":"CUBIC_MILLIMETER","CM³":"CUBIC_CENTIMETER","DM³":"CUBIC_DECIMETER","M³":"CUBIC_METER","CI":"CUBIC_INCH","CF":"CUBIC_FOOT","CY":"CUBIC_YARD","ML":"MILLI_LITER","CL":"CENTI_LITER","DL":"DECI_LITER","LIT":"LITER","HL":"HECTO_LITER","FT":"US_FLUID_OUNCE","USG":"US_GAL","PI":"IMPERIAL_PINT","GL":"IMPERIAL_GAL"}> - + - <#noparse><#assign length_unit_rfx = length_unit_KV_rfx["${file.measurement_unit.length}"<#noparse>]!"CENTIMETER"> - <#noparse><#assign distance_unit_rfx = length_unit_KV_rfx["${file.measurement_unit.distance}"<#noparse>]!"CENTIMETER"> - <#noparse><#assign transport_distance_unit_rfx = length_unit_KV_rfx["${file.measurement_unit.transport_distance}"<#noparse>]!"CENTIMETER"> - <#noparse><#assign weight_unit_rfx = weight_unit_KV_rfx["${file.measurement_unit.weight}"<#noparse>]!"KILOGRAM"> - <#noparse><#assign area_unit_rfx = area_unit_KV_rfx["${file.measurement_unit.area}"<#noparse>]!"SQUARE_METER"> - <#noparse><#assign volume_unit_rfx = volume_unit_KV_rfx["${file.measurement_unit.volume}"<#noparse>]!"CUBIC_DECIMETER"> - <#noparse><#assign number_of_litres_unit_rfx = volume_unit_KV_rfx["${file.measurement_unit.litres_number}"<#noparse>]!"CUBIC_DECIMETER"> +<#noparse><#assign length_unit_rfx = length_unit_KV_rfx["${file.measurement_unit.length}"<#noparse>]!"CENTIMETER"> +<#noparse><#assign distance_unit_rfx = length_unit_KV_rfx["${file.measurement_unit.distance}"<#noparse>]!"CENTIMETER"> +<#noparse><#assign transport_distance_unit_rfx = length_unit_KV_rfx["${file.measurement_unit.transport_distance}"<#noparse>]!"CENTIMETER"> +<#noparse><#assign weight_unit_rfx = weight_unit_KV_rfx["${file.measurement_unit.weight}"<#noparse>]!"KILOGRAM"> +<#noparse><#assign area_unit_rfx = area_unit_KV_rfx["${file.measurement_unit.area}"<#noparse>]!"SQUARE_METER"> +<#noparse><#assign volume_unit_rfx = volume_unit_KV_rfx["${file.measurement_unit.volume}"<#noparse>]!"CUBIC_DECIMETER"> +<#noparse><#assign number_of_litres_unit_rfx = volume_unit_KV_rfx["${file.measurement_unit.litres_number}"<#noparse>]!"CUBIC_DECIMETER"> - <#noparse><#assign time_zone_rfx = "${file.author_time_zone!"UTC"}<#noparse>"> - <#noparse><#assign time_zone_offset_rfx = "${file.time_zone_offset!"+00:00"}<#noparse>"> +<#noparse><#assign time_zone_rfx = "${file.author_time_zone!"UTC"}<#noparse>"> +<#noparse><#assign time_zone_offset_rfx = "${file.time_zone_offset!"+00:00"}<#noparse>"> - <#list file.reflex_platform_project_list?filter(l -> l.name == projectRP) as reflex_platform_project> - <#noparse><#assign text_language_rfx = "${reflex_platform_project.text_language!"en"}<#noparse>"> +<#list file.reflex_platform_project_list?filter(l -> l.name == projectRP) as reflex_platform_project> +<#noparse><#assign text_language_rfx = "${reflex_platform_project.text_language!"en"}<#noparse>"> <#list file.reflex_platform_project_list?filter(j -> j.name == projectRP) as reflex_platform_project_uniqueness> <#if reflex_platform_project_uniqueness.site_code_unicity??> <#noparse><#assign uniqueness = ${reflex_platform_project_uniqueness.site_code_unicity?c}<#noparse>> <#else> - <#noparse><#assign uniqueness = false<#noparse>> +<#noparse><#assign uniqueness = false<#noparse>> diff --git a/RPtoRFX_ExecutionflowEvent.ftl b/RPtoRFX_ExecutionflowEvent.ftl index 95d8132..89519e8 100644 --- a/RPtoRFX_ExecutionflowEvent.ftl +++ b/RPtoRFX_ExecutionflowEvent.ftl @@ -5,7 +5,7 @@ <#include "HfRpConfig.ftl"> <#include "ReflexUtils.ftl"> -<#assign eventRP = JsonUtil.jsonToMap(input)> +<#assign eventRP = JsonUtil.jsonToMap(input)> <#assign projectRP = project> <#assign organisationRP = organisation> @@ -24,28 +24,28 @@ <#if executionflow.MetaData??> <#assign Header_MetaData_Map = JsonUtil.sequenceToMap(executionflow.MetaData, "Key", "Value") /> - - [ - <#if eventRP.partnerAppRole == "ShipFrom" && executionflow.ShipFrom.ActorID != "" && executionflow.ShipFrom.Actor.IsShipFromConnected?? && executionflow.ShipFrom.Actor.IsShipFromConnected> + + [ + <#if eventRP.partnerAppRole == "ShipFrom" && executionflow.ShipFrom.ActorID != "" && executionflow.ShipFrom.Actor.IsShipFromConnected?? && executionflow.ShipFrom.Actor.IsShipFromConnected> { - <#assign apiRestReflexID = ApiRestReflexID.preparation_orders_post> + <#assign apiRestReflexID = ApiRestReflexID.preparation_orders_post> "apiRestReflexID" : "${apiRestReflexID}", - "datas" : - <#include "RPtoRFX_PrepOrder.ftl"> + "datas" : + <#include "RPtoRFX_PrepOrder.ftl"> } - <#if eventRP.partnerAppRole == "ShipTo" && executionflow.ShipTo.ActorID != "" && executionflow.ShipTo.Actor.IsShipToConnected?? && executionflow.ShipTo.Actor.IsShipToConnected> + <#if eventRP.partnerAppRole == "ShipTo" && executionflow.ShipTo.ActorID != "" && executionflow.ShipTo.Actor.IsShipToConnected?? && executionflow.ShipTo.Actor.IsShipToConnected> { - <#assign apiRestReflexID = ApiRestReflexID.receipts_post> + <#assign apiRestReflexID = ApiRestReflexID.receipts_post> "apiRestReflexID" : "${apiRestReflexID}", - "datas" : - <#include "RPtoRFX_Receipt.ftl"> + "datas" : + <#include "RPtoRFX_Receipt.ftl"> } - ] + ] <#break> <#default> - <#stop "Event not processed"> + <#stop > diff --git a/RPtoRFX_PrepOrder.ftl b/RPtoRFX_PrepOrder.ftl index 074fefd..0debca9 100644 --- a/RPtoRFX_PrepOrder.ftl +++ b/RPtoRFX_PrepOrder.ftl @@ -1,4 +1,6 @@ <#include "RPtoRFX_PrepOrder_DefaultHeaderData.ftl"> +<#include "ActorPrefix.ftl"> +<#include "HfRpConfig.ftl"> <#-- Valeurs par défaut Adresse --> <#-- Default values --> <#assign typecode ="010"> @@ -9,7 +11,7 @@ <#-- If you are using unreferenced actors, you will need to create a "VIZ" consignee in Reflex WMS to use this feature --> <#assign defaultactor ="VIZ"> <#if executionflow.ShipTo.ActorID?? && executionflow.ShipTo.ActorID!=""> - <#assign actorID = executionflow.ShipTo.ActorID > + <#assign actorID = "${RPtoRFXprefixConsignee(executionflow.ShipTo.ActorID)}" > <#else> <#assign actorID = defaultactor > @@ -20,7 +22,7 @@ "method" : "POST", "uri_substitutions": { "activity_code": "${activity_code}", - "physical_depot_code": "${executionflow.ShipFrom.ActorID}", + "physical_depot_code": "${RPtoRFXprefixDepot(executionflow.ShipFrom.ActorID)}", "originator_code": "${originator_code}" }, "payload" : diff --git a/RPtoRFX_Receipt.ftl b/RPtoRFX_Receipt.ftl index 838293a..763cf12 100644 --- a/RPtoRFX_Receipt.ftl +++ b/RPtoRFX_Receipt.ftl @@ -1,4 +1,6 @@ <#include "RPtoRFX_Receipt_DefaultHeaderData.ftl"> +<#include "ActorPrefix.ftl"> +<#include "HfRpConfig.ftl"> { "id" : {"refid" : "${executionflow.OrderID?json_string}"}, @@ -6,7 +8,7 @@ "method" : "POST", "uri_substitutions": { "activity_code": "${activity_code}", - "physical_depot_code": "${executionflow.ShipTo.ActorID!""}", + "physical_depot_code": "${RPtoRFXprefixDepot(executionflow.ShipTo.ActorID!"")}", "originator_code": "${originator_code}" }, "payload" : @@ -15,8 +17,8 @@ "receipt_type": "${receipt_type}", "receipt_reason_code": "${receipt_reason_code}", "work_mode_code" : "${work_mode_code}", - "original_code" : "${executionflow.ShipFrom.ActorID}", - "carrier_code" : "${executionflow.Carrier.ActorID!""}", + "original_code" : "${RPtoRFXprefixSupplier(executionflow.ShipFrom.ActorID)}", + "carrier_code" : "${RPtoRFXprefixCarrier(executionflow.Carrier.ActorID!"")}", <#if executionflow.RequestedMilestones?? && executionflow.RequestedMilestones.RequestedDeliveryDateTime??> "receipt_datetime": "${DateTimeUTCtoRfxLocale(executionflow.RequestedMilestones.RequestedDeliveryDateTime.DateTime,time_zone_rfx)}", diff --git a/RPtoRFX_Receipt_DefaultLineData.ftl b/RPtoRFX_Receipt_DefaultLineData.ftl index 112da79..8c09d53 100644 --- a/RPtoRFX_Receipt_DefaultLineData.ftl +++ b/RPtoRFX_Receipt_DefaultLineData.ftl @@ -2,7 +2,7 @@ <#-- Note : you can use Order Line Segmentation keys, using the define map : SegmentationKeys_Map --> <#-- How to use MD or SK map - Example : + Example : <#assign owner_code = SegmentationKeys_Map["Owner"].String!""/> If your SK is : 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)> diff --git a/Table.ftl b/Table.ftl new file mode 100644 index 0000000..f9bce7b --- /dev/null +++ b/Table.ftl @@ -0,0 +1,15 @@ +<#-- Table criticality --> +<#assign TableCriticality = { + "1": "CLAIM_CRITICALITY_LOW", + "2":"CLAIM_CRITICALITY_MEDIUM", + "3":"CLAIM_CRITICALITY_HIGH", + "4":"CLAIM_CRITICALITY_BLOCKING" + }> + + <#-- Table Amount --> +<#assign TableAmount = { + "$": "USD", + "£":"GBP", + "DH":"MAD" + }> +