From bcc153caa550fbb43ba4cfeed72fdd1fdaacd6e8 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 16 Mar 2022 16:39:42 -0700 Subject: [PATCH 1/5] Autohouse updates. --- server/data/autohouse.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/server/data/autohouse.js b/server/data/autohouse.js index 217f68c60..8e0befe51 100644 --- a/server/data/autohouse.js +++ b/server/data/autohouse.js @@ -96,7 +96,7 @@ exports.default = async (req, res) => { count: autoHouseObject.AutoHouseExport.RepairOrder.length, xml: ret, filename: `IM_${bodyshop.autohouseid}_${moment().format( - "DDMMYYYY_HHMMSS" + "DDMMYYYY_HHMMss" )}.xml`, }); @@ -328,8 +328,12 @@ const CreateRepairOrderTag = (job, errorCallback) => { .format(AhDateFormat)) || "", DeliveryAppointmentDate: - (job.scheduled_delivery && - moment(job.scheduled_delivery) + // (job.scheduled_delivery && + // moment(job.scheduled_delivery) + // .tz(job.bodyshop.timezone) + // .format(AhDateFormat)) || + (job.scheduled_completion && + moment(job.scheduled_completion) .tz(job.bodyshop.timezone) .format(AhDateFormat)) || "", @@ -538,7 +542,7 @@ const CreateRepairOrderTag = (job, errorCallback) => { ), GlassLaborTotalCost: repairCosts.GlassLaborTotalCost.toFormat(AHDineroFormat), - DetailLaborTotal: Dinero(job.job_totals.rates.lag.total).toFormat( + DetailLaborTotal: Dinero(job.job_totals.rates.lad.total).toFormat( AHDineroFormat ), DetailLaborTotalCost: @@ -590,7 +594,7 @@ const CreateRepairOrderTag = (job, errorCallback) => { AHDineroFormat ), InsurancePay: Dinero(job.job_totals.totals.total_repairs) - .subtract(Dinero(job.job_totals.totals.custPayable)) + .subtract(Dinero(job.job_totals.totals.custPayable.total)) .toFormat(AHDineroFormat), Deposit: 0, AmountDue: 0, From 75743f44e7a5c8557144bc89e1901e47f6f38ae8 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 18 Mar 2022 15:18:48 -0700 Subject: [PATCH 2/5] IO-1777 add check for paint materials threshold. --- server/job/job-totals.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/job/job-totals.js b/server/job/job-totals.js index 35f6d7849..a04650815 100644 --- a/server/job/job-totals.js +++ b/server/job/job-totals.js @@ -236,7 +236,7 @@ function CalculateRatesTotals(ratesList) { } let threshold; //Check if there is a max for this type. - if (ratesList.materials[property]) { + if (ratesList.materials && ratesList.materials[property]) { // if ( ratesList.materials[property].cal_maxdlr && From 592b47b5d4b3335c246bb15404eea1b10f2096a1 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 21 Mar 2022 11:47:25 -0600 Subject: [PATCH 3/5] IO-1789 Incoming hours cap --- bodyshop_translations.babel | 26 ++++++ .../shop-info.scheduling.component.jsx | 6 ++ client/src/graphql/bodyshop.queries.js | 3 +- client/src/translations/en_us/common.json | 3 + client/src/translations/es/common.json | 3 + client/src/translations/fr/common.json | 3 + hasura/metadata/tables.yaml | 2 + .../down.sql | 4 + .../up.sql | 2 + server/graphql-client/queries.js | 1 + server/scheduling/scheduling-job.js | 89 +++++++++++++++---- 11 files changed, 124 insertions(+), 18 deletions(-) create mode 100644 hasura/migrations/1647876980174_alter_table_public_bodyshops_add_column_ss_configuration/down.sql create mode 100644 hasura/migrations/1647876980174_alter_table_public_bodyshops_add_column_ss_configuration/up.sql diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index d11e1ed2d..28764f991 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -7280,6 +7280,32 @@ + + ss_configuration + + + dailyhrslimit + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + ssbuckets diff --git a/client/src/components/shop-info/shop-info.scheduling.component.jsx b/client/src/components/shop-info/shop-info.scheduling.component.jsx index d071cc9de..85e64c555 100644 --- a/client/src/components/shop-info/shop-info.scheduling.component.jsx +++ b/client/src/components/shop-info/shop-info.scheduling.component.jsx @@ -70,6 +70,12 @@ export default function ShopInfoSchedulingComponent({ form }) { >