Merge branch 'fix-undetected-booking-changes' into 'master'

Fix undetected booking changes

See merge request saburly/psihologija!30
This commit was merged in pull request #30.
This commit is contained in:
Bilal Catic
2019-07-31 08:07:11 +00:00
2 changed files with 12 additions and 5 deletions

View File

@@ -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){

View File

@@ -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,