From f1dc82cdf0b98222eebb8a2596ed07242f034503 Mon Sep 17 00:00:00 2001 From: Francis Reat Date: Fri, 20 Feb 2026 13:52:18 +0100 Subject: [PATCH] SCPN1-10276 --- RPtoRFX_AppointmentEvent.ftl | 133 +++++++++++++++++++++-------------- 1 file changed, 79 insertions(+), 54 deletions(-) diff --git a/RPtoRFX_AppointmentEvent.ftl b/RPtoRFX_AppointmentEvent.ftl index 741cf96..d7e5248 100644 --- a/RPtoRFX_AppointmentEvent.ftl +++ b/RPtoRFX_AppointmentEvent.ftl @@ -24,72 +24,95 @@ ] <#break> <#-- *********************************************** Action = CommissionsUpdated ******************** --> - <#case "CommissionsUpdated"> + <#case "Updated"> + <#assign AddComma = false /> <#assign appointment = eventRP.data /> - [ <#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING"> - <#if eventRP.addedCommissions?? && eventRP.addedCommissions!=""> - <#if eventRP.appointmentCustomFields?has_content> - { - <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_number> - "apiRestReflexID" : "${apiRestReflexID}", - "datas" : - <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByNumber.ftl"> - } - <#else> - { - <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_ref> - "apiRestReflexID" : "${apiRestReflexID}", - "datas" : - <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByRef.ftl"> - } - - - <#if eventRP.removedCommissions?? && eventRP.removedCommissions!=""> - <#if eventRP.addedCommissions?? && eventRP.addedCommissions!=""> - , - - - <#if eventRP.appointmentCustomFields?has_content> - { - <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_dissociations_by_number> - "apiRestReflexID" : "${apiRestReflexID}", - "datas" : - <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByNumber.ftl"> - } - <#else> - { - <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_dissociations_by_ref> - "apiRestReflexID" : "${apiRestReflexID}", - "datas" : - <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByRef.ftl"> - } - - - <#else> + [ + <#if eventRP.commissionsUpdated> + <#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING" && eventRP.addedUnloadCommissions?? && eventRP.addedCaddedUnloadCommissionsommissions!=""> <#if eventRP.appointmentCustomFields?has_content> { - <#assign apiRestReflexID = ApiRestReflexID.appointment_put_update_by_number> + <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_number> "apiRestReflexID" : "${apiRestReflexID}", "datas" : - <#include "RPtoRFX_CarrierAppointmentReasonUpdatedByNumber.ftl"> + <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByNumber.ftl"> } <#else> { - <#assign apiRestReflexID = ApiRestReflexID.appointment_put_update_by_ref> + <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_ref> "apiRestReflexID" : "${apiRestReflexID}", "datas" : - <#include "RPtoRFX_CarrierAppointmentReasonUpdatedByRef.ftl"> + <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByRef.ftl"> } + <#assign AddComma = true /> + + <#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING" && eventRP.removedUnloadCommissions?? && eventRP.removedCaddedUnloadCommissionsommissions!=""> + <#if AddComma == true> + , + + + <#if eventRP.appointmentCustomFields?has_content> + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_dissociations_by_number> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByNumber.ftl"> + } + <#else> + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_dissociations_by_ref> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByRef.ftl"> + } + + <#assign AddComma = true /> + + <#if appointment.AppointmentType == "APPOINTMENT_TYPE_LOADING" && eventRP.addedloadCommissions?? && eventRP.addedCaddedloadCommissionsommissions!=""> + <#if eventRP.appointmentCustomFields?has_content> + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_number> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByNumber.ftl"> + } + <#else> + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_ref> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptAssociationByRef.ftl"> + } + + <#assign AddComma = true /> + + <#if appointment.AppointmentType == "APPOINTMENT_TYPE_LOADING" && eventRP.removedloadCommissions?? && eventRP.removedCaddedloadCommissionsommissions!=""> + <#if AddComma == true> + , + + <#if eventRP.appointmentCustomFields?has_content> + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_dissociations_by_number> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByNumber.ftl"> + } + <#else> + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_dissociations_by_ref> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentPhysicalReceiptDissociationByRef.ftl"> + } + + <#assign AddComma = true /> + + + <#if eventRP.reasonUpdated || eventRP.slotUpdated || eventRP.carrierInformationUpdated> + <#if AddComma == true> + , - ] - <#break> -<#-- *********************************************** Action = SlotUpdated or CarrierInformationUpdated ******************** --> - <#case "SlotUpdated"> - <#case "CarrierInformationUpdated"> - <#case "ReasonUpdated"> - <#assign appointment = eventRP.data /> - [ <#if eventRP.appointmentCustomFields?has_content> { <#assign apiRestReflexID = ApiRestReflexID.appointment_put_update_by_number> @@ -105,7 +128,9 @@ <#include "RPtoRFX_CarrierAppointmentSlotOrCarrierInformationUpdatedByRef.ftl"> } - ] + <#assign AddComma = true /> + + ] <#break> <#-- *********************************************** Action = SlotUpdated ******************** --> <#case "Canceled">