reflex-wms-connector/RFXtoRP_HsrPrepa_GoodsPrepared.ftl
2024-01-17 10:00:31 +01:00

89 lines
3.9 KiB
Java

<#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}",
"LVBranchID": "${preparation_line.item_lv_code}",
<#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": "error_date",
</#if>
</#if>
</#if>
</#if>
</#if>
<#-- Segmentation Keys inclusion -->
<#include "RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl">
},
"ExecutionflowID": "${preparation_line.preparation_order_originator_reference}",
<#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}",
"Quantity": {
"LVID": "${quantity_in_base_lv_RP_Cst}",
"Value": ${despatched_ipg.quantity_lvs}
}
}
]
}
}<#sep>,</#sep>
</#list>
<#sep>,</#sep>
</#list>
]