SCPN1-10882

This commit is contained in:
2026-06-09 10:35:38 +02:00
parent bc61336671
commit f54b605e77
10 changed files with 322 additions and 24 deletions

View File

@@ -32,24 +32,15 @@
<#if reflexMvtStockInterface.ipg_move_type?? && reflexMvtStockInterface.ipg_move_type=="120"> <#-- if it is a transfer-type movement -->
<#if reflexMvtStockInterface.origin_order_line_reference?? && reflexMvtStockInterface.origin_order_line_reference!="">
"ExecutionflowID": "${reflexMvtStockInterface.original_receipt_physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.originator_code}${reflexMvtStockInterface.origin_order_line_reference?trim?json_string}",
"OrderID": "${reflexMvtStockInterface.origin_order_line_reference?trim?json_string}",
<#else>
<#if reflexMvtStockInterface.receipt_reference?? && reflexMvtStockInterface.receipt_reference!="" && !reflexMvtStockInterface.receipt_reference?starts_with(reflexMvtStockInterface.original_receipt_physical_depot_code + reflexMvtStockInterface.activity_code + reflexMvtStockInterface.receipt_year_number)>
"ExecutionflowID": "${reflexMvtStockInterface.original_receipt_physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.originator_code}${reflexMvtStockInterface.receipt_reference?trim?json_string}",
"OrderID": "${reflexMvtStockInterface.receipt_reference?trim?json_string}",
<#else>
"ExecutionflowID": "R${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.originator_code}${reflexMvtStockInterface.receipt_year_number}${reflexMvtStockInterface.receipt_number}",
"OrderID": "R${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.originator_code}${reflexMvtStockInterface.receipt_year_number}${reflexMvtStockInterface.receipt_number}",
</#if>
</#if>
<#else>
<#if reflexMvtStockInterface.receipt_reference?? && reflexMvtStockInterface.receipt_reference!="">
"ExecutionflowID": "R${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.originator_code}${reflexMvtStockInterface.receipt_year_number}${reflexMvtStockInterface.receipt_number}",
"OrderID": "${reflexMvtStockInterface.receipt_reference?trim?json_string}",
<#else>
"ExecutionflowID": "R${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.originator_code}${reflexMvtStockInterface.receipt_year_number}${reflexMvtStockInterface.receipt_number}",
"OrderID": "R${reflexMvtStockInterface.physical_depot_code}${reflexMvtStockInterface.activity_code}${reflexMvtStockInterface.originator_code}${reflexMvtStockInterface.receipt_year_number}${reflexMvtStockInterface.receipt_number}",
</#if>
</#if>
<#if reflexMvtStockInterface.origin_order_line_number_reference?? && reflexMvtStockInterface.origin_order_line_number_reference!=0 && reflexMvtStockInterface.ipg_move_type=="120">
"LineID": "${reflexMvtStockInterface.origin_order_line_number_reference}",

View File

@@ -1,5 +1,5 @@
<#-- **** input parameters ***** -->
<#-- input : message HARDIS WMS -->
<#-- input : message HARDIS WMS for anticipated receipt -->
<#-- project : projectId in HARDIS SC NETWORK -->
<#-- organisation : organisationtId in HARDIS SC NETWORK -->
@@ -14,31 +14,61 @@
<#-- *********************************************** Action = CREATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign ancReceipt = JsonUtil.jsonToMap(dataRfx)>
[
<#assign AncReceipt = JsonUtil.jsonToMap(dataRfx)>
[
<#if AncReceipt.line_list?? && AncReceipt.line_list[0]??>
{
<#stop >
}
<#assign apiReflexPlatformID = ApiReflexPlatformID.OrderCreated>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrAntRec_Created.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.OrderReceiptExpected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrAntRec_ReceiptExpected.ftl">
}
]
<#else>
<#stop>
</#if>
<#break>
<#case "U">
<#-- *********************************************** Action = UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign ancReceipt = JsonUtil.jsonToMap(dataRfx)>
<#assign AncReceipt = JsonUtil.jsonToMap(dataRfx)>
[
{
<#stop >
}
<#if AncReceipt.generated?? && AncReceipt.generated.total_level_1_quantity==0 && AncReceipt.generated.total_level_2_quantity==0 && AncReceipt.generated.total_level_3_quantity==0 && AncReceipt.anticipated_receipt_closed == "true" && AncReceipt.all_receipt_validated=="true">
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.OrderCancelled>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrAntRec_Cancelled.ftl">
}
<#else>
<#if AncReceipt.anticipated_receipt_closed == "true" && AncReceipt.all_receipt_validated=="true">
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.OrderReceiptCompleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrAntRec_ReceiptCompleted.ftl">
}
</#if>
</#if>
]
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign ancReceipt = JsonUtil.jsonToMap(dataRfx)>
<#assign AncReceipt = JsonUtil.jsonToMap(dataRfx)>
[
{
<#stop >
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.OrderCancelled>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrAntRec_Cancelled.ftl">
}
]
<#break>

View File

@@ -0,0 +1,25 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#--<#assign receipt_status_datetime = RfxDateTimetoUTCWithTimezone(receipt.creation_datetime,time_zone_rfx) /> -->
<#assign now = .now?string("yyyy-MM-dd'T'HH:mm:ss'Z'") />
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
<#if AncReceipt.anticipated_receipt_reference?? && AncReceipt.anticipated_receipt_reference!="">
"RefID": "${AncReceipt.anticipated_receipt_reference?json_string}",
<#else>
"RefID": "AR-${AncReceipt.physical_depot_code?json_string}${AncReceipt.activity_code?json_string}${AncReceipt.originator_code?json_string}${AncReceipt.anticipated_receipt_year?json_string}${AncReceipt.anticipated_receipt_number?json_string}",
</#if>
"RefDate": {
"DateTime": "${now}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {}
}
]

View File

@@ -0,0 +1,111 @@
<#include "ReflexUtils.ftl">
<#include "HfRpConfig.ftl">
<#include "ActorPrefix.ftl">
[
{
<#assign receipt_datetime = RfxDateTimetoUTCWithTimezone(AncReceipt.planned_receipt_datetime,time_zone_rfx) />
<#assign now = .now?string("yyyy-MM-dd'T'HH:mm:ss'Z'") />
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"CustomFields": [
{
"Key": "anticipated_receipt_reference",
"Value": "${AncReceipt.anticipated_receipt_reference?json_string}"
},
{
"Key": "anticipated_receipt_year",
"Value": "${AncReceipt.anticipated_receipt_year?json_string}"
},
{
"Key": "anticipated_receipt_number",
"Value": "${AncReceipt.anticipated_receipt_number?json_string}"
},
{
"Key": "originator_code",
"Value": "${AncReceipt.originator_code?json_string}"
},
{
"Key": "activity_code",
"Value": "${AncReceipt.activity_code?json_string}"
},
{
"Key": "depot_code",
"Value": "${AncReceipt.physical_depot_code?json_string}"
},
{
"Key": "anticipated",
"Value": "true"
}
],
<#if AncReceipt.anticipated_receipt_reference?? && AncReceipt.anticipated_receipt_reference!="">
"RefID": "${AncReceipt.anticipated_receipt_reference?json_string}"
<#else>
"RefID": "AR-${AncReceipt.physical_depot_code?trim?json_string}${AncReceipt.activity_code?trim?json_string}${AncReceipt.originator_code?trim?json_string}${AncReceipt.anticipated_receipt_year?json_string}${AncReceipt.anticipated_receipt_number?json_string}"
</#if>
},
"Payload": {
"ShipFrom": {
"ActorID": "${RFXtoRPprefixSupplier(AncReceipt.original_code?json_string)}"
},
"ShipTo": {
"ActorID": "${RFXtoRPprefixDepot(AncReceipt.physical_depot_code?json_string)}"
},
"CreationDateTime": {
"DateTime": "${now}",
"AuthorTimeZone": "${time_zone_rfx}"
},
"LanguageCodeISO6391":"fr",
"Anticipated": true,
<#-- Header Metadata inclusion -->
<#include "RFXtoRP_HsrAntRec_Created_HeaderMetadata.ftl">,
"Lines": [
<#-- Lines iteration -->
<#list AncReceipt.line_list?filter(l -> l??) as line>
{
<#if line.anticipated_receipt_reference_line_no?? && line.anticipated_receipt_reference_line_no!=0>
"LineID": "${line.anticipated_receipt_reference_line_no}",
<#else>
"LineID": "${line.anticipated_receipt_line_number}",
</#if>
<#-- Line Metadata inclusion -->
<#include "RFXtoRP_HsrAntRec_Created_LineMetadata.ftl">,
"RequestedContent":{
"Goods":{
"ItemID":"${line.item_code?trim?json_string!"0"}",
"LVBranchID":"${line.item_lv_code?trim?json_string!"0"}",
<#-- Segmentation Keys inclusion -->
<#include "RFXtoRP_HsrAntRec_Created_SegmentationKeys.ftl">
},
"Quantity" :
{
"LVID": "${quantity_in_base_lv_RP_Cst}",
"Value": ${line.planned_quantity_in_base_lv!0}
}
}
}<#sep>,</#sep>
</#list>
]
<#if AncReceipt.planned_receipt_datetime?? && AncReceipt.planned_receipt_datetime!="0000-00-00T00:00:00">
,
"RequestedMilestones" :
{
"RequestedDeliveryDateTime" :
{
"DateTime": "${receipt_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
}
</#if>
<#if AncReceipt.carrier_code?? && AncReceipt.carrier_code != "">
,
"Carrier":
{
"ActorID":"${RFXtoRPprefixCarrier(AncReceipt.carrier_code?trim?json_string)}"
}
</#if>
}
}
]

View File

@@ -0,0 +1,19 @@
<#-- use protobuf of class HsrReceiptList to find HARDIS WMS fields names -->
<#--
<#-- Best practices:
If the SK is of type:
- string: add ?json_string (e.g. "${stock.batch_1?json_string}")
- boolean: possible values: true and false
- datetime: expected format: 2025-10-30T10:12:10.000Z
- decimal number: the separator is a point (e.g. 10.5)
"MetaData": [
{
"Key": "OrderType",
"Value": { "String" : "${order.optional_attributes.reason_code}"}
}
],
-->
"MetaData": [ ]

View File

@@ -0,0 +1,10 @@
<#-- use protobuf of class HsrReceiptList to find HARDIS WMS fields names -->
<#-- Best practices:
If the SK is of type:
- string: add ?json_string (e.g. "${stock.batch_1?json_string}")
- boolean: possible values: true and false
- datetime: expected format: 2025-10-30T10:12:10.000Z
- decimal number: the separator is a point (e.g. 10.5)-->
"MetaData": [ ]

View File

@@ -0,0 +1,47 @@
<#-- use protobuf of class HsrReceiptList to find HARDIS WMS fields names -->
<#--
<#-- Best practices:
If the SK is of type:
- string: add ?json_string (e.g. "${stock.batch_1?json_string}")
- boolean: possible values: true and false
- datetime: expected format: 2025-10-30T10:12:10.000Z
- decimal number: the separator is a point (e.g. 10.5)
"SegmentationKeys": [
{
"Key": "Grade",
"Value": { "String" : "${line.grade_code}"}
},
{
"Key": "Owner",
"Value": { "String" : "${line.owner_code}"}
},
{
"Key": "BatchNumber",
<#if reflexMvtStockInterface.batch_1 == "">
"Value": { "String" : "no batch"}
<#else>
"Value": { "String" : "${line_without_detail.batch_1}"}
</#if>
},
{
"Key": "HeldForSpecificCode",
<#if line_without_detail.hold_for_specific_code == "true">
"Value": { "Bool" : "True"}
<#else>
"Value": { "Bool" : "False"}
},
{
<#assign manufacturing_date = line_without_detail.ipg_date_of_manufacture_date?datetime(rfx_date_format_default)?iso_utc />
"Key": "ManufacturingDate",
"Value": "Timestamp": {
"AuthorTimeZone": "${time_zone_rfx}",
"DateTime": "${manufacturing_date}"
}
}
]
-->
"SegmentationKeys": [ ]

View File

@@ -0,0 +1,25 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#--<#assign receipt_status_datetime = RfxDateTimetoUTCWithTimezone(receipt.creation_datetime,time_zone_rfx) /> -->
<#assign now = .now?string("yyyy-MM-dd'T'HH:mm:ss'Z'") />
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
<#if AncReceipt.anticipated_receipt_reference?? && AncReceipt.anticipated_receipt_reference!="">
"RefID": "${AncReceipt.anticipated_receipt_reference?json_string}",
<#else>
"RefID": "AR-${AncReceipt.physical_depot_code?trim?json_string}${AncReceipt.activity_code?trim?json_string}${AncReceipt.originator_code?trim?json_string}${AncReceipt.anticipated_receipt_year?json_string}${AncReceipt.anticipated_receipt_number?json_string}",
</#if>
"RefDate": {
"DateTime": "${now}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {}
}
]

View File

@@ -0,0 +1,25 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#--<#assign receipt_status_datetime = RfxDateTimetoUTCWithTimezone(receipt.creation_datetime,time_zone_rfx) /> -->
<#assign now = .now?string("yyyy-MM-dd'T'HH:mm:ss'Z'") />
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
<#if AncReceipt.anticipated_receipt_reference?? && AncReceipt.anticipated_receipt_reference!="">
"RefID": "${AncReceipt.anticipated_receipt_reference?json_string}",
<#else>
"RefID": "AR-${AncReceipt.physical_depot_code?trim?json_string}${AncReceipt.activity_code?trim?json_string}${AncReceipt.originator_code?trim?json_string}${AncReceipt.anticipated_receipt_year?json_string}${AncReceipt.anticipated_receipt_number?json_string}",
</#if>
"RefDate": {
"DateTime": "${now}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {}
}
]

View File

@@ -33,7 +33,18 @@
{
"Key": "order_number",
"Value": "${receipt.receipt_number}"
},
<#if receipt.line_list[0]?? && receipt.line_list[0].line_anticipated?? && receipt.line_list[0].line_anticipated.anticipated_receipt_year!=0 && receipt.line_list[0].line_anticipated.anticipated_receipt_number!=0 >
{
"Key": "anticipated",
"Value": "true"
}
<#else>
{
"Key": "anticipated",
"Value": "false"
}
</#if>
],
"RefID": "R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year}${receipt.receipt_number}",
"RefDate": {
@@ -63,10 +74,14 @@
"ActorID": "${RFXtoRPprefixDepot(receipt.physical_depot_code?trim?json_string)}"
},
"ShipToAcked": true,
<#if receipt.receipt_reference?? && receipt.receipt_reference!="">
"OrderID":"${receipt.receipt_reference?trim?json_string}",
<#if receipt.line_list[0]?? && receipt.line_list[0].line_anticipated?? && receipt.line_list[0].line_anticipated.anticipated_receipt_year!=0 && receipt.line_list[0].line_anticipated.anticipated_receipt_reference?? && receipt.line_list[0].line_anticipated.anticipated_receipt_reference=="" >
"OrderID":"AR-${receipt.line_list[0].line_anticipated.anticipated_receipt_depot_code?trim?json_string}${receipt.line_list[0].line_anticipated.anticipated_receipt_activity_code?trim?json_string}${receipt.line_list[0].line_anticipated.anticipated_receipt_originator_code?trim?json_string}${receipt.line_list[0].line_anticipated.anticipated_receipt_year}${receipt.line_list[0].line_anticipated.anticipated_receipt_number}",
<#else>
"OrderID":"R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year}${receipt.receipt_number}",
<#if receipt.receipt_reference?? && receipt.receipt_reference!="">
"OrderID":"${receipt.receipt_reference?trim?json_string}",
<#else>
"OrderID":"R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year}${receipt.receipt_number}",
</#if>
</#if>
<#if receipt.carrier_informations.carrier_code != "">
"Carrier":