diff --git a/RPtoRFX_AppointmentEvent.ftl b/RPtoRFX_AppointmentEvent.ftl index 57a0906..9febf0b 100644 --- a/RPtoRFX_AppointmentEvent.ftl +++ b/RPtoRFX_AppointmentEvent.ftl @@ -28,8 +28,61 @@ <#assign AddComma = false /> <#assign appointment = eventRP.data /> [ - <#if eventRP.commissionsUpdated> - <#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING" && eventRP.addedUnloadCommissions?? && eventRP.addedUnloadCommissions !=""> + <#if appointment?? && (!(appointment.WMSCreated??) || !appointment.WMSCreated) && appointment.Status?? && appointment.Status.Current?? && appointment.Status.Current.StatusCode?? && appointment.Status.Current.StatusCode == AppointmentStatusCode.APPOINTMENT_0150_ALLOCATION_ERROR> + { + <#assign apiRestReflexID = ApiRestReflexID.appointment_post_create> + "apiRestReflexID" : "${apiRestReflexID}", + "datas" : + <#include "RPtoRFX_CarrierAppointmentCreated.ftl"> + } + <#else> + <#if eventRP.commissionsUpdated> + <#if appointment.AppointmentType == "APPOINTMENT_TYPE_UNLOADING" && eventRP.addedUnloadCommissions?? && eventRP.addedUnloadCommissions != ""> + <#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_UNLOADING" && eventRP.removedUnloadCommissions?? && eventRP.removedUnloadCommissions!=""> + <#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 /> + + + <#-- *********************************************** Action = reasonUpdated or slotUpdated ******************** --> + <#if eventRP.reasonUpdated || eventRP.slotUpdated || eventRP.carrierInformationUpdated> + <#if AddComma == true> + , + <#if eventRP.appointmentCustomFields?has_content> { <#assign apiRestReflexID = ApiRestReflexID.appointment_post_physical_receipt_associations_by_number>