From 40b4a1672ef3f68eaba9ba8926e53fcdd8bc4ef0 Mon Sep 17 00:00:00 2001 From: Francis Reat Date: Thu, 11 Jun 2026 15:40:52 +0200 Subject: [PATCH] SCPN1-10882 --- RPtoRFX_CarrierAppointmentCreated.ftl | 74 ++++++++++++--------------- 1 file changed, 34 insertions(+), 40 deletions(-) diff --git a/RPtoRFX_CarrierAppointmentCreated.ftl b/RPtoRFX_CarrierAppointmentCreated.ftl index c7f1dc9..7a3671a 100644 --- a/RPtoRFX_CarrierAppointmentCreated.ftl +++ b/RPtoRFX_CarrierAppointmentCreated.ftl @@ -36,47 +36,41 @@ <#include "RPtoRFX_CarrierAppointmentDefaultData.ftl"> <#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_UNLOADING > - <#if appointment.Unloading?? && appointment.Unloading.Projects?? && appointment.Unloading.Projects[0]?? && - appointment.Unloading.Projects[0].Commissions?? && - appointment.Unloading.Projects[0].Commissions[0]?? && appointment.Unloading.Projects[0].Commissions[0].OrderID?? && appointment.Unloading.Projects[0].Commissions[0].OrderID!="" - && appointment.Unloading.Projects[0].Commissions[0].ExecutionflowID?? && appointment.Unloading.Projects[0].Commissions[0].ExecutionflowID == "" > - "anticipated_receipt_list": [ - <#list appointment.Unloading.Projects[0].Commissions?filter(l ->l.OrderID?? && l.OrderID !="") as commission> - <#list eventRP.orderCustomFields.entrySet()?filter(l ->l.key == commission.OrderID && l.value?? && l.value?has_content) as custom> - { - "activity": "${custom.value.activity_code?json_string}", - "originator_code": "${custom.value.originator_code?json_string}", - "anticipated_receipt_reference": "${custom.value.anticipated_receipt_reference?json_string}", - "anticipated_receipt_year": "${custom.value.anticipated_receipt_year?json_string}", - "anticipated_receipt_number": "${custom.value.anticipated_receipt_number?json_string}" - } - <#sep>, - - <#sep>, - - ], + <#if appointment.Unloading?? && appointment.Unloading.Projects?? && + appointment.Unloading.Projects[0]?? && + appointment.Unloading.Projects[0].Commissions??> + "physical_receipt_list": [ + <#list appointment.Unloading.Projects[0].Commissions?filter(l ->l.ExecutionflowID?? && l.ExecutionflowID !="") as commission> + <#list eventRP.executionflowCustomFields.entrySet()?filter(l ->l.key == commission.ExecutionflowID && l.value?? && l.value?has_content) as custom> + { + "receipt_activity": "${custom.value.activity_code?json_string}", + "originator_code": "${custom.value.originator_code?json_string}", + "physical_receipt_reference": "${custom.value.reference?json_string}", + "receipt_year": "${custom.value.order_year?json_string}", + "receipt_number": "${custom.value.order_number?json_string}" + } + <#sep>, + + <#sep>, + + ], + "anticipated_receipt_list": [ + <#list appointment.Unloading.Projects[0].Commissions?filter(l -> (!(l.ExecutionflowID??) || l.ExecutionflowID =="") && (l.OrderID?? && l.OrderID !="")) as commission> + <#list eventRP.orderCustomFields.entrySet()?filter(l ->l.key == commission.OrderID && l.value?? && l.value?has_content) as custom> + { + "activity": "${custom.value.activity_code?json_string}", + "originator_code": "${custom.value.originator_code?json_string}", + "anticipated_receipt_reference": "${custom.value.anticipated_receipt_reference?json_string}", + "anticipated_receipt_year": "${custom.value.anticipated_receipt_year?json_string}", + "anticipated_receipt_number": "${custom.value.anticipated_receipt_number?json_string}" + } + <#sep>, + + <#sep>, + + ], <#else> - <#if appointment.Unloading?? && appointment.Unloading.Projects?? && appointment.Unloading.Projects[0]?? && - appointment.Unloading.Projects[0].Commissions?? && - appointment.Unloading.Projects[0].Commissions[0]?? && appointment.Unloading.Projects[0].Commissions[0].ExecutionflowID?? && appointment.Unloading.Projects[0].Commissions[0].ExecutionflowID!="" > - "physical_receipt_list": [ - <#list appointment.Unloading.Projects[0].Commissions?filter(l ->l.ExecutionflowID?? && l.ExecutionflowID !="") as commission> - <#list eventRP.executionflowCustomFields.entrySet()?filter(l ->l.key == commission.ExecutionflowID && l.value?? && l.value?has_content) as custom> - { - "receipt_activity": "${custom.value.activity_code?json_string}", - "originator_code": "${custom.value.originator_code?json_string}", - "physical_receipt_reference": "${custom.value.reference?json_string}", - "receipt_year": "${custom.value.order_year?json_string}", - "receipt_number": "${custom.value.order_number?json_string}" - } - <#sep>, - - <#sep>, - - ], - <#else> - "appointment_designation":"${(appointment.Reason!"")!?json_string}", - + "appointment_designation":"${(appointment.Reason!"")!?json_string}", <#else> <#if appointment.AppointmentType == AppointmentType.APPOINTMENT_TYPE_LOADING>