diff --git a/services/integration/bookingChangeLog.js b/services/integration/bookingChangeLog.js index 72dfeeb..c35f5d6 100644 --- a/services/integration/bookingChangeLog.js +++ b/services/integration/bookingChangeLog.js @@ -23,10 +23,17 @@ const bulkWriteChanges = ((changes) => { }; if (!oldReservation.start && !oldReservation.end && !oldReservation.resourceId){ - // new reservation - logEntry.oldResourceId = null; - logEntry.oldStart = null; - logEntry.oldEnd = null; + if (newReservation.canceled){ + //new reservation created and canceled immediately + logEntry.oldResourceId = resourceId; + logEntry.oldStart = start; + logEntry.newEnd = end; + }else{ + // new reservation + logEntry.oldResourceId = null; + logEntry.oldStart = null; + logEntry.oldEnd = null; + } } if (newReservation.canceled){ diff --git a/services/integration/invoiceIntegration.js b/services/integration/invoiceIntegration.js index b54e875..e5048f2 100644 --- a/services/integration/invoiceIntegration.js +++ b/services/integration/invoiceIntegration.js @@ -203,7 +203,7 @@ const createFeeFromBooking = (booking, resourceMappings) => { const formattedStartTime = startMoment.format('HH:mm a'); const formattedEndTime = endMoment.format('HH:mm a'); - const formattedName = `[BOOKING FEES] ${officeName}, ${resourceName}, $${totalCost}, ${reservationLength.toFixed(2)} x $${hourlyRate.toFixed(2)}, ${formattedDate} [${formattedStartTime} - ${formattedEndTime}]`; + const formattedName = `${officeName}, ${resourceName}, $${totalCost}, ${formattedDate} [${formattedStartTime} - ${formattedEndTime}]`; return { name: formattedName,