From 0190e737c14cc6c0d5b31c6970721e08973099dd Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Wed, 18 Aug 2021 12:58:26 -0700 Subject: [PATCH] IO-1297 resolve decimal issue on time ticket list. --- .../scoreboard-chart/scoreboard-chart.component.jsx | 8 +++++--- .../time-ticket-list/time-ticket-list.component.jsx | 9 ++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx b/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx index 0c9d9bb7a..b39d70d5b 100644 --- a/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx +++ b/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx @@ -53,18 +53,20 @@ export function ScoreboardChart({ sbEntriesByDate, bodyshop }) { const theValue = { date: moment(val).format("D dd"), paintHrs: _.round(dayhrs.painthrs, 1), - bodyHrs: _.round(dayhrs.bodyhrs), + bodyHrs: _.round(dayhrs.bodyhrs, 1), accTargetHrs: _.round( Utils.AsOfDateTargetHours( bodyshop.scoreboard_target.dailyBodyTarget + bodyshop.scoreboard_target.dailyPaintTarget, val - ) + ), + 1 ), accHrs: _.round( acc.length > 0 ? acc[acc.length - 1].accHrs + dayhrs.painthrs + dayhrs.bodyhrs - : dayhrs.painthrs + dayhrs.bodyhrs + : dayhrs.painthrs + dayhrs.bodyhrs, + 1 ), }; 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 804f69fcf..46e9462c3 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 @@ -1,9 +1,10 @@ -import { Card, Space, Table } from "antd"; import { EditFilled } from "@ant-design/icons"; +import { Card, Space, Table } from "antd"; import moment from "moment"; import React, { useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; +import { Link } from "react-router-dom"; import { createStructuredSelector } from "reselect"; import { selectAuthLevel, @@ -16,8 +17,6 @@ import RbacWrapper, { HasRbacAccess, } 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, @@ -269,10 +268,10 @@ export function TimeTicketList({ - {_.round(totals.productivehrs, 1)} + {totals.productivehrs.toFixed(1)} - {_.round(totals.actualhrs, 1)} + {totals.actualhrs.toFixed(1)} {totals.actualhrs === 0 || !totals.actualhrs