fix charging reservation changes

This commit is contained in:
Bilal Catic
2019-09-11 12:25:25 +02:00
parent 75524f530a
commit cd77159ea2

View File

@@ -76,7 +76,14 @@ const getIncidentsFromChanges = (changes) => {
const reservationHourlyRate = oldReservation.hourlyRate ? oldReservation.hourlyRate : newReservation.hourlyRate;
const canceled = newReservation.canceled;
if (oldStart && oldEnd && newStart && newEnd && reservationHourlyRate){
// console.log('oldStart : ', oldStart ? oldStart.format() : 'null');
// console.log('oldEnd : ', oldEnd ? oldEnd.format() : 'null ');
// console.log('newStart : ', newStart ? newStart.format() : 'null');
// console.log('newEnd : ', newEnd ? newEnd.format() : 'null');
// console.log('hourly Rate : old : ', oldReservation ? oldReservation.hourlyRate : ' - ', newReservation ? newReservation.hourlyRate : ' - ');
// console.log('Canceled : ', newReservation.canceled);
if (oldStart && oldEnd && newStart && newEnd){
const oldReservationLength = oldEnd.diff(oldStart, 'hours', true);
const newReservationLength = newEnd.diff(newStart, 'hours', true);