From 706c70c50926fe8133700773410dc32e969dd533 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 12 Mar 2024 14:49:12 -0700 Subject: [PATCH] IO-2625 B/P/T Hrs Display in Employee Assignment Block Signed-off-by: Allan Carr --- .../jobs-detail-header.component.jsx | 14 +++++++++++++- client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx index 70dbc033a..0e5f75992 100644 --- a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx +++ b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx @@ -4,7 +4,7 @@ import { PauseCircleOutlined, WarningFilled, } from "@ant-design/icons"; -import { Card, Col, Row, Space, Tag, Tooltip } from "antd"; +import { Card, Col, Divider, Row, Space, Tag, Tooltip } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; @@ -62,6 +62,13 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) { ${job.v_make_desc || ""} ${job.v_model_desc || ""}`.trim(); + const bodyHrs = job.joblines + .filter((j) => j.mod_lbr_ty !== "LAR") + .reduce((acc, val) => acc + val.mod_lb_hrs, 0); + const refinishHrs = job.joblines + .filter((line) => line.mod_lbr_ty === "LAR") + .reduce((acc, val) => acc + val.mod_lb_hrs, 0); + const ownerTitle = OwnerNameDisplayFunction(job).trim(); return ( @@ -299,6 +306,11 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) { >
+ + + {bodyHrs.toFixed(1)} / {refinishHrs.toFixed(1)} /{" "} + {(bodyHrs + refinishHrs).toFixed(1)} +
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 87bf0c22e..35049df2a 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1823,6 +1823,7 @@ "job": "Job Details", "jobcosting": "Job Costing", "jobtotals": "Job Totals", + "labor_hrs": "B/P/T Hrs", "labor_rates_subtotal": "Labor Rates Subtotal", "laborallocations": "Labor Allocations", "labortotals": "Labor Totals", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index c8dd488ab..a5fef29a5 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1823,6 +1823,7 @@ "job": "", "jobcosting": "", "jobtotals": "", + "labor_hrs": "", "labor_rates_subtotal": "", "laborallocations": "", "labortotals": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index d64b315ef..df8004f05 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1823,6 +1823,7 @@ "job": "", "jobcosting": "", "jobtotals": "", + "labor_hrs": "", "labor_rates_subtotal": "", "laborallocations": "", "labortotals": "",