IO-2244 Round difference calculation to 1 decimal point for productive hours claiming enforcement.

This commit is contained in:
Patrick Fic
2023-04-13 10:11:15 -07:00
parent 1fb856f95f
commit 3981b8684c
2 changed files with 16 additions and 9 deletions

View File

@@ -169,11 +169,14 @@ export function TechClockOffButton({
? "mod_lbr_ty"
: "cost_center";
const costCenterDiff = totals.find(
(total) =>
total[fieldTypeToCheck] ===
getFieldValue("cost_center")
)?.difference;
const costCenterDiff =
Math.round(
totals.find(
(total) =>
total[fieldTypeToCheck] ===
getFieldValue("cost_center")
)?.difference * 10
) / 10;
if (value > costCenterDiff)
return Promise.reject(

View File

@@ -206,10 +206,14 @@ export function TimeTicketModalComponent({
? "mod_lbr_ty"
: "cost_center";
const costCenterDiff = totals.find(
(total) =>
total[fieldTypeToCheck] === getFieldValue("cost_center")
)?.difference;
const costCenterDiff =
Math.round(
totals.find(
(total) =>
total[fieldTypeToCheck] ===
getFieldValue("cost_center")
)?.difference * 10
) / 10;
if (value > costCenterDiff)
return Promise.reject(