diff --git a/RPtoRFX_AppointmentEvent.ftl b/RPtoRFX_AppointmentEvent.ftl index 7fd725d..647d16b 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 or ReasonUpdated******************** --> - <#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 = Canceled ******************** --> <#case "Canceled">