diff --git a/RFXtoRP_HsrReceiptList.ftl b/RFXtoRP_HsrReceiptList.ftl index 5a0b680..cfad28e 100644 --- a/RFXtoRP_HsrReceiptList.ftl +++ b/RFXtoRP_HsrReceiptList.ftl @@ -67,11 +67,24 @@ } <#else> <#if receipt.receipt_type?? && receipt.receipt_type == "030" && receipt.receipt_confirmed == "true"> - <#if receipt.origin_order_line_depot?? && receipt.origin_order_line_depot!=""> + <#if receipt.origin_order_line_depot?? && receipt.origin_order_line_depot!="" && receipt.receipt_reference?? && receipt.receipt_reference!=""> <#assign ID = "${receipt.origin_order_line_depot?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_reference?trim?json_string}"/> <#else> - <#assign ID = "R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year}${receipt.receipt_number}"/> + <#if receipt.receipt_reference?? && receipt.receipt_reference!=""> + <#assign ID = "${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_reference?trim?json_string}"/> + <#else> + <#assign ID = "R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year}${receipt.receipt_number}"/> + + <#if receipt.origin_order_line_depot?? && receipt.origin_order_line_depot!="" && receipt.receipt_reference?? && receipt.receipt_reference!=""> + "RefID": "${receipt.origin_order_line_depot?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_reference?trim?json_string}", + <#else> + <#if receipt.receipt_reference?? && receipt.receipt_reference!=""> + "RefID": "${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_reference?trim?json_string}", + <#else> + "RefID": "R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year}${receipt.receipt_number}", + + <#assign payload = '{"Header": {"ProjectID": "${projectRP!""}"},"IDs": [{"RefID": "${ID}"}]}' /> <#assign queryApiReflexPlatformID = QueryApiReflexPlatformID.ExecutionflowGetByIds> <#assign response = QueryApiReflexPlatformCall.call(queryApiReflexPlatformID,payload) /> diff --git a/RFXtoRP_HsrReceiptList_TransfertExecutionflowDetected.ftl b/RFXtoRP_HsrReceiptList_TransfertExecutionflowDetected.ftl index 53b8270..5820692 100644 --- a/RFXtoRP_HsrReceiptList_TransfertExecutionflowDetected.ftl +++ b/RFXtoRP_HsrReceiptList_TransfertExecutionflowDetected.ftl @@ -58,15 +58,11 @@ "DateTime": "${receipt_creation_datetime}", "AuthorTimeZone": "${time_zone_rfx}" }, - <#if receipt.origin_order_line_depot?? && receipt.origin_order_line_depot!="" && receipt.receipt_reference?? && receipt.receipt_reference!=""> - "OrderID": "${receipt.receipt_reference?trim?json_string}", - <#else> <#if receipt.receipt_reference?? && receipt.receipt_reference!=""> "OrderID": "${receipt.receipt_reference?trim?json_string}", <#else> "OrderID": "R${receipt.physical_depot_code?trim?json_string}${receipt.activity_code?trim?json_string}${receipt.originator_code?trim?json_string}${receipt.receipt_year}${receipt.receipt_number}", - <#-- Header Metadata inclusion --> <#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl">, "ShipFrom":