From 7482751c5be4de389626d1676c6712fb34603b78 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 21 Oct 2021 09:43:14 -0700 Subject: [PATCH 1/2] IO-1478 Make CC Contract RO lines editable. --- .../contract-convert-to-ro.component.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/src/components/contract-convert-to-ro/contract-convert-to-ro.component.jsx b/client/src/components/contract-convert-to-ro/contract-convert-to-ro.component.jsx index 68ff74037..e4acf9286 100644 --- a/client/src/components/contract-convert-to-ro/contract-convert-to-ro.component.jsx +++ b/client/src/components/contract-convert-to-ro/contract-convert-to-ro.component.jsx @@ -53,6 +53,7 @@ export function ContractConvertToRo({ const billingLines = []; if (contractLength > 0) billingLines.push({ + manual_line:true, unq_seq: 1, line_no: 1, line_ref: 1, @@ -70,6 +71,7 @@ export function ContractConvertToRo({ contract.kmend - contract.kmstart - contract.dailyfreekm * contractLength; if (mileageDiff > 0) { billingLines.push({ + manual_line:true, unq_seq: 2, line_no: 2, line_ref: 2, @@ -86,6 +88,7 @@ export function ContractConvertToRo({ if (values.refuelqty > 0) { billingLines.push({ + manual_line:true, unq_seq: 3, line_no: 3, line_ref: 3, @@ -101,6 +104,7 @@ export function ContractConvertToRo({ } if (values.applyCleanupCharge) { billingLines.push({ + manual_line:true, unq_seq: 4, line_no: 4, line_ref: 4, @@ -117,6 +121,7 @@ export function ContractConvertToRo({ if (contract.damagewaiver) { //Add for cleanup fee. billingLines.push({ + manual_line:true, unq_seq: 5, line_no: 5, line_ref: 5, From 6bcb5f2af5569d9f0830f70815af3dbbb0027f74 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Thu, 21 Oct 2021 11:42:05 -0700 Subject: [PATCH 2/2] IO-1446 Smart Schedule Blocked Day Fixes --- server/scheduling/scheduling-job.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/server/scheduling/scheduling-job.js b/server/scheduling/scheduling-job.js index 05f210485..cb74a524b 100644 --- a/server/scheduling/scheduling-job.js +++ b/server/scheduling/scheduling-job.js @@ -87,7 +87,10 @@ exports.job = async (req, res) => { } else { //remove the date from the possible list. const appDate = moment(appointment.start).format("yyyy-MM-DD"); - delete bucketMatrix[appDate]; + bucketMatrix[appDate] = { + ...bucketMatrix[appDate], + blocked: true, + }; } }); @@ -125,7 +128,9 @@ exports.job = async (req, res) => { const possibleDates = []; const bucketMatrixKeys = Object.keys(bucketMatrix); bucketMatrixKeys.forEach((bmkey) => { - const isShopOpen = workingdays[dayOfWeekMapper(moment(bmkey).day())]; + const isShopOpen = + workingdays[dayOfWeekMapper(moment(bmkey).day())] && + !bucketMatrix[bmkey].blocked; if ( JobBucket.target > bucketMatrix[bmkey].in - bucketMatrix[bmkey].out && @@ -134,7 +139,11 @@ exports.job = async (req, res) => { possibleDates.push(new Date(bmkey).toISOString().substr(0, 10)); }); - res.json(possibleDates); + if (possibleDates.length < 6) { + res.json(possibleDates); + } else { + res.json(possibleDates.slice(0, 5)); + } } catch (error) { logger.log("smart-scheduling-error", "ERROR", req.user.email, jobId, { error,