reflex-wms-connector/RFXtoRP_HsaIpgMove_StockMoved.ftl

68 lines
2.8 KiB
Java

<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#assign MoveType_KV = {"130":"STOCK_MOVEMENT_TYPE_PRODUCTION",
"200":"STOCK_MOVEMENT_TYPE_FIX",
"210":"STOCK_MOVEMENT_TYPE_FIX",
"220":"STOCK_MOVEMENT_TYPE_FIX",
"230":"STOCK_MOVEMENT_TYPE_REQUALIFICATION",
"240":"STOCK_MOVEMENT_TYPE_REQUALIFICATION",
"260":"STOCK_MOVEMENT_TYPE_REQUALIFICATION",
"290":"STOCK_MOVEMENT_TYPE_REQUALIFICATION",
"300":"STOCK_MOVEMENT_TYPE_REQUALIFICATION",
"400":"STOCK_MOVEMENT_TYPE_FIX",
"410":"STOCK_MOVEMENT_TYPE_FIX",
"420":"STOCK_MOVEMENT_TYPE_REQUALIFICATION"}>
<#assign generation_date = RfxDateTimetoUTC(reflexMvtStockInterface.ipg_move_creation_datetime,time_zone_offset_rfx) />
<#assign ipg_priority_datetime = reflexMvtStockInterface.ipg_priority_date?datetime(rfx_date_format_default)?iso_utc />
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"Payload": {
"Goods": {
"ItemID": "${reflexMvtStockInterface.item_code?trim?json_string}",
<#if (reflexMvtStockInterface.ipg_priority_date!="") && (reflexMvtStockInterface.ipg_priority_date?starts_with("00")== false) >
"PriorityDate": "${ipg_priority_datetime}",
<#else>
"PriorityDate": "1970-01-01T00:00:00Z",
</#if>
<#-- Segmentation keys inclusions -->
<#include "RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl">,
"LVBranchID": "${reflexMvtStockInterface.lv_code?json_string}"
},
"ActorID": "${reflexMvtStockInterface.physical_depot_code?trim?json_string}",
"Movement": {
"DateTime": {
"DateTime": "${generation_date}",
"AuthorTimeZone": "${time_zone_rfx}"
},
"Author": "ReflexWMS-${reflexMvtStockInterface.ipg_move_creation_user_code?json_string}",
"ExternalMoveRef" : "${reflexMvtStockInterface.ipg_move_year_number} - ${reflexMvtStockInterface.ipg_move_number}",
"Type": "${MoveType_KV[reflexMvtStockInterface.ipg_move_type]!reflexMvtStockInterface.ipg_move_type}",
"Reason": "${reflexMvtStockInterface.miscellaneous_receipts_despatches_code?json_string}",
"ExternalInfo" : "${reflexMvtStockInterface.stock_move_reference?json_string}",
<#if reflexMvtStockInterface.ipg_move_operation_year_number!= 0>
"OperationReference": "${reflexMvtStockInterface.ipg_move_operation_year_number} - ${reflexMvtStockInterface.ipg_move_operation_number}",
</#if>
"Quantity":
{
"LVID": "${quantity_in_base_lv_RP_Cst}",
<#if reflexMvtStockInterface.move_sign == "+">
"Value": ${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs}
<#else>
"Value": -${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs}
</#if>
}
}
}
}
]