Files
reflex-wms-connector/RFXtoRP_HsrAntRec_Created.ftl
2026-09-01 16:00:16 +02:00

93 lines
3.1 KiB
Java

<#include "ReflexUtils.ftl">
<#include "HfRpConfig.ftl">
<#include "ActorPrefix.ftl">
[
{
<#assign receipt_datetime = RfxDateTimetoUTCWithTimezone(AncReceipt.planned_receipt_datetime,time_zone_rfx) />
"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"
},
{
"Key": "planned_receipt_datetime",
"Value": "${AncReceipt.planned_receipt_datetime?substring(0,10)?json_string}"
}
],
<#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": {
"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": [ ]
<#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>
}
}
]