IO-2435 Total LAB & LAR in Production Board Header

This commit is contained in:
Allan Carr
2023-11-21 17:00:33 -08:00
parent e6df079431
commit 85b137f0d6
4 changed files with 28 additions and 2 deletions

View File

@@ -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 (
<div>
<PageHeader
@@ -193,6 +205,14 @@ export function ProductionListTable({
title={t("dashboard.titles.productionhours")}
value={totalHrs}
/>
<Statistic
title={t("dashboard.titles.labhours")}
value={totalLAB}
/>
<Statistic
title={t("dashboard.titles.larhours")}
value={totalLAR}
/>
<Statistic
title={t("appointments.labels.inproduction")}
value={dataSource && dataSource.length}