diff --git a/RFXtoRP_HsrPro.ftl b/RFXtoRP_HsrPro.ftl index 089092a..6f1864b 100644 --- a/RFXtoRP_HsrPro.ftl +++ b/RFXtoRP_HsrPro.ftl @@ -14,14 +14,14 @@ <#case "U"> <#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign order = JsonUtil.jsonToMap(dataRfx)> + <#assign preparation_order = JsonUtil.jsonToMap(dataRfx)> [ { <#-- check preparation type code (internal order and reservation are ignored) --> - <#if order.preparation_type_code == "010" || order.preparation_type_code == "030"> + <#if preparation_order.preparation_type_code == "010" || order.preparation_type_code == "030"> <#-- Only if preparation order not confirmed --> - <#if order.preparation_order_confirmed == "false" > + <#if preparation_order.preparation_order_confirmed == "false" > <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : @@ -41,7 +41,7 @@ <#case "D"> <#-- *********************************************** Action = DELETE ******************** --> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> - <#assign order = JsonUtil.jsonToMap(dataRfx)> + <#assign preparation_order = JsonUtil.jsonToMap(dataRfx)> [ { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> diff --git a/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl b/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl index bac9ea4..bb28371 100644 --- a/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowCancelled.ftl @@ -7,7 +7,7 @@ "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${order.originator_reference}", + "RefID": "${preparation_order.originator_reference}", "RefDate": { "DateTime": "${preparation_status_datetime}", "AuthorTimeZone": "${time_zone_rfx}" diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl index 353d997..3b3f258 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected.ftl @@ -2,13 +2,13 @@ <#include "ReflexUtils.ftl"> [ { - <#assign planned_final_delivery_start_datetime = RfxDateTimetoUTC(order.planned_final_delivery_start_datetime,time_zone_offset_rfx) /> - <#assign pro_creation_datetime = RfxDateTimetoUTC(order.creation_datetime,time_zone_offset_rfx) /> + <#assign planned_final_delivery_start_datetime = RfxDateTimetoUTC(preparation_order.planned_final_delivery_start_datetime,time_zone_offset_rfx) /> + <#assign pro_creation_datetime = RfxDateTimetoUTC(preparation_order.creation_datetime,time_zone_offset_rfx) /> "Header": { "ProjectID": "${projectRP}" }, "ID": { - "RefID": "${order.originator_reference}", + "RefID": "${preparation_order.originator_reference}", "RefDate": { "DateTime": "${pro_creation_datetime}", "AuthorTimeZone": "${time_zone_rfx}" @@ -23,45 +23,45 @@ <#include "RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl">, "ShipFrom": { - "ActorID": "${order.physical_depot_code}" + "ActorID": "${preparation_order.physical_depot_code}" }, "ShipFromAcked": true, "ShipTo": { - <#if order.address.type_code == "" && order.address.title_code == "" && order.address.first_name == "" && order.address.last_name == "" && order.address.mail_address == "" && order.address.contact_type_code == "" && order.address.mobile_phone_number == "" && order.address.land_line_phone_number == "" && order.address.fax_number == "" && order.address.address_type_code == "" && order.address.name_or_company_name == "" && order.address.additional_address_data_1 == "" && order.address.additional_address_data_2 == "" && order.address.post_code_area_name == "" && order.address.territorial_division_code == "" && order.address.postal_code == "" && order.address.iso_country_code == ""> - "ActorID": "${order.end_consignee_code}" + <#if preparation_order.address.type_code == "" && preparation_order.address.title_code == "" && preparation_order.address.first_name == "" && preparation_order.address.last_name == "" && preparation_order.address.mail_address == "" && preparation_order.address.contact_type_code == "" && preparation_order.address.mobile_phone_number == "" && preparation_order.address.land_line_phone_number == "" && preparation_order.address.fax_number == "" && preparation_order.address.address_type_code == "" && preparation_order.address.name_or_company_name == "" && preparation_order.address.additional_address_data_1 == "" && preparation_order.address.additional_address_data_2 == "" && preparation_order.address.post_code_area_name == "" && preparation_order.address.territorial_division_code == "" && preparation_order.address.postal_code == "" && preparation_order.address.iso_country_code == ""> + "ActorID": "${preparation_order.end_consignee_code}" <#else> "Actor": { - "Name" : "${order.address.name_or_company_name!""}", + "Name" : "${preparation_order.address.name_or_company_name!""}", "Address" : { - "City" : "${order.address.post_code_area_name!""}", - "CountryCode" : "${order.address.iso_country_code!""}", - "PostalCode" : "${order.address.postal_code!""}", - "StreetAddressOne" : "${order.address.street_and_number_and_po_box!""}", - "StreetAddressTwo" : "${order.address.additional_address_data_1!""}", - "StreetAddressThree" : "${order.address.additional_address_data_2!""}" + "City" : "${preparation_order.address.post_code_area_name!""}", + "CountryCode" : "${preparation_order.address.iso_country_code!""}", + "PostalCode" : "${preparation_order.address.postal_code!""}", + "StreetAddressOne" : "${preparation_order.address.street_and_number_and_po_box!""}", + "StreetAddressTwo" : "${preparation_order.address.additional_address_data_1!""}", + "StreetAddressThree" : "${preparation_order.address.additional_address_data_2!""}" } }, "Contact" : { - "FirstName" : "${order.address.first_name!""}", - "LastName" : "${order.address.last_name!""}", - "Emails" : ["${order.address.mail_address!""}"], - "Phones" : ["${order.address.mobile_phone_number!""}","${order.address.land_line_phone_number!""}", "${order.address.fax_number!""}" ] + "FirstName" : "${preparation_order.address.first_name!""}", + "LastName" : "${preparation_order.address.last_name!""}", + "Emails" : ["${preparation_order.address.mail_address!""}"], + "Phones" : ["${preparation_order.address.mobile_phone_number!""}","${preparation_order.address.land_line_phone_number!""}", "${preparation_order.address.fax_number!""}" ] } }, - <#if order.line_list??> + <#if preparation_order_line_list??> "Lines" : [ - <#list order.line_list as line> + <#list preparation_order_line_list > { - <#if (line.originator_reference_line_number!0) != 0> - "LineID": "${line.originator_reference_line_number}", + <#if (preparation_order_line_list.originator_reference_line_number!0) != 0> + "LineID": "${preparation_order_line_list.originator_reference_line_number}", <#else> - "LineID": "${line.preparation_order_line_number!0}", + "LineID": "${preparation_order_line_list.preparation_order_line_number!0}", <#-- Line Metadata inclusion --> <#include "RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl">, @@ -70,10 +70,10 @@ { "Goods": { - "ItemID": "${line.item_code!"0"}", - "LVBranchID": "${line.item_lv_code!"0"}", - <#if (line.optional_attributes.forced_priority_date?length != 0) && (line.optional_attributes.forced_priority_date?starts_with("00") == false)> - <#assign forced_priority_date = line.optional_attributes.forced_priority_date?datetime(rfx_date_format_default)?iso_utc /> + "ItemID": "${preparation_order_line_list.item_code!"0"}", + "LVBranchID": "${preparation_order_line_list.item_lv_code!"0"}", + <#if (preparation_order_line_list.optional_attributes.forced_priority_date?length != 0) && (preparation_order_line_list.optional_attributes.forced_priority_date?starts_with("00") == false)> + <#assign forced_priority_date = preparation_order_line_list.optional_attributes.forced_priority_date?datetime(rfx_date_format_default)?iso_utc /> "PriorityDate": "${forced_priority_date}", @@ -84,7 +84,7 @@ "Quantity" : { "LVID": "${quantity_in_base_lv_RP_Cst}", - "Value": "${line.base_lv_quantity_to_prepare!0}" + "Value": "${preparation_order_line_list.base_lv_quantity_to_prepare!0}" } } }<#sep>, diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl index 125bbd5..64a37f6 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl @@ -5,7 +5,7 @@ "MetaData": [ { "Key": "OrderType", - "Value": { "String" : "${order.optional_attributes.reason_code}"} + "Value": { "String" : "${preparation_order.optional_attributes.reason_code}"} } ], --> diff --git a/RFXtoRP_HsrPro_ExecutionflowDetected_SegmentationKeys.ftl b/RFXtoRP_HsrPro_ExecutionflowDetected_SegmentationKeys.ftl index 5c9da3d..818abbd 100644 --- a/RFXtoRP_HsrPro_ExecutionflowDetected_SegmentationKeys.ftl +++ b/RFXtoRP_HsrPro_ExecutionflowDetected_SegmentationKeys.ftl @@ -4,18 +4,18 @@ "SegmentationKeys": [ { "Key": "Grade", - "Value": { "String" : "${line.grade_code_to_prepare}"} + "Value": { "String" : "${preparation_order_line_list.grade_code_to_prepare}"} }, { "Key": "Owner", - "Value": { "String" : "${line.owner_code_to_prepare}"} + "Value": { "String" : "${preparation_order_line_list.owner_code_to_prepare}"} }, { "Key": "BatchNumber", <#if reflexMvtStockInterface.batch_1 == ""> "Value": { "String" : "no batch"} <#else> - "Value": { "String" : "${line.batch_1}"} + "Value": { "String" : "${preparation_order_line_list.batch_1}"} } ]