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:
@@ -23,11 +23,18 @@ const bulkWriteChanges = ((changes) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!oldReservation.start && !oldReservation.end && !oldReservation.resourceId){
|
if (!oldReservation.start && !oldReservation.end && !oldReservation.resourceId){
|
||||||
|
if (newReservation.canceled){
|
||||||
|
//new reservation created and canceled immediately
|
||||||
|
logEntry.oldResourceId = resourceId;
|
||||||
|
logEntry.oldStart = start;
|
||||||
|
logEntry.newEnd = end;
|
||||||
|
}else{
|
||||||
// new reservation
|
// new reservation
|
||||||
logEntry.oldResourceId = null;
|
logEntry.oldResourceId = null;
|
||||||
logEntry.oldStart = null;
|
logEntry.oldStart = null;
|
||||||
logEntry.oldEnd = null;
|
logEntry.oldEnd = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (newReservation.canceled){
|
if (newReservation.canceled){
|
||||||
logEntry.newResourceId = null;
|
logEntry.newResourceId = null;
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ const createFeeFromBooking = (booking, resourceMappings) => {
|
|||||||
const formattedStartTime = startMoment.format('HH:mm a');
|
const formattedStartTime = startMoment.format('HH:mm a');
|
||||||
const formattedEndTime = endMoment.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 {
|
return {
|
||||||
name: formattedName,
|
name: formattedName,
|
||||||
|
|||||||
Reference in New Issue
Block a user