Merge branch 'develop' into version-1.7

# Conflicts:
#	RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl
#	RFXtoRP_HfLvTypeList.ftl
#	RFXtoRP_HsaIpgMove.ftl
#	RFXtoRP_HsaIpgMove_GoodsReceived.ftl
#	RFXtoRP_HsaIpgMove_StockMoved.ftl
#	RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl
#	RFXtoRP_HsaItm_ItemCreated.ftl
#	RFXtoRP_HsaProStatus.ftl
#	RFXtoRP_HsrPrepa.ftl
#	RFXtoRP_HsrPrepa_CarrierUpdated.ftl
#	RFXtoRP_HsrPrepa_GoodsPrepared.ftl
#	RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl
#	RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl
#	RFXtoRP_HsrPro.ftl
#	RFXtoRP_HsrPro_ExecutionflowDetected.ftl
#	RFXtoRP_HsrReceiptList.ftl
#	RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl
#	ReflexUtils.ftl
#	VERSION
This commit is contained in:
Francis REAT 2024-03-12 08:11:21 +01:00
commit 16c7d6b686
47 changed files with 801 additions and 618 deletions

View File

@ -6,7 +6,7 @@
<#include "HfRpConfig.ftl"> <#include "HfRpConfig.ftl">
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project> <#assign projectRP = project>
<#assign organisationRP = organisation> <#assign organisationRP = organisation>
@ -16,44 +16,44 @@
<#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign reflexStockPicturesInterface = JsonUtil.jsonToMap(dataRfx)> <#assign reflexStockPicturesInterface = JsonUtil.jsonToMap(dataRfx)>
<#-- idSnapshot MUST BE UNIQUE regardless of the number of messages in the stock image --> <#-- idSnapshot MUST BE UNIQUE regardless of the number of messages in the stock image -->
<#if cloudEventMsg.messageSet??> <#if cloudEventMsg.messageSet??>
<#assign idSnapshot = cloudEventMsg.messageSet /> <#assign idSnapshot = cloudEventMsg.messageSet />
<#else> <#else>
<#assign idSnapshot = cloudEventMsg.id /> <#assign idSnapshot = cloudEventMsg.id />
</#if> </#if>
<#list reflexStockPicturesInterface.detailled_stock_list as stock> <#list reflexStockPicturesInterface.detailled_stock_list as stock>
<#if stock.stock_type_code != "200"> <#if stock.stock_type_code != "200">
<#stop "stock type different from 200"> <#stop>
<#break> <#break>
</#if> </#if>
</#list> </#list>
[ [
{ {
<#if sum_elt??> <#if sum_elt??>
<#assign apiReflexPlatformID = ApiReflexPlatformID.ActorSnapshotCompleted> <#assign apiReflexPlatformID = ApiReflexPlatformID.ActorSnapshotCompleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl"> <#include "RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl">
<#else> <#else>
<#assign apiReflexPlatformID = ApiReflexPlatformID.StockSnapshotted> <#assign apiReflexPlatformID = ApiReflexPlatformID.StockSnapshotted>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl"> <#include "RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl">
</#if> </#if>
} }
] ]
<#break> <#break>
<#case "D"> <#case "D">
<#-- *********************************************** Action = DELETE ******************** --> <#-- *********************************************** Action = DELETE ******************** -->
<#stop "event not supported"> <#stop "event not supported">
<#break> <#break>
<#default> <#default>
<#stop "event not supported"> <#stop "event not supported">
</#switch> </#switch>

View File

@ -3,16 +3,16 @@
<#list reflexStockPicturesInterface.detailled_stock_list as stock> <#list reflexStockPicturesInterface.detailled_stock_list as stock>
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"Payload": { "Payload": {
"ActorID": "${stock.physical_depot_code}", "ActorID": "${stock.physical_depot_code}",
<#assign generation_date = RfxDateTimetoUTC(stock.generation_date,time_zone_offset_rfx) /> <#assign generation_date = RfxDateTimetoUTC(stock.generation_date,time_zone_offset_rfx) />
"Snapshot": { "Snapshot": {
"DateTime": { "DateTime": {
"DateTime": "${generation_date}", "DateTime": "${generation_date}",
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"
}, },
"ID": "${stock.physical_depot_code}-${idSnapshot}", "ID": "${stock.physical_depot_code}-${idSnapshot}",
"Quantity": "Quantity":
{ {
@ -20,21 +20,21 @@
"LVID": "${quantity_in_base_lv_RP_Cst}" "LVID": "${quantity_in_base_lv_RP_Cst}"
} }
}, },
"Goods": { "Goods": {
"ItemID": "${stock.item_code?trim?json_string}", "ItemID": "${stock.item_code?trim?json_string}",
"LVBranchID": "${stock.item_logistical_variant_code}", "LVBranchID": "${stock.item_logistical_variant_code}",
<#assign priority_date = stock.priority_date?datetime(rfx_date_format_default)?iso_utc /> <#assign priority_date = stock.priority_date?datetime(rfx_date_format_default)?iso_utc />
<#if (stock.priority_date!="") && (stock.priority_date?starts_with("00")== false) > <#if (stock.priority_date!="") && (stock.priority_date?starts_with("00")== false) >
"PriorityDate" : "${priority_date}", "PriorityDate" : "${priority_date}",
</#if> </#if>
<#-- Segmentation keys inclusion --> <#-- Segmentation keys inclusion -->
<#include "RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl"> <#include "RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl">
} }
} }
}<#sep>,</#sep> }<#sep>,</#sep>
</#list> </#list>
] ]

View File

@ -1,5 +1,5 @@
<#-- *********************************************** Parameter global ******************** --> <#-- *********************************************** Parameter global ******************** -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project> <#assign projectRP = project>
<#assign organisationRP = organisation> <#assign organisationRP = organisation>
<#include "HfExpGrpList.ftl"> <#include "HfExpGrpList.ftl">
@ -15,14 +15,14 @@
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign file = JsonUtil.jsonToMap(dataRfx)> <#assign file = JsonUtil.jsonToMap(dataRfx)>
<#assign temp = ExpiryGroupList64> <#assign temp = ExpiryGroupList64>
<#list file.expiry_group_list as expiry_group> <#list file.expiry_group_list as expiry_group>
<#assign temp = JsonUtil.update(temp,cloudEventMsg.action,expiry_group.exipiry_group_code,Date_Tye_Code_KV[expiry_group.priority_date_type_code])> <#assign temp = JsonUtil.update(temp,cloudEventMsg.action,expiry_group.exipiry_group_code,Date_Tye_Code_KV[expiry_group.priority_date_type_code])>
</#list> </#list>
<#assign output = JsonUtil.print(temp)> <#assign output = JsonUtil.print(temp)>
${output} ${output}
<#break> <#break>
<#default> <#default>
<#stop > <#stop >
</#switch> </#switch>

View File

@ -1,5 +1,5 @@
<#-- *********************************************** Parameter global ******************** --> <#-- *********************************************** Parameter global ******************** -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project> <#assign projectRP = project>
<#assign organisationRP = organisation> <#assign organisationRP = organisation>
@ -10,11 +10,11 @@
<#case "U"> <#case "U">
<#case "D"> <#case "D">
<#stop "no generic FTL file available yet for LV types"> <#stop "no generic FTL file available yet for LV types">
<#break> <#break>
<#default> <#default>
<#stop "event not supported"> <#stop "event not supported">
</#switch> </#switch>

View File

@ -1,32 +1,32 @@
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${carrier.carrier_code?trim?json_string}" "RefID": "${carrier.carrier_code?trim?json_string}"
}, },
"Payload": { "Payload": {
"Name": "${carrier.carrier_designation?json_string}", "Name": "${carrier.carrier_designation?json_string}",
"ManagedStock": false, "ManagedStock": false,
"IsCarrier": true, "IsCarrier": true,
<#-- ***Partner ID could be added here *** --> <#-- ***Partner ID could be added here *** -->
<#-- "PartnerID": "${}", --> <#-- "PartnerID": "${}", -->
<#-- <#--
<#include "RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl">, <#include "RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl">,
--> -->
"Address": "Address":
{ {
<#-- if Reflex WMS address is structured --> <#-- if Reflex WMS address is structured -->
<#if carrier.carrier_structured_address?? > <#if carrier.carrier_structured_address?? >
"Name": "${carrier.carrier_structured_address.name_or_company?json_string}", "Name": "${carrier.carrier_structured_address.name_or_company?json_string}",
"StreetAddressOne" : "${carrier.carrier_structured_address.street_and_PO?json_string}", "StreetAddressOne" : "${carrier.carrier_structured_address.street_and_PO?json_string}",
"StreetAddressTwo" : "${carrier.carrier_structured_address.additionnal_data?json_string}", "StreetAddressTwo" : "${carrier.carrier_structured_address.additionnal_data?json_string}",
"PostalCode" : "${carrier.carrier_structured_address.postal_code?json_string}", "PostalCode" : "${carrier.carrier_structured_address.postal_code?json_string}",
"City" : "${carrier.carrier_structured_address.post_code_area_name?json_string}", "City" : "${carrier.carrier_structured_address.post_code_area_name?json_string}",
"CountryCode" : "${carrier.carrier_structured_address.country_code?json_string}", "CountryCode" : "${carrier.carrier_structured_address.country_code?json_string}",
@ -40,15 +40,15 @@
"StreetAddressOne" : "${carrier.address.address_1?json_string}", "StreetAddressOne" : "${carrier.address.address_1?json_string}",
"StreetAddressTwo" : "${carrier.address.address_2?json_string}", "StreetAddressTwo" : "${carrier.address.address_2?json_string}",
"StreetAddressThree" : "${carrier.address.address_3?json_string}" "StreetAddressThree" : "${carrier.address.address_3?json_string}"
</#if> </#if>
</#if> </#if>
}, },
<#if carrier.address??> <#if carrier.address??>
"Phones": ["${carrier.address.telephone?json_string}", "Phones": ["${carrier.address.telephone?json_string}",
"${carrier.address.other_number?json_string}" "${carrier.address.other_number?json_string}"
], ],
</#if> </#if>
"Typology": "TYPOLOGY_CARRIER" "Typology": "TYPOLOGY_CARRIER"
} }
} }
] ]

View File

@ -1,12 +1,12 @@
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${carrier.carrier_code?trim?json_string}" "RefID": "${carrier.carrier_code?trim?json_string}"
}, },
"Payload": {} "Payload": {}
} }
] ]

View File

@ -17,7 +17,7 @@
<#-- <#--
<#include "RFXtoRP_HsaCons_ActorCreated_Metadata.ftl">, <#include "RFXtoRP_HsaCons_ActorCreated_Metadata.ftl">,
--> -->
"Address": "Address":
{ {
@ -26,7 +26,7 @@
"Name": "${actor.consignee_structured_address.name_or_company?json_string}", "Name": "${actor.consignee_structured_address.name_or_company?json_string}",
"StreetAddressOne" : "${actor.consignee_structured_address.street_and_PO?json_string}", "StreetAddressOne" : "${actor.consignee_structured_address.street_and_PO?json_string}",
"StreetAddressTwo" : "${actor.consignee_structured_address.additionnal_data?json_string}", "StreetAddressTwo" : "${actor.consignee_structured_address.additionnal_data?json_string}",
"PostalCode" : "${actor.consignee_structured_address.postal_code?json_string}", "PostalCode" : "${actor.consignee_structured_address.postal_code?json_string}",
"City" : "${actor.consignee_structured_address.post_code_area_name?json_string}", "City" : "${actor.consignee_structured_address.post_code_area_name?json_string}",
"CountryCode" : "${actor.consignee_structured_address.country_code?json_string}", "CountryCode" : "${actor.consignee_structured_address.country_code?json_string}",
@ -34,20 +34,20 @@
"State": "${actor.consignee_structured_address.country_designation?json_string}" "State": "${actor.consignee_structured_address.country_designation?json_string}"
<#-- if Reflex WMS is not structured --> <#-- if Reflex WMS is not structured -->
<#else> <#else>
<#if actor.address?? > <#if actor.address?? >
"Name": "${actor.address.company_name?json_string}", "Name": "${actor.address.company_name?json_string}",
"StreetAddressOne" : "${actor.address.address_1?json_string}", "StreetAddressOne" : "${actor.address.address_1?json_string}",
"StreetAddressTwo" : "${actor.address.address_2?json_string}", "StreetAddressTwo" : "${actor.address.address_2?json_string}",
"StreetAddressThree" : "${actor.address.address_3?json_string}" "StreetAddressThree" : "${actor.address.address_3?json_string}"
</#if> </#if>
</#if> </#if>
}, },
<#if actor.address?? > <#if actor.address?? >
"Phones": ["${actor.address.telephone?json_string}", "Phones": ["${actor.address.telephone?json_string}",
"${actor.address.other_number?json_string}" "${actor.address.other_number?json_string}"
], ],
</#if> </#if>
"Typology": "TYPOLOGY_UNKNOWN" "Typology": "TYPOLOGY_UNKNOWN"
} }

View File

@ -1,12 +1,12 @@
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${actor.code?trim?json_string}" "RefID": "${actor.code?trim?json_string}"
}, },
"Payload": {} "Payload": {}
} }
] ]

View File

@ -1,4 +1,4 @@
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project> <#assign projectRP = project>
<#assign organisationRP = organisation> <#assign organisationRP = organisation>
@ -9,13 +9,13 @@
<#case "U"> <#case "U">
<#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign reflexMvtStockInterface = JsonUtil.jsonToMap(dataRfx)> <#assign reflexMvtStockInterface = JsonUtil.jsonToMap(dataRfx)>
<#-- exclusion of the cases of an IPG move with quantity = 0 (weight modification) --> <#-- exclusion of the cases of an IPG move with quantity = 0 (weight modification) -->
<#if reflexMvtStockInterface.ipg_move_quantity_in_base_lvs != 0> <#if reflexMvtStockInterface.ipg_move_quantity_in_base_lvs != 0>
<#-- IPG moves translated into Stock moves --> <#-- IPG moves translated into Stock moves -->
<#if reflexMvtStockInterface.ipg_move_type == "130" || <#if reflexMvtStockInterface.ipg_move_type == "130" ||
reflexMvtStockInterface.ipg_move_type == "200" || reflexMvtStockInterface.ipg_move_type == "200" ||
reflexMvtStockInterface.ipg_move_type == "210" || reflexMvtStockInterface.ipg_move_type == "210" ||
reflexMvtStockInterface.ipg_move_type == "220" || reflexMvtStockInterface.ipg_move_type == "220" ||
@ -25,49 +25,49 @@
reflexMvtStockInterface.ipg_move_type == "290" || reflexMvtStockInterface.ipg_move_type == "290" ||
reflexMvtStockInterface.ipg_move_type == "300" || reflexMvtStockInterface.ipg_move_type == "300" ||
reflexMvtStockInterface.ipg_move_type == "400" || reflexMvtStockInterface.ipg_move_type == "400" ||
reflexMvtStockInterface.ipg_move_type == "410" || reflexMvtStockInterface.ipg_move_type == "410" ||
reflexMvtStockInterface.ipg_move_type == "420" reflexMvtStockInterface.ipg_move_type == "420"
> >
[ [
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.StockMoved> <#assign apiReflexPlatformID = ApiReflexPlatformID.StockMoved>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsaIpgMove_StockMoved.ftl"> <#include "RFXtoRP_HsaIpgMove_StockMoved.ftl">
} }
] ]
<#else> <#else>
<#-- IPG moves translated into goods received (all type of receipt) --> <#-- IPG moves translated into goods received (all type of receipt) -->
<#if reflexMvtStockInterface.ipg_move_type == "100" || <#if reflexMvtStockInterface.ipg_move_type == "100" ||
reflexMvtStockInterface.ipg_move_type == "110" || reflexMvtStockInterface.ipg_move_type == "110" ||
reflexMvtStockInterface.ipg_move_type == "120" reflexMvtStockInterface.ipg_move_type == "120"
> >
[ [
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitGoodsReceived> <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitGoodsReceived>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsaIpgMove_GoodsReceived.ftl"> <#include "RFXtoRP_HsaIpgMove_GoodsReceived.ftl">
} }
] ]
<#else> <#else>
<#-- Case of IPG move type volontarilly ignored--> <#-- Case of IPG move type volontarilly ignored-->
<#stop> <#stop>
</#if> </#if>
</#if>
<#else>
<#-- cases of an IPG move with quantity = 0 (weight modification)-->
<#stop>
</#if> </#if>
<#else>
<#-- cases of an IPG move with quantity = 0 (weight modification)-->
<#stop>
</#if>
<#break> <#break>
<#case "D"> <#case "D">
<#-- *********************************************** Action = DELETE ******************** --> <#-- *********************************************** Action = DELETE ******************** -->
<#stop "event not supported - Case D "> <#stop "event not supported - Case D ">
<#break> <#break>
<#default> <#default>
<#stop "event not supported"> <#stop "event not supported">
</#switch> </#switch>

View File

@ -3,25 +3,25 @@
[ [
<#assign receipt_confirmation_datetime = RfxDateTimetoUTC(reflexMvtStockInterface.ipg_move_creation_datetime,time_zone_offset_rfx) /> <#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 /> <#assign priority_date = reflexMvtStockInterface.ipg_priority_date?datetime(rfx_date_format_default)?iso_utc />
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${reflexMvtStockInterface.hd_number?trim?json_string}" "RefID": "${reflexMvtStockInterface.hd_number?trim?json_string}"
}, },
"Payload": { "Payload": {
"ReceivedContents" :[ "ReceivedContents" :[
{ {
"DateTime": { "DateTime": {
"DateTime": "${receipt_confirmation_datetime}", "DateTime": "${receipt_confirmation_datetime}",
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"
}, },
"Goods": { "Goods": {
"ItemID": "${reflexMvtStockInterface.item_code?trim?json_string}", "ItemID": "${reflexMvtStockInterface.item_code?trim?json_string}",
"LVBranchID": "${reflexMvtStockInterface.lv_code?json_string}", "LVBranchID": "${reflexMvtStockInterface.lv_code?json_string}",
"PriorityDate": "${priority_date}", "PriorityDate": "${priority_date}",
<#-- Goods received Segmentation Keys inclusion --> <#-- Goods received Segmentation Keys inclusion -->
<#include "RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl"> <#include "RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl">
}, },
@ -30,15 +30,15 @@
<#else> <#else>
"ExecutionflowID": "${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.ipg_move_year_number}${reflexMvtStockInterface.extended_ipg_move_number}", "ExecutionflowID": "${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.ipg_move_year_number}${reflexMvtStockInterface.extended_ipg_move_number}",
</#if> </#if>
"LineID": "${reflexMvtStockInterface.receipt_line_number}", "LineID": "${reflexMvtStockInterface.receipt_line_number}",
"ActorID": "${reflexMvtStockInterface.physical_depot_code?trim?json_string}", "ActorID": "${reflexMvtStockInterface.physical_depot_code?trim?json_string}",
"Quantity": { "Quantity": {
"LVID": "${quantity_in_base_lv_RP_Cst}", "LVID": "${quantity_in_base_lv_RP_Cst}",
"Value": ${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs} "Value": ${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs}
} }
} }
] ]
} }
} }
] ]

View File

@ -12,29 +12,29 @@
"300":"STOCK_MOVEMENT_TYPE_REQUALIFICATION", "300":"STOCK_MOVEMENT_TYPE_REQUALIFICATION",
"400":"STOCK_MOVEMENT_TYPE_FIX", "400":"STOCK_MOVEMENT_TYPE_FIX",
"410":"STOCK_MOVEMENT_TYPE_FIX", "410":"STOCK_MOVEMENT_TYPE_FIX",
"420":"STOCK_MOVEMENT_TYPE_REQUALIFICATION"}> "420":"STOCK_MOVEMENT_TYPE_REQUALIFICATION"}>
<#assign generation_date = RfxDateTimetoUTC(reflexMvtStockInterface.ipg_move_creation_datetime,time_zone_offset_rfx) /> <#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 /> <#assign ipg_priority_datetime = reflexMvtStockInterface.ipg_priority_date?datetime(rfx_date_format_default)?iso_utc />
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"Payload": { "Payload": {
"Goods": { "Goods": {
"ItemID": "${reflexMvtStockInterface.item_code?trim?json_string}", "ItemID": "${reflexMvtStockInterface.item_code?trim?json_string}",
"PriorityDate": "${ipg_priority_datetime}", "PriorityDate": "${ipg_priority_datetime}",
<#-- Segmentation keys inclusions --> <#-- Segmentation keys inclusions -->
<#include "RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl">, <#include "RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl">,
"LVBranchID": "${reflexMvtStockInterface.lv_code?json_string}" "LVBranchID": "${reflexMvtStockInterface.lv_code?json_string}"
}, },
"ActorID": "${reflexMvtStockInterface.physical_depot_code?trim?json_string}", "ActorID": "${reflexMvtStockInterface.physical_depot_code?trim?json_string}",
"Movement": { "Movement": {
"DateTime": { "DateTime": {
"DateTime": "${generation_date}", "DateTime": "${generation_date}",
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"
@ -46,8 +46,8 @@
"ExternalInfo" : "${reflexMvtStockInterface.stock_move_reference?json_string}", "ExternalInfo" : "${reflexMvtStockInterface.stock_move_reference?json_string}",
<#if reflexMvtStockInterface.ipg_move_operation_year_number!= 0> <#if reflexMvtStockInterface.ipg_move_operation_year_number!= 0>
"OperationReference": "${reflexMvtStockInterface.ipg_move_operation_year_number} - ${reflexMvtStockInterface.ipg_move_operation_number}", "OperationReference": "${reflexMvtStockInterface.ipg_move_operation_year_number} - ${reflexMvtStockInterface.ipg_move_operation_number}",
</#if> </#if>
"Quantity": "Quantity":
{ {
"LVID": "${quantity_in_base_lv_RP_Cst}", "LVID": "${quantity_in_base_lv_RP_Cst}",

View File

@ -1,14 +1,14 @@
<#include "HfRpConfig.ftl"> <#include "HfRpConfig.ftl">
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${lv.item_code?trim?json_string}" "RefID": "${lv.item_code?trim?json_string}"
}, },
"Payload": { "Payload": {
"RemovedLogisticVariantIDs":["${lv.logistical_variant_code}"] "RemovedLogisticVariantIDs":["${lv.logistical_variant_code}"]
} }
} }
] ]

View File

@ -1,37 +1,37 @@
<#include "HfRpConfig.ftl"> <#include "HfRpConfig.ftl">
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${lv.item_code?trim?json_string}" "RefID": "${lv.item_code?trim?json_string}"
}, },
"Payload": { "Payload": {
"LogisticVariants": [ "LogisticVariants": [
{ {
"LVID": "${lv.logistical_variant_code?json_string}", "LVID": "${lv.logistical_variant_code?json_string}",
"Name" : "${lv.lv_type_code?json_string}", "Name" : "${lv.lv_type_code?json_string}",
<#if lv.id_list??> <#if lv.id_list??>
"Codes": [ "Codes": [
<#list lv.id_list as id> <#list lv.id_list as id>
{ {
"Key": "${id.logistical_variant_ID_type_code?json_string!""}", "Key": "${id.logistical_variant_ID_type_code?json_string!""}",
"Value": "${id.logistical_variant_ID_code?json_string!""}" "Value": "${id.logistical_variant_ID_code?json_string!""}"
}<#sep>,</#sep> }<#sep>,</#sep>
</#list> </#list>
], ],
</#if> </#if>
<#-- LV Metadata inclusion --> <#-- LV Metadata inclusion -->
<#include "RFXtoRP_HsaItmLv_LogisticVariantUpdated_Metadata.ftl">, <#include "RFXtoRP_HsaItmLv_LogisticVariantUpdated_Metadata.ftl">,
"IsBaseLogisticVariant": ${lv.base_lv}, "IsBaseLogisticVariant": ${lv.base_lv},
<#if lv.base_lv != "true"> <#if lv.base_lv != "true">
"RefLV": "${lv.subpackaging_lv_code?json_string}", "RefLV": "${lv.subpackaging_lv_code?json_string}",
</#if> </#if>
"QuantityInRefLV": ${lv.quantity_in_subpackaging_lv}, "QuantityInRefLV": ${lv.quantity_in_subpackaging_lv},
"NetWeight": { "NetWeight": {
@ -39,35 +39,35 @@
"Unit": "${weight_unit_rfx}" "Unit": "${weight_unit_rfx}"
}, },
"GrossWeight": { "GrossWeight": {
"Value": ${lv.gross_weight}, "Value": ${lv.gross_weight},
"Unit": "${weight_unit_rfx}" "Unit": "${weight_unit_rfx}"
}, },
"Volume": { "Volume": {
"Value": ${lv.volume}, "Value": ${lv.volume},
"Unit": "${volume_unit_rfx}" "Unit": "${volume_unit_rfx}"
}, },
"Height": { "Height": {
"Value": ${lv.height}, "Value": ${lv.height},
"Unit": "${length_unit_rfx}" "Unit": "${length_unit_rfx}"
}, },
"Width": { "Width": {
"Value": ${lv.width}, "Value": ${lv.width},
"Unit": "${length_unit_rfx}" "Unit": "${length_unit_rfx}"
}, },
"Length": { "Length": {
"Value": ${lv.depth}, "Value": ${lv.depth},
"Unit": "${length_unit_rfx}" "Unit": "${length_unit_rfx}"
}, },
<#if lv.packaging_lv == "true"> <#if lv.packaging_lv == "true">
"BranchIDs": ["${lv.logistical_variant_code}"] "BranchIDs": ["${lv.logistical_variant_code}"]
<#else> <#else>
"BranchIDs": [] "BranchIDs": []
</#if> </#if>
} }
] ]
} }
} }
] ]

View File

@ -1,9 +1,9 @@
<#include "HfRpConfig.ftl"> <#include "HfRpConfig.ftl">
<#include "HfExpGrpList.ftl"> <#include "HfExpGrpList.ftl">
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${item.item_code?trim?json_string}" "RefID": "${item.item_code?trim?json_string}"
@ -12,91 +12,93 @@
"DescriptionsByLanguage": [{ "DescriptionsByLanguage": [{
"ShortDescription": "${item.short_designation?json_string}", "ShortDescription": "${item.short_designation?json_string}",
"LongDescription": "${item.designation?json_string}", "LongDescription": "${item.designation?json_string}",
"TechnicalDetails": "${item.item_description?json_string}", "TechnicalDetails": "${item.item_description?json_string}",
"LanguageCodeISO6391": "${text_language_rfx}" "LanguageCodeISO6391": "${text_language_rfx}"
} }
], ],
"ExpiryConstraint": { "ExpiryConstraint": {
"Type": "${ExpiryGroupList[item.expiry_group_code]!"UNKNOWN_DATE"}" "Type": "${ExpiryGroupList[item.expiry_group_code]!"UNKNOWN_DATE"}"
}, },
<#-- Item metadata inclusion --> <#-- Item metadata inclusion -->
<#include "RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl">, <#include "RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl">,
<#-- Item Photo URI could be added here --> <#-- Item Photo URI could be added here -->
<#--"PhotoURI": " ", --> <#--"PhotoURI": " ", -->
<#-- Loop for the Logistical Variants - LV --> <#-- Loop for the Logistical Variants - LV -->
<#if item.logistical_variant_list??> <#if item.logistical_variant_list??>
"LogisticVariants": [ "LogisticVariants": [
<#list item.logistical_variant_list as logistical_variant> <#list item.logistical_variant_list as logistical_variant>
{ {
"LVID": "${logistical_variant.logistical_variant_code?json_string}", "LVID": "${logistical_variant.logistical_variant_code?json_string}",
"Name" : "${logistical_variant.lv_type_code?json_string}", "Name" : "${logistical_variant.lv_type_code?json_string}",
<#if logistical_variant.id_list??> <#if logistical_variant.id_list??>
"Codes": [ "Codes": [
<#list logistical_variant.id_list as id> <#list logistical_variant.id_list as id>
{ {
"Key": "${id.logistical_variant_ID_type_code?json_string!""}", "Key": "${id.logistical_variant_ID_type_code?json_string!""}",
"Value": "${id.logistical_variant_ID_code?json_string!""}" "Value": "${id.logistical_variant_ID_code?json_string!""}"
}<#sep>,</#sep> }<#sep>,</#sep>
</#list> </#list>
], ],
</#if> </#if>
<#-- LV Metadata inclusion --> <#-- LV Metadata inclusion -->
<#include "RFXtoRP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl">, <#include "RFXtoRP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl">,
"IsBaseLogisticVariant": ${logistical_variant.base_lv}, <#if logistical_variant.base_lv?? && logistical_variant.base_lv!="">
"IsBaseLogisticVariant": ${logistical_variant.base_lv},
</#if>
<#if logistical_variant.base_lv != "true"> <#if logistical_variant.base_lv != "true">
"RefLV": "${logistical_variant.subpackaging_lv_code?json_string}", "RefLV": "${logistical_variant.subpackaging_lv_code?json_string}",
</#if> </#if>
"QuantityInRefLV": ${logistical_variant.quantity_in_subpackaging_lv}, "QuantityInRefLV": ${logistical_variant.quantity_in_subpackaging_lv},
"NetWeight": { "NetWeight": {
"Value": ${logistical_variant.net_weight}, "Value": ${logistical_variant.net_weight},
"Unit": "${weight_unit_rfx}" "Unit": "${weight_unit_rfx}"
}, },
"GrossWeight": { "GrossWeight": {
"Value": ${logistical_variant.gross_weight}, "Value": ${logistical_variant.gross_weight},
"Unit": "${weight_unit_rfx}" "Unit": "${weight_unit_rfx}"
}, },
"Volume": { "Volume": {
"Value": ${logistical_variant.volume}, "Value": ${logistical_variant.volume},
"Unit": "${volume_unit_rfx}" "Unit": "${volume_unit_rfx}"
}, },
"Height": { "Height": {
"Value": ${logistical_variant.height}, "Value": ${logistical_variant.height},
"Unit": "${length_unit_rfx}" "Unit": "${length_unit_rfx}"
}, },
"Width": { "Width": {
"Value": ${logistical_variant.width}, "Value": ${logistical_variant.width},
"Unit": "${length_unit_rfx}" "Unit": "${length_unit_rfx}"
}, },
"Length": { "Length": {
"Value": ${logistical_variant.depth}, "Value": ${logistical_variant.depth},
"Unit": "${length_unit_rfx}" "Unit": "${length_unit_rfx}"
}, },
<#if logistical_variant.packaging_lv == "true"> <#if logistical_variant.packaging_lv == "true">
"BranchIDs": ["${logistical_variant.logistical_variant_code}"] "BranchIDs": ["${logistical_variant.logistical_variant_code}"]
<#else> <#else>
"BranchIDs": [] "BranchIDs": []
</#if> </#if>
} }
<#sep>,</#sep> <#sep>,</#sep>
</#list> </#list>
] ]
</#if> </#if>
<#-- End of LV loop --> <#-- End of LV loop -->
} }
} }
] ]

View File

@ -1,12 +1,12 @@
<#include "HfRpConfig.ftl"> <#include "HfRpConfig.ftl">
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${item.item_code?trim?json_string}" "RefID": "${item.item_code?trim?json_string}"
}, },
"Payload": {} "Payload": {}
} }
] ]

View File

@ -3,7 +3,7 @@
<#-- project : projectId in ReflexPlatform --> <#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform --> <#-- organisation : organisationtId in ReflexPlatform -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project> <#assign projectRP = project>
<#assign organisationRP = organisation> <#assign organisationRP = organisation>
@ -14,62 +14,58 @@
<#case "U"> <#case "U">
<#-- Action = CREATE or UPDATE --> <#-- Action = CREATE or UPDATE -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign preparationStatusInterface = JsonUtil.jsonToMap(dataRfx) /> <#assign preparationStatusInterface = JsonUtil.jsonToMap(dataRfx) />
[ [
<#--**Pick batch runned (200) **--> <#--**Pick batch runned (200) **-->
<#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "200" > <#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "200" >
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationExpected> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationExpected>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsaProStatus_PreparationExpected.ftl"> <#include "RFXtoRP_HsaProStatus_PreparationExpected.ftl">
} }
<#else> <#else>
<#-- ** Collection started (300) and Preparation in progress (400)** --> <#-- ** Collection started (300) and Preparation in progress (400)** -->
<#if preparationStatusInterface.preparation_status_type == "100" && (preparationStatusInterface.preparation_status_code == "300" || preparationStatusInterface.preparation_status_code == "400") > <#if preparationStatusInterface.preparation_status_type == "100" && (preparationStatusInterface.preparation_status_code == "300" || preparationStatusInterface.preparation_status_code == "400") >
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationStarted> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationStarted>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl"> <#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl">
} }
<#else> <#else>
<#-- **Preparation to package (500) and preparation completed (550)** -->
<#if preparationStatusInterface.preparation_status_type == "100" && (preparationStatusInterface.preparation_status_code == "500" || preparationStatusInterface.preparation_status_code == "550")>
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationCompleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaProStatus_PreparationCompleted.ftl">
}
<#else>
<#-- ****Preparation dispatched (600)** --> <#-- ****Preparation dispatched (600)** -->
<#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "600" > <#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "600" >
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationCompleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsaProStatus_TransportStarted.ftl"> <#include "RFXtoRP_HsaProStatus_PreparationCompleted.ftl">
} },
<#else> {
<#-- ****Preparation cancelled (650)**** --> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted>
<#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "650" >
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl"> <#include "RFXtoRP_HsaProStatus_TransportStarted.ftl">
}
<#else>
<#-- ****Preparation cancelled (650)**** -->
<#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "650" >
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl">
} }
<#else> <#else>
<#stop> <#stop>
</#if>
</#if> </#if>
</#if> </#if>
</#if> </#if>
</#if> </#if>
] ]
<#break> <#break>
<#case "D"> <#case "D">
<#-- *********************************************** Action = DELETE ******************** --> <#-- *********************************************** Action = DELETE ******************** -->
<#stop "event not supported (case D)"> <#stop "event not supported (case D)">

View File

@ -3,9 +3,9 @@
<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) /> <#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) />
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}", "RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}",

View File

@ -2,9 +2,9 @@
<#include "ReflexUtils.ftl"> <#include "ReflexUtils.ftl">
<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) /> <#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) />
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}", "RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}",
@ -13,8 +13,8 @@
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"
} }
}, },
"Payload": {} "Payload": {}
} }
] ]

View File

@ -2,9 +2,9 @@
<#include "ReflexUtils.ftl"> <#include "ReflexUtils.ftl">
<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) /> <#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) />
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}", "RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}",
@ -13,8 +13,8 @@
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"
} }
}, },
"Payload": {} "Payload": {}
} }
] ]

View File

@ -2,9 +2,9 @@
<#include "ReflexUtils.ftl"> <#include "ReflexUtils.ftl">
<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) /> <#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) />
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}", "RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}",
@ -13,8 +13,8 @@
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"
} }
}, },
"Payload": {} "Payload": {}
} }
] ]

View File

@ -2,9 +2,9 @@
<#include "ReflexUtils.ftl"> <#include "ReflexUtils.ftl">
<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) /> <#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) />
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}", "RefID": "${preparationStatusInterface.preparation_order_originator_reference?trim?json_string}",
@ -13,8 +13,8 @@
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"
} }
}, },
"Payload": {} "Payload": {}
} }
] ]

View File

@ -1,37 +1,37 @@
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${actor.code?trim?json_string}" "RefID": "${actor.code?trim?json_string}"
}, },
"Payload": { "Payload": {
"Name": "${actor.designation?json_string}", "Name": "${actor.designation?json_string}",
"ManagedStock": false, "ManagedStock": false,
"IsCarrier": false, "IsCarrier": false,
<#-- ***Partner ID could be added here *** --> <#-- ***Partner ID could be added here *** -->
<#-- "PartnerID": "${}", --> <#-- "PartnerID": "${}", -->
<#-- <#--
<#include "RFXtoRP_HsaSup_ActorCreated_Metadata.ftl">, <#include "RFXtoRP_HsaSup_ActorCreated_Metadata.ftl">,
--> -->
"Address": "Address":
{ {
<#-- if Reflex WMS address is structured --> <#-- if Reflex WMS address is structured -->
<#if actor.supplier_structured_address?? > <#if actor.supplier_structured_address?? >
"Name": "${actor.supplier_structured_address.name_or_company?json_string}", "Name": "${actor.supplier_structured_address.name_or_company?json_string}",
"StreetAddressOne" : "${actor.supplier_structured_address.street_and_PO?json_string}", "StreetAddressOne" : "${actor.supplier_structured_address.street_and_PO?json_string}",
"StreetAddressTwo" : "${actor.supplier_structured_address.additionnal_data?json_string}", "StreetAddressTwo" : "${actor.supplier_structured_address.additionnal_data?json_string}",
"PostalCode" : "${actor.supplier_structured_address.postal_code?json_string}", "PostalCode" : "${actor.supplier_structured_address.postal_code?json_string}",
"City" : "${actor.supplier_structured_address.post_code_area_name?json_string}", "City" : "${actor.supplier_structured_address.post_code_area_name?json_string}",
"CountryCode" : "${actor.supplier_structured_address.country_code?json_string}", "CountryCode" : "${actor.supplier_structured_address.country_code?json_string}",
"ProvinceCode": "${actor.supplier_structured_address.territorial_div_code?json_string}", "ProvinceCode": "${actor.supplier_structured_address.territorial_div_code?json_string}",
"State": "${actor.supplier_structured_address.country_designation?json_string}" "State": "${actor.supplier_structured_address.country_designation?json_string}"
<#-- if Reflex WMS address is not structured --> <#-- if Reflex WMS address is not structured -->
<#else> <#else>
<#if actor.optional_attributes?? > <#if actor.optional_attributes?? >
@ -41,14 +41,14 @@
"StreetAddressThree" : "${actor.optional_attributes.address_3?json_string}" "StreetAddressThree" : "${actor.optional_attributes.address_3?json_string}"
</#if> </#if>
</#if> </#if>
}, },
<#if actor.optional_attributes?? > <#if actor.optional_attributes?? >
"Phones": ["${actor.optional_attributes.telephone?json_string}", "Phones": ["${actor.optional_attributes.telephone?json_string}",
"${actor.optional_attributes.other_number?json_string}" "${actor.optional_attributes.other_number?json_string}"
], ],
</#if> </#if>
"Typology": "TYPOLOGY_UNKNOWN" "Typology": "TYPOLOGY_UNKNOWN"
} }
} }
] ]

View File

@ -1,12 +1,12 @@
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${actor.code?trim?json_string}" "RefID": "${actor.code?trim?json_string}"
}, },
"Payload": {} "Payload": {}
} }
] ]

View File

@ -1,37 +1,37 @@
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${depot.physical_depot_code?trim?json_string}" "RefID": "${depot.physical_depot_code?trim?json_string}"
}, },
"Payload": { "Payload": {
"Name": "${depot.physical_depot_designation?json_string}", "Name": "${depot.physical_depot_designation?json_string}",
"ManagedStock": true, "ManagedStock": true,
"IsCarrier": false, "IsCarrier": false,
<#-- ***Partner ID could be added here *** --> <#-- ***Partner ID could be added here *** -->
<#-- "PartnerID": "${}", --> <#-- "PartnerID": "${}", -->
<#-- <#--
<#include "RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl">, <#include "RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl">,
--> -->
"Address": "Address":
{ {
<#-- if Reflex WMS address is structured --> <#-- if Reflex WMS address is structured -->
<#if depot.physical_depot_structured_address?? > <#if depot.physical_depot_structured_address?? >
"Name": "${depot.physical_depot_structured_address.name_or_company?json_string}", "Name": "${depot.physical_depot_structured_address.name_or_company?json_string}",
"StreetAddressOne" : "${depot.physical_depot_structured_address.street_and_PO?json_string}", "StreetAddressOne" : "${depot.physical_depot_structured_address.street_and_PO?json_string}",
"StreetAddressTwo" : "${depot.physical_depot_structured_address.additionnal_data?json_string}", "StreetAddressTwo" : "${depot.physical_depot_structured_address.additionnal_data?json_string}",
"PostalCode" : "${depot.physical_depot_structured_address.postal_code?json_string}", "PostalCode" : "${depot.physical_depot_structured_address.postal_code?json_string}",
"City" : "${depot.physical_depot_structured_address.post_code_area_name?json_string}", "City" : "${depot.physical_depot_structured_address.post_code_area_name?json_string}",
"CountryCode" : "${depot.physical_depot_structured_address.country_code?json_string}", "CountryCode" : "${depot.physical_depot_structured_address.country_code?json_string}",
"ProvinceCode": "${depot.physical_depot_structured_address.territorial_div_code?json_string}", "ProvinceCode": "${depot.physical_depot_structured_address.territorial_div_code?json_string}",
"State": "${depot.physical_depot_structured_address.country_designation?json_string}" "State": "${depot.physical_depot_structured_address.country_designation?json_string}"
<#-- if Reflex WMS address is not structured --> <#-- if Reflex WMS address is not structured -->
<#else> <#else>
"Name": "${depot.physical_depot_address.company_name?json_string}", "Name": "${depot.physical_depot_address.company_name?json_string}",
@ -39,12 +39,12 @@
"StreetAddressTwo" : "${depot.physical_depot_address.address_2?json_string}", "StreetAddressTwo" : "${depot.physical_depot_address.address_2?json_string}",
"StreetAddressThree" : "${depot.physical_depot_address.address_3?json_string}" "StreetAddressThree" : "${depot.physical_depot_address.address_3?json_string}"
</#if> </#if>
}, },
"Phones": ["${depot.physical_depot_address.telephone?json_string}", "Phones": ["${depot.physical_depot_address.telephone?json_string}",
"${depot.physical_depot_address.other_number?json_string}" "${depot.physical_depot_address.other_number?json_string}"
], ],
"Typology": "TYPOLOGY_UNKNOWN" "Typology": "TYPOLOGY_UNKNOWN"
} }
} }
] ]

View File

@ -1,12 +1,12 @@
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${depot.physical_depot_code?trim?json_string}" "RefID": "${depot.physical_depot_code?trim?json_string}"
}, },
"Payload": {} "Payload": {}
} }
] ]

View File

@ -2,53 +2,89 @@
<#-- input : message RFX --> <#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform --> <#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform --> <#-- organisation : organisationtId in ReflexPlatform -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project> <#assign projectRP = project>
<#assign organisationRP = organisation> <#assign organisationRP = organisation>
<#assign aDateTime = .now> <#assign aDateTime = .now>
<#switch cloudEventMsg.action> <#switch cloudEventMsg.action>
<#case "C"> <#case "C">
<#--<#case "U"> <#--<#case "U">
<#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign preparationOrder = JsonUtil.jsonToMap(dataRfx)> <#assign preparationOrder = JsonUtil.jsonToMap(dataRfx)>
<#if preparationOrder.total_lv_validated !=0> <#if preparationOrder.total_lv_validated !=0>
[ [
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitGoodsPrepared> <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitGoodsPrepared>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrPrepa_GoodsPrepared.ftl"> <#include "RFXtoRP_HsrPrepa_HandlingunitGoodsPrepared.ftl">
}, },
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitDispatched> <#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitDispatched>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl"> <#include "RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl">
} }
<#if preparationOrder.load_data?? && preparationOrder.load_data.carrier_code?? && preparationOrder.load_data.carrier_code!="" >
,
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCarrierUpdated>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrPrepa_CarrierUpdated.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.OrderCarrierUpdated>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrPrepa_OrderCarrierUpdated.ftl">
}
</#if>
<#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line> <#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line>
<#list preparation_line.despatched_ipg_list as despatched_ipg> <#list preparation_line.despatched_ipg_list as despatched_ipg>
<#if despatched_ipg.consignment_unit_id != ""> <#if despatched_ipg.consignment_unit_id!="">
, ,
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingHULabeled> <#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingHULabeled>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl"> <#include "RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl">
} }
</#if> </#if>
<#if despatched_ipg.carton_number != "000000000000000000" && despatched_ipg.carton_number!=despatched_ipg.hd_number >
,
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitHUsAdded>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrPrepa_HandlingunitHUsAdded.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitDispatched>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrPrepa_HUsAdded_HandlingUnitDispatched.ftl">
}
</#if>
</#list> </#list>
<#-- <#sep>,</#sep> -->
</#list> </#list>
] ]
<#else> <#else>
<#stop "no confirmed quantity for the preparation - preparation closed"> <#stop "no confirmed quantity for the preparation - preparation closed">
</#if> </#if>
<#break> <#break>
<#case "D"> <#case "D">
<#-- *********************************************** Action = DELETE ******************** --> <#-- *********************************************** Action = DELETE ******************** -->

View File

@ -0,0 +1,23 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID":{
"RefID": "${preparationOrder.preparation_line_lst[0].preparation_order_originator_reference?trim?json_string}"
},
"Payload":{
"Carrier": {
"ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}"
}
<#-- Add transport grade code
<#if preparationOrder.transport_grade_code!="">
,
"CarrierService":"${preparationOrder.transport_grade_code?trim?json_string}"
</#if> -->
}
}
]

View File

@ -1,89 +0,0 @@
<#include "HfRpConfig.ftl">
[
<#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line>
<#list preparation_line.despatched_ipg_list as despatched_ipg>
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
<#if despatched_ipg.carton_number != "000000000000000000">
"RefID": "${despatched_ipg.carton_number}"
<#else>
"RefID": "${despatched_ipg.hd_number}"
</#if>
},
"Payload": {
"Information" :{
<#if despatched_ipg.carton_number != "000000000000000000">
"ContainerType": "${despatched_ipg.carton_type_code}"
<#else>
"ContainerType": "${despatched_ipg.hd_type_code}"
</#if>
},
<#-- HU Metadata inclusin inclusion -->
<#include "RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl">
,
"PreparedContents" :[
{
"Goods": {
"ItemID": "${preparation_line.item_code?trim?json_string}",
"LVBranchID": "${preparation_line.item_lv_code?json_string}",
<#if (despatched_ipg.ipg_manufacture_date?length != 0) && (despatched_ipg.ipg_manufacture_date?starts_with("00") == false)>
<#assign priority_date = despatched_ipg.ipg_manufacture_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
<#if (despatched_ipg.ipg_receipt_date?length != 0) && (despatched_ipg.ipg_receipt_date?starts_with("00")== false)>
<#assign priority_date = despatched_ipg.ipg_receipt_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
<#if (despatched_ipg.ipg_best_before_date?length != 0) && (despatched_ipg.ipg_best_before_date?starts_with("00")== false)>
<#assign priority_date = despatched_ipg.ipg_best_before_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
<#if (despatched_ipg.ipg_sell_by_date?length != 0) && (despatched_ipg.ipg_sell_by_date?starts_with("00")== false)>
<#assign priority_date = despatched_ipg.ipg_sell_by_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
<#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}",
<#else>
<#if (preparationOrder.stock_despatch_at_preparation_datetime?length != 0) && (preparationOrder.stock_despatch_at_preparation_datetime?starts_with("00")== false)>
<#assign priority_date = preparationOrder.stock_despatch_at_preparation_datetime?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
"PriorityDate": "1970-01-01T00:00:00Z",
</#if>
</#if>
</#if>
</#if>
</#if>
</#if>
<#-- Segmentation Keys inclusion -->
<#include "RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl">
},
"ExecutionflowID": "${preparation_line.preparation_order_originator_reference?trim?json_string}",
<#if (preparation_line.pro_originator_reference_line_number!0) != 0>
"LineID": "${preparation_line.pro_originator_reference_line_number}",
<#else>
"LineID": "${preparation_line.pro_line_number!0}",
</#if>
"ActorID": "${preparationOrder.physical_depot_code?trim?json_string}",
"Quantity": {
"LVID": "${quantity_in_base_lv_RP_Cst}",
"Value": ${despatched_ipg.quantity_lvs}
}
}
]
}
}<#sep>,</#sep>
</#list>
<#sep>,</#sep>
</#list>
]

View File

@ -0,0 +1,23 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
[
<#assign dispatched_datetime = RfxDateTimetoUTC(preparationOrder.stock_despatch_at_preparation_datetime,time_zone_offset_rfx) />
<#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line>
<#list preparation_line.despatched_ipg_list as despatched_ipg>
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${despatched_ipg.carton_number}",
"RefDate": {
"DateTime": "${dispatched_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": { }
}<#sep>,</#sep>
</#list>
<#sep>,</#sep>
</#list>
]

View File

@ -9,11 +9,7 @@
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
<#if despatched_ipg.carton_number != "000000000000000000">
"RefID": "${despatched_ipg.carton_number}",
<#else>
"RefID": "${despatched_ipg.hd_number}", "RefID": "${despatched_ipg.hd_number}",
</#if>
"RefDate": { "RefDate": {
"DateTime": "${dispatched_datetime}", "DateTime": "${dispatched_datetime}",
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"

View File

@ -0,0 +1,128 @@
<#include "HfRpConfig.ftl">
[
<#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line>
<#list preparation_line.despatched_ipg_list as despatched_ipg>
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
<#if despatched_ipg.carton_number != "000000000000000000">
"RefID": "${despatched_ipg.carton_number}"
<#else>
"RefID": "${despatched_ipg.hd_number}"
</#if>
},
"Payload": {
"Information" :{
<#if despatched_ipg.carton_number != "000000000000000000">
"ContainerType": "${despatched_ipg.carton_type_code}"
<#if preparation_line.despatched_cartons_list?? >
<#list preparation_line.despatched_cartons_list?filter(l ->l.carton_number==despatched_ipg.carton_number) as dimensionCarton>
,
"Length": {
"Unit": "${length_unit_rfx}",
"Value": "${dimensionCarton.overall_depth}"
},
"Weight": {
"Unit": "${weight_unit_rfx}",
"Value": "${dimensionCarton.carton_gross_weight}"
},
"Height": {
"Unit": "${length_unit_rfx}",
"Value": "${dimensionCarton.overall_height}"
},
"Width": {
"Unit": "${length_unit_rfx}",
"Value": "${dimensionCarton.overall_width}"
}
</#list>
</#if>
<#else>
"ContainerType": "${despatched_ipg.hd_type_code?json_string}"
<#if preparation_line.despatched_hds_list??>
<#list preparation_line.despatched_hds_list?filter(j ->j.handling_device_number==despatched_ipg.hd_number) as dimensionHU>
,
"Length": {
"Unit": "${length_unit_rfx}",
"Value": "${dimensionHU.hd_type_depth}"
},
"Weight": {
"Unit": "${weight_unit_rfx}",
"Value": "${dimensionHU.hd_gross_weight}"
},
"Width": {
"Unit": "${length_unit_rfx}",
"Value": "${dimensionHU.hd_type_width}"
}
</#list>
</#if>
</#if>
},
<#-- HU Metadata inclusin inclusion -->
<#include "RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl">
,
"PreparedContents" :[
{
"Goods": {
"ItemID": "${preparation_line.item_code?trim?json_string}",
"LVBranchID": "${preparation_line.item_lv_code?json_string}",
<#if (despatched_ipg.ipg_manufacture_date?length != 0) && (despatched_ipg.ipg_manufacture_date?starts_with("00") == false)>
<#assign priority_date = despatched_ipg.ipg_manufacture_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
<#if (despatched_ipg.ipg_receipt_date?length != 0) && (despatched_ipg.ipg_receipt_date?starts_with("00")== false)>
<#assign priority_date = despatched_ipg.ipg_receipt_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
<#if (despatched_ipg.ipg_best_before_date?length != 0) && (despatched_ipg.ipg_best_before_date?starts_with("00")== false)>
<#assign priority_date = despatched_ipg.ipg_best_before_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
<#if (despatched_ipg.ipg_sell_by_date?length != 0) && (despatched_ipg.ipg_sell_by_date?starts_with("00")== false)>
<#assign priority_date = despatched_ipg.ipg_sell_by_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
<#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}",
<#else>
<#if (preparationOrder.stock_despatch_at_preparation_datetime?length != 0) && (preparationOrder.stock_despatch_at_preparation_datetime?starts_with("00")== false)>
<#assign priority_date = preparationOrder.stock_despatch_at_preparation_datetime?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
"PriorityDate": "1970-01-01T00:00:00Z",
</#if>
</#if>
</#if>
</#if>
</#if>
</#if>
<#-- Segmentation Keys inclusion -->
<#include "RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl">
},
"ExecutionflowID": "${preparation_line.preparation_order_originator_reference?trim?json_string}",
<#if (preparation_line.pro_originator_reference_line_number!0) != 0>
"LineID": "${preparation_line.pro_originator_reference_line_number}",
<#else>
"LineID": "${preparation_line.pro_line_number!0}",
</#if>
"ActorID": "${preparationOrder.physical_depot_code?trim?json_string}",
"Quantity": {
"LVID": "${quantity_in_base_lv_RP_Cst}",
"Value": ${despatched_ipg.quantity_lvs}
}
}
]
}
}<#sep>,</#sep>
</#list>
<#sep>,</#sep>
</#list>
]

View File

@ -0,0 +1,18 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID":{
"RefID": "${preparationOrder.preparation_line_lst[0].preparation_order_originator_reference?trim?json_string}"
},
"Payload":{
"Carrier": {
"ActorID":"${preparationOrder.load_data.carrier_code?trim?json_string}"
}
}
}
]

View File

@ -1,20 +1,27 @@
<#include "HfRpConfig.ftl"> <#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl"> <#include "ReflexUtils.ftl">
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${despatched_ipg.consignment_unit_id?trim?json_string}" "RefID": "${despatched_ipg.consignment_unit_id?trim?json_string}"
}, },
"Payload": { "Payload": {
<#if despatched_ipg.carton_number != "000000000000000000"> <#if despatched_ipg.carton_number != "000000000000000000">
"HandlingunitID": "${despatched_ipg.carton_number}" "HandlingunitID": "${despatched_ipg.carton_number}"
<#else> <#else>
"HandlingunitID": "${despatched_ipg.hd_number}" "HandlingunitID": "${despatched_ipg.hd_number}"
</#if> </#if>
<#if preparationOrder.load_data?? && preparationOrder.load_data.carrier_code?? && preparationOrder.load_data.carrier_code!="" >
,
"HUCarrier":{
"ActorID": "${preparationOrder.load_data.carrier_code?json_string}"
}
</#if>
} }
} }
] ]

View File

@ -3,7 +3,7 @@
<#-- project : projectId in ReflexPlatform --> <#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform --> <#-- organisation : organisationtId in ReflexPlatform -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project> <#assign projectRP = project>
<#assign organisationRP = organisation> <#assign organisationRP = organisation>
@ -14,48 +14,48 @@
<#case "U"> <#case "U">
<#-- *********************************************** Action = CREATE or UPDATE ******************** --> <#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign preparation_order = JsonUtil.jsonToMap(dataRfx)> <#assign preparation_order = JsonUtil.jsonToMap(dataRfx)>
[ [
{ {
<#if preparation_order.originator_reference?? && preparation_order.originator_reference!=""> <#if preparation_order.originator_reference?? && preparation_order.originator_reference!="">
<#-- check preparation type code (internal order and reservation are ignored) --> <#-- check preparation type code (internal order and reservation are ignored) -->
<#if preparation_order.preparation_type_code == "010" || preparation_order.preparation_type_code == "030"> <#if preparation_order.preparation_type_code == "010" || preparation_order.preparation_type_code == "030">
<#-- Only if preparation order not confirmed --> <#-- Only if preparation order not confirmed -->
<#if preparation_order.preparation_order_confirmed == "false" > <#if preparation_order.preparation_order_confirmed == "false" >
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl"> <#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl">
<#else> <#else>
<#stop "preparation order already confirmed"> <#stop "preparation order already confirmed">
</#if> </#if>
<#else> <#else>
<#stop "preparation order type not supported"> <#stop "preparation order type not supported">
</#if> </#if>
<#else> <#else>
<#stop "PRO reference is empty"> <#stop "PRO reference is empty">
</#if> </#if>
} }
] ]
<#break> <#break>
<#case "D"> <#case "D">
<#-- *********************************************** Action = DELETE ******************** --> <#-- *********************************************** Action = DELETE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign preparation_order = JsonUtil.jsonToMap(dataRfx)> <#assign preparation_order = JsonUtil.jsonToMap(dataRfx)>
[ [
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrPro_ExecutionflowCancelled.ftl"> <#include "RFXtoRP_HsrPro_ExecutionflowCancelled.ftl">
} }
] ]
<#break> <#break>
<#default> <#default>
<#stop "event not supported"> <#stop "event not supported">
</#switch> </#switch>

View File

@ -2,9 +2,9 @@
<#include "ReflexUtils.ftl"> <#include "ReflexUtils.ftl">
<#assign preparation_status_datetime = RfxDateTimetoUTC(preparation_order.modification_datetime,time_zone_offset_rfx) /> <#assign preparation_status_datetime = RfxDateTimetoUTC(preparation_order.modification_datetime,time_zone_offset_rfx) />
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${preparation_order.originator_reference?trim?json_string}", "RefID": "${preparation_order.originator_reference?trim?json_string}",

View File

@ -1,57 +1,57 @@
<#include "HfRpConfig.ftl"> <#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl"> <#include "ReflexUtils.ftl">
[ [
{ {
<#assign planned_final_delivery_start_datetime = RfxDateTimetoUTC(preparation_order.planned_final_delivery_start_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) /> <#assign pro_creation_datetime = RfxDateTimetoUTC(preparation_order.creation_datetime,time_zone_offset_rfx) />
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${preparation_order.originator_reference?trim?json_string}", "RefID": "${preparation_order.originator_reference?trim?json_string}",
"RefDate": { "RefDate": {
"DateTime": "${pro_creation_datetime}", "DateTime": "${pro_creation_datetime}",
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"
} }
}, },
"Payload": { "Payload": {
"CreationDateTime": { "CreationDateTime": {
"DateTime": "${pro_creation_datetime}", "DateTime": "${pro_creation_datetime}",
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"
}, },
<#-- Header Metadata inclusion --> <#-- Header Metadata inclusion -->
<#include "RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl">, <#include "RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl">,
<#-- Add transport grade code <#-- Add transport grade code
<#if preparation_order.transport_grade_code!=""> <#if preparation_order.transport_grade_code!="">
"CarrierService":"${preparation_order.transport_grade_code?trim?json_string}", "CarrierService":"${preparation_order.transport_grade_code?trim?json_string}",
</#if> --> </#if> -->
"ShipFrom": { "ShipFrom": {
"ActorID": "${preparation_order.physical_depot_code?trim?json_string}" "ActorID": "${preparation_order.physical_depot_code?trim?json_string}"
}, },
"ShipFromAcked": true, "ShipFromAcked": true,
"ShipTo": { "ShipTo": {
<#if <#if
<#-- preparation_order.address.type_code == "" && <#-- preparation_order.address.type_code == "" &&
preparation_order.address.title_code == "" && preparation_order.address.title_code == "" &&
preparation_order.address.first_name == "" && preparation_order.address.first_name == "" &&
preparation_order.address.last_name == "" && preparation_order.address.last_name == "" &&
preparation_order.address.mail_address == "" && preparation_order.address.mail_address == "" &&
preparation_order.address.contact_type_code == "" && preparation_order.address.contact_type_code == "" &&
preparation_order.address.mobile_phone_number == "" && preparation_order.address.mobile_phone_number == "" &&
preparation_order.address.land_line_phone_number == "" && preparation_order.address.land_line_phone_number == "" &&
preparation_order.address.fax_number == "" && --> preparation_order.address.fax_number == "" && -->
preparation_order.address.address_type_code == "" && preparation_order.address.address_type_code == "" &&
preparation_order.address.name_or_company_name == "" && preparation_order.address.name_or_company_name == "" &&
preparation_order.address.additional_address_data_1 == "" && preparation_order.address.additional_address_data_1 == "" &&
preparation_order.address.additional_address_data_2 == "" && preparation_order.address.additional_address_data_2 == "" &&
preparation_order.address.post_code_area_name == "" && preparation_order.address.post_code_area_name == "" &&
preparation_order.address.territorial_division_code == "" && preparation_order.address.territorial_division_code == "" &&
preparation_order.address.postal_code == "" && preparation_order.address.postal_code == "" &&
preparation_order.address.iso_country_code == ""> preparation_order.address.iso_country_code == "">
"ActorID": "${preparation_order.end_consignee_code}" "ActorID": "${preparation_order.end_consignee_code}"
<#else> <#else>
"Actor": "Actor":
{ {
"Name" : "${preparation_order.address.name_or_company_name?json_string!""}", "Name" : "${preparation_order.address.name_or_company_name?json_string!""}",
"Address" : "Address" :
{ {
@ -63,62 +63,62 @@
"StreetAddressThree" : "${preparation_order.address.additional_address_data_2?json_string!""}" "StreetAddressThree" : "${preparation_order.address.additional_address_data_2?json_string!""}"
} }
}, },
"Contact" : "Contact" :
{ {
"FirstName" : "${preparation_order.address.first_name?json_string!""}", "FirstName" : "${preparation_order.address.first_name?json_string!""}",
"LastName" : "${preparation_order.address.last_name?json_string!""}", "LastName" : "${preparation_order.address.last_name?json_string!""}",
"Emails" : ${splitEmailsIntoArray(preparation_order.address.mail_address!""?json_string)}, "Emails" : ${splitEmailsIntoArray(preparation_order.address.mail_address!""?json_string)},
"Phones" : ["${preparation_order.address.mobile_phone_number?json_string!""}","${preparation_order.address.land_line_phone_number?json_string!""}", "${preparation_order.address.fax_number?json_string!""}" ] "Phones" : ["${preparation_order.address.mobile_phone_number?json_string!""}","${preparation_order.address.land_line_phone_number?json_string!""}", "${preparation_order.address.fax_number?json_string!""}" ]
} }
</#if> </#if>
}, },
<#if preparation_order.line_list??> <#if preparation_order.line_list??>
"Lines" : [ "Lines" : [
<#list preparation_order.line_list as preparation_order_line > <#list preparation_order.line_list as preparation_order_line >
{ {
<#if (preparation_order_line.originator_reference_line_number!0) != 0> <#if (preparation_order_line.originator_reference_line_number!0) != 0>
"LineID": "${preparation_order_line.originator_reference_line_number}", "LineID": "${preparation_order_line.originator_reference_line_number}",
<#else> <#else>
"LineID": "${preparation_order_line.preparation_order_line_number!0}", "LineID": "${preparation_order_line.preparation_order_line_number!0}",
</#if> </#if>
<#-- Line Metadata inclusion --> <#-- Line Metadata inclusion -->
<#include "RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl">, <#include "RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl">,
"RequestedContent": "RequestedContent":
{ {
"Goods": "Goods":
{ {
"ItemID": "${preparation_order_line.item_code?trim?json_string!"0"}", "ItemID": "${preparation_order_line.item_code?trim?json_string!"0"}",
"LVBranchID": "${preparation_order_line.item_lv_code?json_string!"0"}", "LVBranchID": "${preparation_order_line.item_lv_code?json_string!"0"}",
<#if (preparation_order_line.optional_attributes.forced_priority_date?length != 0) && (preparation_order_line.optional_attributes.forced_priority_date?starts_with("00") == false)> <#if (preparation_order_line.optional_attributes.forced_priority_date?length != 0) && (preparation_order_line.optional_attributes.forced_priority_date?starts_with("00") == false)>
<#assign forced_priority_date = preparation_order_line.optional_attributes.forced_priority_date?datetime(rfx_date_format_default)?iso_utc /> <#assign forced_priority_date = preparation_order_line.optional_attributes.forced_priority_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${forced_priority_date}", "PriorityDate": "${forced_priority_date}",
</#if> </#if>
<#-- Segmentation Keys inclusion --> <#-- Segmentation Keys inclusion -->
<#include "RFXtoRP_HsrPro_ExecutionflowDetected_SegmentationKeys.ftl"> <#include "RFXtoRP_HsrPro_ExecutionflowDetected_SegmentationKeys.ftl">
}, },
"Quantity" : "Quantity" :
{ {
"LVID": "${quantity_in_base_lv_RP_Cst}", "LVID": "${quantity_in_base_lv_RP_Cst}",
"Value": "${preparation_order_line.base_lv_quantity_to_prepare!0}" "Value": "${preparation_order_line.base_lv_quantity_to_prepare!0}"
} }
} }
}<#sep>,</#sep> }<#sep>,</#sep>
</#list> </#list>
], ],
</#if> </#if>
"RequestedMilestones" : "RequestedMilestones" :
{ {
"RequestedDeliveryDateTime" : "RequestedDeliveryDateTime" :
{ {
"DateTime": "${planned_final_delivery_start_datetime}", "DateTime": "${planned_final_delivery_start_datetime}",
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"
} }
} }
} }
} }
] ]

View File

@ -3,7 +3,7 @@
<#-- project : projectId in ReflexPlatform --> <#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform --> <#-- organisation : organisationtId in ReflexPlatform -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)> <#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project> <#assign projectRP = project>
<#assign organisationRP = organisation> <#assign organisationRP = organisation>
@ -12,85 +12,85 @@
<#switch cloudEventMsg.action> <#switch cloudEventMsg.action>
<#case "C"> <#case "C">
<#-- *********************************************** Action = CREATE ******************** --> <#-- *********************************************** Action = CREATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign receipt = JsonUtil.jsonToMap(dataRfx)> <#assign receipt = JsonUtil.jsonToMap(dataRfx)>
<#if receipt.receipt_reference ?? && receipt.receipt_reference!=""> <#if receipt.receipt_reference ?? && receipt.receipt_reference!="">
<#if receipt.receipt_type = "030"> <#if receipt.receipt_type = "030">
<#stop "ignored message because receipt type = transfert"> <#stop "ignored message because receipt type = transfert">
<#else>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl">
}
]
</#if>
<#else> <#else>
<#stop "Receipt reference is empty"> [
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl">
}
]
</#if> </#if>
<#else>
<#stop "Receipt reference is empty">
</#if>
<#break> <#break>
<#case "U"> <#case "U">
<#-- *********************************************** Action = UPDATE ******************** --> <#-- *********************************************** Action = UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign receipt = JsonUtil.jsonToMap(dataRfx)> <#assign receipt = JsonUtil.jsonToMap(dataRfx)>
[ [
<#if receipt.receipt_confirmed == "true" > <#if receipt.receipt_confirmed == "true" >
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ReceiptCompleted> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptCompleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl"> <#include "RFXtoRP_HsrReceiptList_ExecutionflowReceiptCompleted.ftl">
} }
<#else> <#else>
<#if receipt.receipt_type = "030"> <#if receipt.receipt_type = "030">
<#stop "ignored message because receipt type = transfert"> <#stop "ignored message because receipt type = transfert">
<#else> <#else>
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl"> <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl">
}, },
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl"> <#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl">
} }
</#if> </#if>
</#if> </#if>
] ]
<#break> <#break>
<#case "D"> <#case "D">
<#-- *********************************************** Action = DELETE ******************** --> <#-- *********************************************** Action = DELETE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign receipt = JsonUtil.jsonToMap(dataRfx)> <#assign receipt = JsonUtil.jsonToMap(dataRfx)>
[ [
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl"> <#include "RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl">
} }
] ]
<#break> <#break>
<#default> <#default>
<#stop "event not supported"> <#stop "event not supported">
</#switch> </#switch>

View File

@ -3,9 +3,9 @@
<#assign receipt_status_datetime = RfxDateTimetoUTC(receipt.modification_datetime,time_zone_offset_rfx) /> <#assign receipt_status_datetime = RfxDateTimetoUTC(receipt.modification_datetime,time_zone_offset_rfx) />
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${receipt.receipt_reference?trim?json_string}", "RefID": "${receipt.receipt_reference?trim?json_string}",

View File

@ -1,60 +1,60 @@
<#include "HfRpConfig.ftl"> <#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl"> <#include "ReflexUtils.ftl">
[ [
{ {
<#assign receipt_datetime = RfxDateTimetoUTC(receipt.receipt_datetime,time_zone_offset_rfx) /> <#assign receipt_datetime = RfxDateTimetoUTC(receipt.receipt_datetime,time_zone_offset_rfx) />
<#assign receipt_creation_datetime = RfxDateTimetoUTC(receipt.creation_datetime,time_zone_offset_rfx) /> <#assign receipt_creation_datetime = RfxDateTimetoUTC(receipt.creation_datetime,time_zone_offset_rfx) />
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${receipt.receipt_reference?trim?json_string}", "RefID": "${receipt.receipt_reference?trim?json_string}",
"RefDate": { "RefDate": {
"DateTime": "${receipt_creation_datetime}", "DateTime": "${receipt_creation_datetime}",
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"
} }
}, },
"Payload": { "Payload": {
"CreationDateTime": { "CreationDateTime": {
"DateTime": "${receipt_creation_datetime}", "DateTime": "${receipt_creation_datetime}",
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"
}, },
<#-- Header Metadata inclusion --> <#-- Header Metadata inclusion -->
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl">, <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl">,
"ShipFrom": "ShipFrom":
{ {
"ActorID": "${receipt.original_code?trim?json_string}" "ActorID": "${receipt.original_code?trim?json_string}"
}, },
"ShipTo" : "ShipTo" :
{ {
"ActorID": "${receipt.physical_depot_code?trim?json_string}" "ActorID": "${receipt.physical_depot_code?trim?json_string}"
}, },
"ShipToAcked": true, "ShipToAcked": true,
<#if receipt.carrier_informations.carrier_code != ""> <#if receipt.carrier_informations.carrier_code != "">
"Carrier" : {"ActorID": "${receipt.carrier_informations.carrier_code?trim?json_string}"}, "Carrier" : {"ActorID": "${receipt.carrier_informations.carrier_code?trim?json_string}"},
</#if> </#if>
<#if receipt.line_list??> <#if receipt.line_list??>
"Lines" : [ "Lines" : [
<#list receipt.line_list as line> <#list receipt.line_list as line>
{ {
"LineID": "${line.receipt_line_number}", "LineID": "${line.receipt_line_number}",
<#-- Line Metadata inclusion --> <#-- Line Metadata inclusion -->
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl">, <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl">,
"RequestedContent": "RequestedContent":
{ {
"Goods": "Goods":
{ {
"ItemID": "${line.item_code?trim?json_string!"0"}", "ItemID": "${line.item_code?trim?json_string!"0"}",
"LVBranchID": "${line.item_lv_code?json_string!"0"}", "LVBranchID": "${line.item_lv_code?json_string!"0"}",
<#if line.line_without_detail??> <#if line.line_without_detail??>
<#if (line.line_without_detail.priority_date?length != 0) && (line.line_without_detail.priority_date?starts_with("00") == false)> <#if (line.line_without_detail.priority_date?length != 0) && (line.line_without_detail.priority_date?starts_with("00") == false)>
<#assign line_without_detail_priority_date = line.line_without_detail.priority_date?datetime(rfx_date_format_default)?iso_utc /> <#assign line_without_detail_priority_date = line.line_without_detail.priority_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${line_without_detail_priority_date}", "PriorityDate": "${line_without_detail_priority_date}",
</#if> </#if>
<#else> <#else>
<#stop > <#stop >
@ -62,26 +62,26 @@
<#-- Segmentation Keys inclusion --> <#-- Segmentation Keys inclusion -->
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_SegmentationKeys.ftl"> <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_SegmentationKeys.ftl">
}, },
"Quantity" : "Quantity" :
{ {
"LVID": "${quantity_in_base_lv_RP_Cst}", "LVID": "${quantity_in_base_lv_RP_Cst}",
"Value": "${line.order_quantity_in_lv!0}" "Value": "${line.order_quantity_in_lv!0}"
} }
} }
} }
<#sep>,</#sep> <#sep>,</#sep>
</#list> </#list>
], ],
</#if> </#if>
"RequestedMilestones" : "RequestedMilestones" :
{ {
"RequestedDeliveryDateTime" : "RequestedDeliveryDateTime" :
{ {
"DateTime": "${receipt_datetime}", "DateTime": "${receipt_datetime}",
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"
} }
} }
} }
} }

View File

@ -2,9 +2,9 @@
<#include "ReflexUtils.ftl"> <#include "ReflexUtils.ftl">
<#assign receipt_status_datetime = RfxDateTimetoUTC(receipt.confirmation_datetime,time_zone_offset_rfx) /> <#assign receipt_status_datetime = RfxDateTimetoUTC(receipt.confirmation_datetime,time_zone_offset_rfx) />
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${receipt.receipt_reference?trim?json_string}", "RefID": "${receipt.receipt_reference?trim?json_string}",

View File

@ -3,9 +3,9 @@
<#assign receipt_status_datetime = RfxDateTimetoUTC(receipt.creation_datetime,time_zone_offset_rfx) /> <#assign receipt_status_datetime = RfxDateTimetoUTC(receipt.creation_datetime,time_zone_offset_rfx) />
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${receipt.receipt_reference?trim?json_string}", "RefID": "${receipt.receipt_reference?trim?json_string}",
@ -14,8 +14,8 @@
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"
} }
}, },
"Payload": {} "Payload": {}
} }
] ]

View File

@ -2,9 +2,9 @@
[ [
<#assign UUID = UUID.randomUUID()> <#assign UUID = UUID.randomUUID()>
<#assign strJsonBody = JsonUtil.espaceQuoteInJsonString(restResponseBody)> <#assign strJsonBody = JsonUtil.espaceQuoteInJsonString(restResponseBody)>
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${UUID}", "RefID": "${UUID}",
@ -12,7 +12,7 @@
"DateTime": "${aDateTime?iso_utc}", "DateTime": "${aDateTime?iso_utc}",
"AuthorTimeZone": "${time_zone_rfx}" "AuthorTimeZone": "${time_zone_rfx}"
} }
}, },
"Payload": { "Payload": {
<#assign severity = SeverityLevel.ERROR> <#assign severity = SeverityLevel.ERROR>
"Severity": "${severity}", "Severity": "${severity}",
@ -35,7 +35,7 @@
"ContextPayload": "rfxresponse", "ContextPayload": "rfxresponse",
"Type": "RP_EXECUTIONFLOW_EVENT", "Type": "RP_EXECUTIONFLOW_EVENT",
"Task": "${id.apiRestReflexID}", "Task": "${id.apiRestReflexID}",
"OriginalID": "${id.refid}", "OriginalID": "${id.refid?trim?json_string}",
"StackTrace": "" "StackTrace": ""
} }
} }

View File

@ -1,15 +1,15 @@
[ [
{ {
"Header": { "Header": {
"ProjectID": "${projectRP}" "ProjectID": "${projectRP}"
}, },
"ID": { "ID": {
"RefID": "${id.refid}" "RefID": "${id.refid}"
}, },
"Payload": { "Payload": {
"ShipFromAcked": true "ShipFromAcked": true
} }
} }
] ]

View File

@ -3,8 +3,8 @@
<#-- project : projectId in ReflexPlatform --> <#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform --> <#-- organisation : organisationtId in ReflexPlatform -->
<#assign restResponsetMsg = JsonUtil.jsonToMap(input)> <#assign restResponsetMsg = JsonUtil.jsonToMap(input)>
<#assign id = JsonUtil.jsonToMap(restResponsetMsg.id)> <#assign id = JsonUtil.jsonToMap(restResponsetMsg.id)>
<#assign projectRP = project> <#assign projectRP = project>
<#assign organisationRP = organisation> <#assign organisationRP = organisation>
@ -18,91 +18,115 @@
<#case 201> <#case 201>
<#-- *********************************************** ApiRestID = preparation_orders_post ******************** --> <#-- *********************************************** ApiRestID = preparation_orders_post ******************** -->
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)>
<#if preparationOrderPostResponse.status?? && preparationOrderPostResponse.status == "SUCCESS" > <#if preparationOrderPostResponse.status?? && preparationOrderPostResponse.status == "SUCCESS" >
[ [
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowShipFromAcked> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowShipFromAcked>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_PrepOrder_ShipFromAcked.ftl"> <#include "RFXtoRP_PrepOrder_ShipFromAcked.ftl">
} }
] ]
<#else> <#else>
[ [
{ {
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_PlatformLogCreate.ftl"> <#include "RFXtoRP_PlatformLogCreate.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_RestResponseAllocationError.ftl">
} }
] ]
</#if> </#if>
<#break> <#break>
<#default> <#default>
[ [
{ {
<#if restResponsetMsg.body?? > <#if restResponsetMsg.body?? >
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#else> <#else>
<#assign restResponseBody = "{}" /> <#assign restResponseBody = "{}" />
</#if> </#if>
<#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_PlatformLogCreate.ftl"> <#include "RFXtoRP_PlatformLogCreate.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_RestResponseAllocationError.ftl">
} }
] ]
</#switch> </#switch>
<#break> <#break>
<#case "receipts_post"> <#case "receipts_post">
<#switch restResponsetMsg.status> <#switch restResponsetMsg.status>
<#case 200> <#case 200>
<#case 201> <#case 201>
<#-- *********************************************** ApiRestID = receipts_post ******************** --> <#-- *********************************************** ApiRestID = receipts_post ******************** -->
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)> <#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)>
<#if preparationOrderPostResponse.status?? && preparationOrderPostResponse.status == "SUCCESS" > <#if preparationOrderPostResponse.status?? && preparationOrderPostResponse.status == "SUCCESS" >
[ [
{ {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowShipToAcked> <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowShipToAcked>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_Receipt_ShipToAcked.ftl"> <#include "RFXtoRP_Receipt_ShipToAcked.ftl">
} }
] ]
<#else> <#else>
[ [
{ {
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_PlatformLogCreate.ftl"> <#include "RFXtoRP_PlatformLogCreate.ftl">
} },
] {
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_RestResponseAllocationError.ftl">
}
]
</#if> </#if>
<#break> <#break>
<#default> <#default>
[ [
{ {
<#if restResponsetMsg.body?? > <#if restResponsetMsg.body?? >
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) /> <#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#else> <#else>
<#assign restResponseBody = "{}" /> <#assign restResponseBody = "{}" />
</#if> </#if>
<#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate> <#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate>
"apiReflexPlatformID" : "${apiReflexPlatformID}", "apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" : "datas" :
<#include "RFXtoRP_PlatformLogCreate.ftl"> <#include "RFXtoRP_PlatformLogCreate.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowAllocationError>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_RestResponseAllocationError.ftl">
} }
] ]
</#switch> </#switch>
<#break> <#break>
<#default> <#default>
<#stop> <#stop>
</#switch> </#switch>

View File

@ -0,0 +1,20 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${id.refid?trim?json_string}",
"RefDate": {
"DateTime": "${aDateTime?iso_utc}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {}
}
]

View File

@ -2,8 +2,7 @@
<#-- Concat reflex timestamp with reflex time zone and format this date in ISO UTC format --> <#-- Concat reflex timestamp with reflex time zone and format this date in ISO UTC format -->
<#-- --------------------------------------------------------------------------------------- --> <#-- --------------------------------------------------------------------------------------- -->
<#function RfxDateTimetoUTC rfxdatetime offset > <#function RfxDateTimetoUTC rfxdatetime offset >
<#assign datetimeUTC = JsonUtil.createUTCDateTime(rfxdatetime,time_zone_rfx , "yyyy-MM-dd'T'HH:mm:ss") /> <#return ((rfxdatetime + offset)?datetime.iso?iso_utc)>
<#return (datetimeUTC)>
</#function> </#function>
<#-- --------------------------------------------------------------------------------------- --> <#-- --------------------------------------------------------------------------------------- -->
@ -13,15 +12,15 @@
<#-- --------------------------------------------------------------------------------------- --> <#-- --------------------------------------------------------------------------------------- -->
<#function splitEmailsIntoArray emails > <#function splitEmailsIntoArray emails >
<#local str = "["> <#local str = "[">
<#list emails?split(";|,| |à|/","r")?filter(l -> l != "") as email> <#list emails?split(";|,| |à|/","r")?filter(l -> l != "") as email>
<#if email?matches("^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$")> <#if email?matches("^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$")>
<#if str != "["> <#if str != "[">
<#local str += ","> <#local str += ",">
</#if> </#if>
<#local str += "\""> <#local str += "\"">
<#local str += email> <#local str += email>
<#local str += "\""> <#local str += "\"">
</#if> </#if>
</#list> </#list>
<#local str += "]"> <#local str += "]">
<#return (str)> <#return (str)>

View File

@ -1 +1 @@
1.2.13+1 1.2.12+3