<#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}" }, "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}", <#-- 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>, ] <#if AncReceipt.planned_receipt_datetime?? && AncReceipt.planned_receipt_datetime!="0000-00-00T00:00:00"> , "RequestedMilestones" : { "RequestedDeliveryDateTime" : { "DateTime": "${receipt_datetime}", "AuthorTimeZone": "${time_zone_rfx}" } } <#if AncReceipt.carrier_code?? && AncReceipt.carrier_code != ""> , "Carrier": { "ActorID":"${RFXtoRPprefixCarrier(AncReceipt.carrier_code?trim?json_string)}" } } } ]