From 8c67a9438792da173791b19df845fc4235e28616 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 7 Feb 2022 18:50:18 -0800 Subject: [PATCH] IO-1714 Resolve monthly efficiency component. --- .../monthly-employee-efficiency.component.jsx | 6 +++--- server/job/job-costing.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/components/dashboard-components/monthly-employee-efficiency/monthly-employee-efficiency.component.jsx b/client/src/components/dashboard-components/monthly-employee-efficiency/monthly-employee-efficiency.component.jsx index e90220698..a177771c3 100644 --- a/client/src/components/dashboard-components/monthly-employee-efficiency/monthly-employee-efficiency.component.jsx +++ b/client/src/components/dashboard-components/monthly-employee-efficiency/monthly-employee-efficiency.component.jsx @@ -40,7 +40,7 @@ export default function DashboardMonthlyEmployeeEfficiency({ (dayAcc, dayVal) => { return { actual: dayAcc.actual + dayVal.actualhrs, - productive: dayAcc.actual + dayVal.productivehrs, + productive: dayAcc.productive + dayVal.productivehrs, }; }, { actual: 0, productive: 0 } @@ -50,7 +50,7 @@ export default function DashboardMonthlyEmployeeEfficiency({ } const dailyEfficiency = - ((dailyHrs.productive - dailyHrs.actual) / dailyHrs.productive + 1) * 100; + ((dailyHrs.productive - dailyHrs.actual) / dailyHrs.actual + 1) * 100; const theValue = { date: moment(val).format("DD"), @@ -69,7 +69,7 @@ export default function DashboardMonthlyEmployeeEfficiency({ }; theValue.accEfficiency = ( ((theValue.accProductive - theValue.accActual) / - (theValue.accProductive || 1) + + (theValue.accActual || 1) + 1) * 100 ).toFixed(1); diff --git a/server/job/job-costing.js b/server/job/job-costing.js index e5c4c5883..99870eefe 100644 --- a/server/job/job-costing.js +++ b/server/job/job-costing.js @@ -667,7 +667,7 @@ const formatGpPercent = (gppercent) => { //Verify that this stays in line with jobs-close-auto-allocate logic from the application. const getAdditionalCostCenter = (jl, profitCenters) => { if (!jl.part_type && !jl.mod_lbr_ty) { - const lineDesc = jl.line_desc.toLowerCase(); + const lineDesc = jl.line_desc ? jl.line_desc.toLowerCase() : ""; if (lineDesc.includes("shop mat")) { return profitCenters["MASH"];