From be2df9b25eb40ee20a20681534ba75591c893270 Mon Sep 17 00:00:00 2001 From: Laurie Montant Date: Thu, 18 Jun 2026 11:41:27 +0200 Subject: [PATCH] SCPN1-10882 --- RFXtoRP_HsrAntRec.ftl | 12 +++++++--- RFXtoRP_HsrAntRec_AnticipatedClosed.ftl.ftl | 25 +++++++++++++++++++++ RFXtoRP_HsrReceiptList.ftl | 4 +++- 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 RFXtoRP_HsrAntRec_AnticipatedClosed.ftl.ftl diff --git a/RFXtoRP_HsrAntRec.ftl b/RFXtoRP_HsrAntRec.ftl index 192aa28..1c578e2 100644 --- a/RFXtoRP_HsrAntRec.ftl +++ b/RFXtoRP_HsrAntRec.ftl @@ -47,12 +47,18 @@ <#include "RFXtoRP_HsrAntRec_Cancelled.ftl"> } <#else> - <#if AncReceipt.anticipated_receipt_closed == "true" && AncReceipt.all_receipt_validated=="true"> + <#if AncReceipt.anticipated_receipt_closed == "true" > { - <#assign apiReflexPlatformID = ApiReflexPlatformID.OrderReceiptCompleted> + <#assign apiReflexPlatformID = ApiReflexPlatformID.OrderAppointmentBookingDisabled> "apiReflexPlatformID" : "${apiReflexPlatformID}", "datas" : - <#include "RFXtoRP_HsrAntRec_ReceiptCompleted.ftl"> + <#include "RFXtoRP_HsrAntRec_AppointmentBookingDisabled.ftl"> + }, + { + <#assign apiReflexPlatformID = ApiReflexPlatformID.OrderAnticipatedClosed> + "apiReflexPlatformID" : "${apiReflexPlatformID}", + "datas" : + <#include "RFXtoRP_HsrAntRec_AnticipatedClosed.ftl"> } diff --git a/RFXtoRP_HsrAntRec_AnticipatedClosed.ftl.ftl b/RFXtoRP_HsrAntRec_AnticipatedClosed.ftl.ftl new file mode 100644 index 0000000..79bd122 --- /dev/null +++ b/RFXtoRP_HsrAntRec_AnticipatedClosed.ftl.ftl @@ -0,0 +1,25 @@ +<#include "HfRpConfig.ftl"> +<#include "ReflexUtils.ftl"> +<#--<#assign receipt_status_datetime = RfxDateTimetoUTCWithTimezone(receipt.creation_datetime,time_zone_rfx) /> --> +<#assign now = .now?string("yyyy-MM-dd'T'HH:mm:ss'Z'") /> +[ + { + "Header": { + "ProjectID": "${projectRP}" + }, + "ID": { + <#if AncReceipt.anticipated_receipt_reference?? && AncReceipt.anticipated_receipt_reference!=""> + "RefID": "${AncReceipt.anticipated_receipt_reference?json_string}", + <#else> + "RefID": "AR-${AncReceipt.physical_depot_code?json_string}${AncReceipt.activity_code?json_string}${AncReceipt.originator_code?json_string}${AncReceipt.anticipated_receipt_year?json_string}${AncReceipt.anticipated_receipt_number?json_string}", + + "RefDate": { + "DateTime": "${now}", + "AuthorTimeZone": "${time_zone_rfx}" + } + }, + + "Payload": {} + + } +] \ No newline at end of file diff --git a/RFXtoRP_HsrReceiptList.ftl b/RFXtoRP_HsrReceiptList.ftl index 05c2863..edeec2c 100644 --- a/RFXtoRP_HsrReceiptList.ftl +++ b/RFXtoRP_HsrReceiptList.ftl @@ -38,7 +38,7 @@ } ] <#else> - <#if receipt.line_list ?? && receipt.line_list[0]??> + <#if receipt.line_list ?? && receipt.line_list[0]??> <#-- if receipt contains at least one line --> [ { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected> @@ -70,6 +70,7 @@ <#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) /> <#assign receipt = JsonUtil.jsonToMap(dataRfx)> [ + <#-- if receipt is a transfer and confirmed and all lines are cancelled --> <#if receipt.receipt_type?? && receipt.receipt_type == "030" && receipt.receipt_confirmed == "true" && receipt.confirmation_total_level_1==0 && receipt.confirmation_total_level_2==0 && receipt.confirmation_total_level_3==0> { <#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled> @@ -78,6 +79,7 @@ <#include "RFXtoRP_HsrReceiptList_TransfertExecutionflowCancelled.ftl"> } <#else> + <#-- if lines receipt are created when the user treats the receipt --> <#if receipt.receipt_type?? && receipt.receipt_type == "030" && receipt.receipt_confirmed == "true"> <#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}"/>