RP to RFX receipt post

This commit is contained in:
Laure Pascal 2023-10-18 10:48:09 +02:00
parent d067be597b
commit 5401e416a3
6 changed files with 92 additions and 52 deletions

View File

@ -1,5 +1,11 @@
<#-- Note : you can use Order Header Metadata, using the define map : Header_MetaData_Map --> <#-- Note : you can use Order Header Metadata, using the define map : Header_MetaData_Map -->
<#-- How to use MD Header map
Example :
<#assign pick_sequence_code = Header_MetaData_Map["OrderType"]/>
-->
<#assign activity_code = "PEN"/> <#assign activity_code = "PEN"/>
<#assign originator_code = "50000189"/> <#assign originator_code = "50000189"/>
<#assign preparation_type_code = "010"/> <#assign preparation_type_code = "010"/>

View File

@ -1,7 +1,12 @@
<#-- Note : you can use Order Line Metadata, using the define map : Line_MetaData_Map --> <#-- Note : you can use Order Line Metadata, using the define map : Line_MetaData_Map -->
<#-- Note : you can use Order Line Segmentation keys, using the define map : SegmentationKeys_Map --> <#-- Note : you can use Order Line Segmentation keys, using the define map : SegmentationKeys_Map -->
<#assign owner_code_to_prepare = ${SegmentationKeys_Map["myOwner"]}/> <#-- How to use MD or SK map
Example :
<#assign owner_code_to_prepare = SegmentationKeys_Map["Owner"]/>
-->
<#assign owner_code_to_prepare = SegmentationKeys_Map["myOwner"]/>
<#assign grade_code_to_prepare =""/> <#assign grade_code_to_prepare =""/>
<#assign batch_1 =""/> <#assign batch_1 =""/>

View File

@ -1,4 +1,4 @@
<#include "RPtoRFX_Receipt_DefaultData.ftl"> <#include "RPtoRFX_Receipt_DefaultHeaderData.ftl">
<#assign aDateTime = .now> <#assign aDateTime = .now>
{ {
"id" : {"refid" : "${executionflow.OrderID}"}, "id" : {"refid" : "${executionflow.OrderID}"},
@ -6,55 +6,69 @@
"method" : "POST", "method" : "POST",
"uri_substitutions": { "uri_substitutions": {
"activity_code": "${activity_code}", "activity_code": "${activity_code}",
"physical_depot_code": "${ActorID_RPtoRFX[executionflow.ShipTo.ActorID]!executionflow.ShipTo.ActorID}", "physical_depot_code": "${executionflow.ShipTo.ActorID!""}",
"originator_code": "${Reflex_Originator}" "originator_code": "${originator_code}"
}, },
"payload" : "payload" :
{ {
"receipt_reference": "${executionflow.OrderID}", "receipt_reference": "${executionflow.OrderID}",
"receipt_type": "${receipt_type}", "receipt_type": "${receipt_type}",
"receipt_reason_code": "${receipt_reason_code}", "receipt_reason_code": "${receipt_reason_code}",
"work_mode_code" : "${work_mode_code}", "work_mode_code" : "${work_mode_code}",
"original_code" : "${ActorID_RPtoRFX[executionflow.ShipFrom.ActorID]!executionflow.ShipFrom.ActorID}", "original_code" : "${executionflow.ShipFrom.ActorID}",
"carrier_code" : "${ActorID_RPtoRFX[executionflow.Carrier.ActorID]!executionflow.Carrier.ActorID}", "carrier_code" : "${executionflow.Carrier.ActorID!""}",
<#if executionflow.RequestedMilestones?? && executionflow.RequestedMilestones.RequestedDeliveryDateTime??>
"carrier_appointment_start_datetime": "${executionflow.RequestedMilestones.RequestedDeliveryDateTime.DateTime}", <#if executionflow.RequestedMilestones?? && executionflow.RequestedMilestones.RequestedDeliveryDateTime??>
<#else> "receipt_datetime": "${executionflow.RequestedMilestones.RequestedDeliveryDateTime.DateTime}",
"carrier_appointment_start_datetime": "${aDateTime?iso_utc}", <#else>
</#if> "receipt_datetime": "${aDateTime?iso_utc}",
</#if>
<#--
"carrier_appointment_made": "false", "carrier_appointment_made": "false",
"receipt_in_cross_docking": "false", "receipt_in_cross_docking": "false",
"dock_occupation_duration": 10, "dock_occupation_duration": 10,
-->
<#if executionflow.Lines??> <#if executionflow.Lines??>
"line_list": [ "line_list": [
<#list executionflow.Lines as line> <#list executionflow.Lines as line>
{
<#if line.RequestedContent.Goods.SegmentationKeys??> <#-- ******* line MetaData and Segmentationkeys to maps ******** -->
<#assign ic_map = JsonUtil.sequenceToMap(line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") /> <#if executionflow.line.MetaData??>
"owner_code": "${ic_map.Owner.String!"${Default_Value_Owner_SegmentationKey}"}", <#assign Line_MetaData_Map = JsonUtil.sequenceToMap(executionflow.line.MetaData, "Key", "Value") />
"grade_code": "${SegmentationKeys_RPtoRFX[ic_map.Grade.String!""]!"${Default_Value_Grade_SegmentationKey}"}",
"batch_1": "${ic_map.BatchNumber!""}",
</#if>
"receipt_reference_line_no": ${line.LineID?number},
"item_code": "${line.RequestedContent.Goods.ItemID!""}",
"item_lv_code": "${line.RequestedContent.Goods.LVBranchID!""}",
"level_1_quantity": ${line.RequestedMetrics.QuantityInBaseLV.Value!0}
}<#sep>,</#sep>
</#list>
],
</#if> </#if>
"optional_attributes": { <#if executionflow.line.RequestedContent.Goods.SegmentationKeys??>
"held_for_check": "false", <#assign SegmentationKeys_Map = JsonUtil.sequenceToMap(execution.line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") />
"held _for_repacking": "false", </#if>
"hold_for_specific_code": "false", <#include "RPtoRFX_Receipt_DefaultLineData.ftl">
"hold_code": "false"
}, {
"quality_control_attributes": { "receipt_reference_line_no": ${line.LineID?number},
"qcf_to_create_for_receipt_line": "false", "item_code": "${line.RequestedContent.Goods.ItemID!""}",
"exclude_item_from_inspection": "false" "item_lv_code": "${line.RequestedContent.Goods.LVBranchID!""}",
} "level_1_quantity": ${line.RequestedMetrics.QuantityInBaseLV.Value!0},
"owner_code": "${owner_code}",
"grade_code": "${grade_code}",
"batch_1": "${batch_1!""}",
<#--
"optional_attributes": {
"held_for_check": "false",
"held _for_repacking": "false",
"hold_for_specific_code": "false",
"hold_code": "false"
},
-->
"quality_control_attributes": {
<#--"qcf_to_create_for_receipt_line": "false",-->
"exclude_item_from_inspection": "false"
}
}<#sep>,</#sep>
</#list>
],
</#if>
} }
} }

View File

@ -1,9 +0,0 @@
<#assign Default_Value_Owner_SegmentationKey = "PEN"/>
<#assign Default_Value_Grade_SegmentationKey = "STD"/>
<#assign Reflex_Originator = "STANDARD"/>
<#assign work_mode_code = "LPA"/>
<#assign activity_code = "PEN"/>
<#assign receipt_reason_code = "REC"/>
<#assign receipt_type = "010"/>
<#assign ActorID_RPtoRFX = {"J001":"J01","J002":"J02","J003":"J03","J004":"J04","J005":"J05"} >
<#assign SegmentationKeys_RPtoRFX = {"Sales":"SAL","Standard":"STD","Unsaleable":"UNS"}/>

View File

@ -0,0 +1,12 @@
<#-- Note : you can use Order Header Metadata, using the define map : Header_MetaData_Map -->
<#-- How to use MD Header map
Example :
<#assign receipt_type = Header_MetaData_Map["OrderType"]/>
-->
<#assign activity_code = "PEN"/>
<#assign originator_code = "STANDARD"/>
<#assign receipt_type = "010"/>
<#assign receipt_reason_code = "REC"/>
<#assign work_mode_code = "LPA"/>

View File

@ -0,0 +1,12 @@
<#-- Note : you can use Order Line Metadata, using the define map : Line_MetaData_Map -->
<#-- Note : you can use Order Line Segmentation keys, using the define map : SegmentationKeys_Map -->
<#-- How to use MD or SK map
Example :
<#assign owner_code = SegmentationKeys_Map["Owner"]/>
-->
<#assign owner_code = "PEN"/>
<#assign grade_code = "STD"/>
<#assign batch_1 = "STD"/>