From 85b137f0d64aced63dd96e7dbaaff2c23b0f49c1 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 21 Nov 2023 17:00:33 -0800 Subject: [PATCH] IO-2435 Total LAB & LAR in Production Board Header --- .../production-list-table.component.jsx | 20 +++++++++++++++++++ client/src/translations/en_us/common.json | 6 ++++-- client/src/translations/es/common.json | 2 ++ client/src/translations/fr/common.json | 2 ++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/client/src/components/production-list-table/production-list-table.component.jsx b/client/src/components/production-list-table/production-list-table.component.jsx index 1585c6480..3ea3391d3 100644 --- a/client/src/components/production-list-table/production-list-table.component.jsx +++ b/client/src/components/production-list-table/production-list-table.component.jsx @@ -184,6 +184,18 @@ export function ProductionListTable({ 0 ) .toFixed(1); + const totalLAB = data + .reduce( + (acc, val) => acc + (val.labhrs?.aggregate?.sum?.mod_lb_hrs || 0), + 0 + ) + .toFixed(1); + const totalLAR = data + .reduce( + (acc, val) => acc + (val.larhrs?.aggregate?.sum?.mod_lb_hrs || 0), + 0 + ) + .toFixed(1); return (
+ +