diff --git a/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx b/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx index 304eabe84..50144f157 100644 --- a/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx +++ b/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx @@ -10,7 +10,7 @@ import { alphaSort } from "../../utils/sorters"; import LaborAllocationsAdjustmentEdit from "../labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component"; import "./labor-allocations-table.styles.scss"; import { CalculateAllocationsTotals } from "./labor-allocations-table.utility"; - +import _ from "lodash"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, technician: selectTechnician, @@ -113,7 +113,7 @@ export function LaborAllocationsTable({ color: record.difference >= 0 ? "green" : "red", }} > - {record.difference} + {_.round(record.difference, 1)} ), }, diff --git a/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx b/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx index ec7c8fd37..0c9d9bb7a 100644 --- a/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx +++ b/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx @@ -17,7 +17,7 @@ import { import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; import * as Utils from "../scoreboard-targets-table/scoreboard-targets-table.util"; - +import _ from "lodash"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, }); @@ -52,17 +52,20 @@ export function ScoreboardChart({ sbEntriesByDate, bodyshop }) { const theValue = { date: moment(val).format("D dd"), - paintHrs: dayhrs.painthrs, - bodyHrs: dayhrs.bodyhrs, - accTargetHrs: Utils.AsOfDateTargetHours( - bodyshop.scoreboard_target.dailyBodyTarget + - bodyshop.scoreboard_target.dailyPaintTarget, - val + paintHrs: _.round(dayhrs.painthrs, 1), + bodyHrs: _.round(dayhrs.bodyhrs), + accTargetHrs: _.round( + Utils.AsOfDateTargetHours( + bodyshop.scoreboard_target.dailyBodyTarget + + bodyshop.scoreboard_target.dailyPaintTarget, + val + ) ), - accHrs: + accHrs: _.round( acc.length > 0 ? acc[acc.length - 1].accHrs + dayhrs.painthrs + dayhrs.bodyhrs - : dayhrs.painthrs + dayhrs.bodyhrs, + : dayhrs.painthrs + dayhrs.bodyhrs + ), }; return [...acc, theValue]; diff --git a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx index ff0b4f2af..37a9213fa 100644 --- a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx +++ b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx @@ -40,17 +40,21 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) { const [costOptions, setCostOptions] = useState( [ - ...(form - .getFieldValue(["md_responsibility_centers", "costs"]) - .map((i) => i && i.name) || []), + ...((form.getFieldValue(["md_responsibility_centers", "costs"]) && + form + .getFieldValue(["md_responsibility_centers", "costs"]) + .map((i) => i && i.name)) || + []), ] || [] ); const [profitOptions, setProfitOptions] = useState( [ - ...(form - .getFieldValue(["md_responsibility_centers", "profits"]) - .map((i) => i && i.name) || []), + ...((form.getFieldValue(["md_responsibility_centers", "profits"]) && + form + .getFieldValue(["md_responsibility_centers", "profits"]) + .map((i) => i && i.name)) || + []), ] || [] ); diff --git a/client/src/components/time-ticket-list/time-ticket-list.component.jsx b/client/src/components/time-ticket-list/time-ticket-list.component.jsx index 6a7bf6b11..804f69fcf 100644 --- a/client/src/components/time-ticket-list/time-ticket-list.component.jsx +++ b/client/src/components/time-ticket-list/time-ticket-list.component.jsx @@ -17,7 +17,7 @@ import RbacWrapper, { } from "../rbac-wrapper/rbac-wrapper.component"; import TimeTicketEnterButton from "../time-ticket-enter-button/time-ticket-enter-button.component"; import { Link } from "react-router-dom"; - +import _ from "lodash"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, authLevel: selectAuthLevel, @@ -268,8 +268,12 @@ export function TimeTicketList({