SCPN1-10882

This commit is contained in:
2026-06-18 13:22:20 +02:00
parent be2df9b25e
commit 9e2d8d8e31
2 changed files with 76 additions and 24 deletions

View File

@@ -11,38 +11,43 @@
<#switch cloudEventMsg.action>
<#case "C">
<#-- *********************************************** Action = CREATE ******************** -->
<#-- *********************************************** Action = CREATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign ancReceiptLine = JsonUtil.jsonToMap(dataRfx)>
[
<#assign AncReceipt = JsonUtil.jsonToMap(dataRfx)>
[
<#if AncReceipt.line_list?? && AncReceipt.line_list[0]??>
{
<#stop "create anticipated receipt line">
<#assign apiReflexPlatformID = ApiReflexPlatformID.OrderLinesAdded>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HliAntRecLr_OrderLinesAdded.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.OrderReceiptExpected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrAntRec_ReceiptExpected.ftl">
}
]
<#break>
<#else>
<#stop>
</#if>
<#break>
<#case "U">
<#-- *********************************************** Action = UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign ancReceiptLine = JsonUtil.jsonToMap(dataRfx)>
[
{
<#stop "update anticipated receipt line">
}
]
<#break>
<#assign AncReceipt = JsonUtil.jsonToMap(dataRfx)>
<#stop>
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign ancReceiptLine = JsonUtil.jsonToMap(dataRfx)>
[
{
<#stop "delete anticipated receipt line">
}
]
<#break>
<#-- *********************************************** Action = DELETE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign AncReceipt = JsonUtil.jsonToMap(dataRfx)>
<#stop>
<#break>
<#default>
<#stop >
</#switch>

View File

@@ -0,0 +1,47 @@
<#include "ReflexUtils.ftl">
<#include "HfRpConfig.ftl">
<#include "ActorPrefix.ftl">
[
{
"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>
},
"Payload": {
"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>
]
}
}
]