Receipts
This commit is contained in:
parent
c3ce993e13
commit
4f9ea8f422
@ -15,7 +15,6 @@
|
||||
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
|
||||
<#assign receipt = JsonUtil.jsonToMap(dataRfx)>
|
||||
[
|
||||
<#if receipt.line_list?? >
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
@ -23,10 +22,6 @@
|
||||
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl">
|
||||
|
||||
}
|
||||
<#else>
|
||||
<#stop "Reception without lines">
|
||||
</#if>
|
||||
|
||||
]
|
||||
<#break>
|
||||
<#case "U">
|
||||
@ -42,16 +37,12 @@
|
||||
<#include "RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl">
|
||||
}
|
||||
<#else>
|
||||
<#if receipt.line_list?? >
|
||||
{
|
||||
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
|
||||
"apiReflexPlatformID" : "${apiReflexPlatformID}",
|
||||
"datas" :
|
||||
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl">
|
||||
}
|
||||
<#else>
|
||||
<#stop "Reception without lines">
|
||||
</#if>
|
||||
</#if>
|
||||
]
|
||||
<#break>
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
<#include "HfRpConfig.ftl">
|
||||
<#include "actors.ftl">
|
||||
<#include "projectCst.ftl">
|
||||
<#include "ReflexUtils.ftl">
|
||||
[
|
||||
{
|
||||
@ -11,6 +9,10 @@
|
||||
},
|
||||
"ID": {
|
||||
"RefID": "${receipt.receipt_reference}"
|
||||
"RefDate": {
|
||||
"DateTime": "${receipt_creation_datetime}",
|
||||
"AuthorTimeZone": "${time_zone_rfx}"
|
||||
}
|
||||
},
|
||||
"Payload": {
|
||||
"CreationDateTime": {
|
||||
@ -19,13 +21,9 @@
|
||||
|
||||
},
|
||||
|
||||
<#-- Metadta inclusion -->
|
||||
"MetaData": [
|
||||
{
|
||||
"Key": "OrderType",
|
||||
"Value": { "String" : "${receipt.receipt_reason_code}"}
|
||||
}
|
||||
],
|
||||
<#-- Header Metadata inclusion -->
|
||||
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl">
|
||||
,
|
||||
"ShipFrom":
|
||||
{
|
||||
"ActorID": "${receipt.original_code}"
|
||||
@ -40,16 +38,19 @@
|
||||
"Carrier" : {"ActorID": "${receipt.carrier_informations.carrier_code}"},
|
||||
</#if>
|
||||
|
||||
<#-- If receipt got lines -->
|
||||
<#if receipt.line_list??>
|
||||
"Lines" : [
|
||||
<#list receipt.line_list as line>
|
||||
|
||||
|
||||
<#-- if receipt type = 030 (transfert) -->
|
||||
<#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}",
|
||||
<#-- Line Metadata inclusion -->
|
||||
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl">,
|
||||
"RequestedContent":
|
||||
{
|
||||
"Goods":
|
||||
@ -57,24 +58,13 @@
|
||||
"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}"}
|
||||
}
|
||||
]
|
||||
|
||||
<#-- Line Segmentation Keys inclusion -->
|
||||
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl">
|
||||
|
||||
},
|
||||
"Quantity" :
|
||||
{
|
||||
@ -84,10 +74,12 @@
|
||||
}
|
||||
}<#sep>,</#sep>
|
||||
</#list>
|
||||
<#-- Réception non transfert -->
|
||||
<#-- receipt type different from transfert non transfert -->
|
||||
<#else>
|
||||
{
|
||||
"LineID": "${line.receipt_line_number}",
|
||||
<#-- Line Metadata inclusion -->
|
||||
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl">,
|
||||
"RequestedContent":
|
||||
{
|
||||
"Goods":
|
||||
@ -99,20 +91,10 @@
|
||||
<#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}"}
|
||||
}
|
||||
]
|
||||
|
||||
<#-- Line Segmentation Keys inclusion -->
|
||||
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineSegmentationKeys.ftl">
|
||||
|
||||
<#else>
|
||||
<#stop "Reception non transfert avec detail">
|
||||
</#if>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user