145 lines
4.2 KiB
Java
145 lines
4.2 KiB
Java
<#include "HfRpConfig.ftl">
|
|
<#include "actors.ftl">
|
|
<#include "projectCst.ftl">
|
|
<#include "ReflexUtils.ftl">
|
|
[
|
|
{
|
|
<#assign receipt_datetime = RfxDateTimetoUTC(receipt.receipt_datetime,time_zone_offset_rfx) />
|
|
<#assign receipt_creation_datetime = RfxDateTimetoUTC(receipt.creation_datetime,time_zone_offset_rfx) />
|
|
"Header": {
|
|
"ProjectID": "${projectRP}"
|
|
},
|
|
"ID": {
|
|
"RefID": "${receipt.receipt_reference}"
|
|
},
|
|
"Payload": {
|
|
"CreationDateTime": {
|
|
"DateTime": "${receipt_creation_datetime}",
|
|
"AuthorTimeZone": "${time_zone_rfx}"
|
|
|
|
},
|
|
|
|
<#-- Metadta inclusion -->
|
|
"MetaData": [
|
|
{
|
|
"Key": "OrderType",
|
|
"Value": { "String" : "${receipt.receipt_reason_code}"}
|
|
}
|
|
],
|
|
"ShipFrom":
|
|
{
|
|
"ActorID": "${receipt.original_code}"
|
|
},
|
|
"ShipTo" :
|
|
{
|
|
"ActorID": "${receipt.physical_depot_code}"
|
|
},
|
|
"ShipToAcked": true,
|
|
|
|
<#if receipt.carrier_informations.carrier_code != "">
|
|
"Carrier" : {"ActorID": "${receipt.carrier_informations.carrier_code}"},
|
|
</#if>
|
|
|
|
<#if receipt.line_list??>
|
|
"Lines" : [
|
|
<#list receipt.line_list as line>
|
|
|
|
|
|
<#if receipt.receipt_type = "030">
|
|
<#-- Si réception retour, on a donc du détail -->
|
|
<#list line.line_detail as detail>
|
|
{
|
|
"LineID": "${line.receipt_line_number}${detail.receipt_detail_number}",
|
|
"RequestedContent":
|
|
{
|
|
"Goods":
|
|
{
|
|
"ItemID": "${line.item_code!"0"}",
|
|
"LVBranchID": "${line.item_lv_code!"0"}",
|
|
<#if (detail.priority_date?length != 0) && (detail.priority_date?starts_with("00") == false)>
|
|
<#-- <#assign line_detail_priority_date = JsonUtil.createDateTime(detail.priority_date,time_zone_rfx) /> -->
|
|
<#assign line_detail_priority_date = detail.priority_date?datetime(rfx_date_format_default)?iso_utc />
|
|
"PriorityDate": "${line_detail_priority_date}",
|
|
</#if>
|
|
"SegmentationKeys": [
|
|
{
|
|
"Key": "BatchNumber",
|
|
<#if detail.batch_1 == "">
|
|
"Value": { "String" : "no batch"}
|
|
<#else>
|
|
"Value": { "String" : "${detail.batch_1}"}
|
|
</#if>
|
|
},
|
|
{
|
|
"Key": "Grade",
|
|
"Value": { "String" : "${detail.grade_code}"}
|
|
}
|
|
]
|
|
},
|
|
"Quantity" :
|
|
{
|
|
"LVID": "${quantity_in_base_lv_RP_Cst}",
|
|
"Value": "${detail.confirmation_lv_quantity!0}"
|
|
}
|
|
}
|
|
}<#sep>,</#sep>
|
|
</#list>
|
|
<#-- Réception non transfert -->
|
|
<#else>
|
|
{
|
|
"LineID": "${line.receipt_line_number}",
|
|
"RequestedContent":
|
|
{
|
|
"Goods":
|
|
{
|
|
"ItemID": "${line.item_code!"0"}",
|
|
"LVBranchID": "${line.item_lv_code!"0"}",
|
|
<#if line.line_without_detail??>
|
|
<#if (line.line_without_detail.priority_date?length != 0) && (line.line_without_detail.priority_date?starts_with("00") == false)>
|
|
<#assign line_without_detail_priority_date = line.line_without_detail.priority_date?datetime(rfx_date_format_default)?iso_utc />
|
|
"PriorityDate": "${line_without_detail_priority_date}",
|
|
</#if>
|
|
"SegmentationKeys": [
|
|
{
|
|
"Key": "BatchNumber",
|
|
<#if line.line_without_detail.batch_1 == "">
|
|
"Value": { "String" : "no batch"}
|
|
<#else>
|
|
"Value": { "String" : "${line.line_without_detail.batch_1}"}
|
|
</#if>
|
|
},
|
|
{
|
|
"Key": "Grade",
|
|
"Value": { "String" : "${SegmentationKeys_KV[line.grade_code]!Default_Value_Grade_SegmentationKey}"}
|
|
}
|
|
]
|
|
<#else>
|
|
<#stop "Reception non transfert avec detail">
|
|
</#if>
|
|
},
|
|
"Quantity" :
|
|
{
|
|
"LVID": "${quantity_in_base_lv_RP_Cst}",
|
|
"Value": "${line.order_quantity_in_lv!0}"
|
|
}
|
|
}
|
|
|
|
}
|
|
</#if>
|
|
<#sep>,</#sep>
|
|
</#list>
|
|
],
|
|
</#if>
|
|
|
|
"RequestedMilestones" :
|
|
{
|
|
"RequestedDeliveryDateTime" :
|
|
{
|
|
"DateTime": "${receipt_datetime}",
|
|
"AuthorTimeZone": "${time_zone_rfx}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|