fix price and quantity in fee post request
This commit is contained in:
@@ -71,7 +71,7 @@ const createFeeFromIncident = (incident) => {
|
|||||||
|
|
||||||
date = bookingStartMoment.clone().startOf('day').format();
|
date = bookingStartMoment.clone().startOf('day').format();
|
||||||
|
|
||||||
price = incidentPrice.toFixed(2);
|
price = +incidentPrice.toFixed(2);
|
||||||
quantity = 1.00;
|
quantity = 1.00;
|
||||||
// priceExplanation = `$${price}, 1 x $${price.toFixed(2)}`;
|
// priceExplanation = `$${price}, 1 x $${price.toFixed(2)}`;
|
||||||
break;
|
break;
|
||||||
@@ -84,8 +84,8 @@ const createFeeFromIncident = (incident) => {
|
|||||||
|
|
||||||
date = bookingStartMoment.clone().startOf('day').format();
|
date = bookingStartMoment.clone().startOf('day').format();
|
||||||
|
|
||||||
price = chargePrice.toFixed(2);
|
price = +chargePrice.toFixed(2);
|
||||||
quantity = timeIntervalsToCharge.toFixed(2);
|
quantity = +timeIntervalsToCharge.toFixed(2);
|
||||||
// priceExplanation = `$${totalChargeFee.toFixed(2)}, ${quantity} x $${price.toFixed(2)}`;
|
// priceExplanation = `$${totalChargeFee.toFixed(2)}, ${quantity} x $${price.toFixed(2)}`;
|
||||||
break;
|
break;
|
||||||
case incidentType.UNSCHEDULED_INCIDENT_AFTER_RESERVATION:
|
case incidentType.UNSCHEDULED_INCIDENT_AFTER_RESERVATION:
|
||||||
@@ -97,8 +97,8 @@ const createFeeFromIncident = (incident) => {
|
|||||||
|
|
||||||
date = bookingStartMoment.clone().startOf('day').format();
|
date = bookingStartMoment.clone().startOf('day').format();
|
||||||
|
|
||||||
price = chargePrice.toFixed(2);
|
price = +chargePrice.toFixed(2);
|
||||||
quantity = timeIntervalsToCharge.toFixed(2);
|
quantity = +timeIntervalsToCharge.toFixed(2);
|
||||||
// priceExplanation = `$${totalChargeFee.toFixed(2)}, ${quantity} x $${price.toFixed(2)}`;
|
// priceExplanation = `$${totalChargeFee.toFixed(2)}, ${quantity} x $${price.toFixed(2)}`;
|
||||||
break;
|
break;
|
||||||
case incidentType.UNLOCKED_INCIDENT_STANDALONE:
|
case incidentType.UNLOCKED_INCIDENT_STANDALONE:
|
||||||
@@ -111,7 +111,7 @@ const createFeeFromIncident = (incident) => {
|
|||||||
|
|
||||||
date = unlockMoment.clone().startOf('day').format();
|
date = unlockMoment.clone().startOf('day').format();
|
||||||
|
|
||||||
price = incidentPrice.toFixed(2);
|
price = +incidentPrice.toFixed(2);
|
||||||
quantity = 1.00;
|
quantity = 1.00;
|
||||||
// priceExplanation = `$${price.toFixed(2)}, 1 x $${price.toFixed(2)}`;
|
// priceExplanation = `$${price.toFixed(2)}, 1 x $${price.toFixed(2)}`;
|
||||||
break;
|
break;
|
||||||
@@ -124,8 +124,8 @@ const createFeeFromIncident = (incident) => {
|
|||||||
|
|
||||||
date = unlockMoment.clone().startOf('day').format();
|
date = unlockMoment.clone().startOf('day').format();
|
||||||
|
|
||||||
price = chargePrice.toFixed(2);
|
price = +chargePrice.toFixed(2);
|
||||||
quantity = timeIntervalsToCharge.toFixed(2);
|
quantity = +timeIntervalsToCharge.toFixed(2);
|
||||||
// priceExplanation = `$${totalChargeFee.toFixed(2)}, ${quantity} x $${price.toFixed(2)}`;
|
// priceExplanation = `$${totalChargeFee.toFixed(2)}, ${quantity} x $${price.toFixed(2)}`;
|
||||||
break;
|
break;
|
||||||
case incidentType.BOOKING_MOVED_TO_ANOTHER_DAY:
|
case incidentType.BOOKING_MOVED_TO_ANOTHER_DAY:
|
||||||
@@ -142,7 +142,7 @@ const createFeeFromIncident = (incident) => {
|
|||||||
|
|
||||||
date = incidentTimestampMoment.clone().startOf('day').format();
|
date = incidentTimestampMoment.clone().startOf('day').format();
|
||||||
|
|
||||||
price = totalChargeFee.toFixed(2);
|
price = +totalChargeFee.toFixed(2);
|
||||||
quantity = 1.00;
|
quantity = 1.00;
|
||||||
// priceExplanation = `$${totalChargeFee.toFixed(2)}, 1 x $${price.toFixed(2)}`;
|
// priceExplanation = `$${totalChargeFee.toFixed(2)}, 1 x $${price.toFixed(2)}`;
|
||||||
break;
|
break;
|
||||||
@@ -160,7 +160,7 @@ const createFeeFromIncident = (incident) => {
|
|||||||
|
|
||||||
date = incidentTimestampMoment.clone().startOf('day').format();
|
date = incidentTimestampMoment.clone().startOf('day').format();
|
||||||
|
|
||||||
price = totalChargeFee.toFixed(2);
|
price = +totalChargeFee.toFixed(2);
|
||||||
quantity = 1.00;
|
quantity = 1.00;
|
||||||
// priceExplanation = `$${totalChargeFee.toFixed(2)}, 1 x $${price.toFixed(2)}`;
|
// priceExplanation = `$${totalChargeFee.toFixed(2)}, 1 x $${price.toFixed(2)}`;
|
||||||
break;
|
break;
|
||||||
@@ -173,7 +173,7 @@ const createFeeFromIncident = (incident) => {
|
|||||||
|
|
||||||
date = incidentTimestampMoment.clone().startOf('day').format();
|
date = incidentTimestampMoment.clone().startOf('day').format();
|
||||||
|
|
||||||
price = totalChargeFee.toFixed(2);
|
price = +totalChargeFee.toFixed(2);
|
||||||
quantity = 1.00;
|
quantity = 1.00;
|
||||||
// priceExplanation = `$${totalChargeFee.toFixed(2)}, 1 x $${price.toFixed(2)}`;
|
// priceExplanation = `$${totalChargeFee.toFixed(2)}, 1 x $${price.toFixed(2)}`;
|
||||||
break;
|
break;
|
||||||
@@ -212,8 +212,8 @@ const createFeeFromBooking = (booking, resourceMappings) => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
name: formattedName,
|
name: formattedName,
|
||||||
price: hourlyRate.toFixed(2),
|
price: +hourlyRate.toFixed(2),
|
||||||
quantity: reservationLength.toFixed(2),
|
quantity: +reservationLength.toFixed(2),
|
||||||
date: startMoment.startOf('day').toISOString(),
|
date: startMoment.startOf('day').toISOString(),
|
||||||
member: memberId,
|
member: memberId,
|
||||||
team: null,
|
team: null,
|
||||||
@@ -248,6 +248,14 @@ const getMembersFeesForDateRange = (dateRange, memberIds) => {
|
|||||||
fee.team = memberIdTeamMappings[fee.member] || null;
|
fee.team = memberIdTeamMappings[fee.member] || null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// const sortingFunction = ((fee1, fee2) => {
|
||||||
|
// const date1 = fee1.date;
|
||||||
|
// const date2 = fee2.date;
|
||||||
|
//
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// allFees.sort(sortingFunction);
|
||||||
|
|
||||||
resolve(allFees);
|
resolve(allFees);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user