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