Added scoreboard edt for added entries BOD-365

This commit is contained in:
Patrick Fic
2020-08-28 16:34:48 -07:00
parent ab4262c238
commit 266b6b0dbb
14 changed files with 241 additions and 23 deletions

View File

@@ -5,7 +5,7 @@ import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
import Dinero from "dinero.js";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
@@ -28,7 +28,10 @@ export function JobsCloseAutoAllocate({
Object.keys(labmatAllocations).forEach((i) => {
const defaultProfitCenter = defaults.profits[i.toUpperCase()];
if (!!defaultProfitCenter && labmatAllocations[i].total.getAmount() > 0) {
if (
!!defaultProfitCenter &&
Dinero(labmatAllocations[i].total).getAmount() > 0
) {
setLabmatAllocations((st) => {
return {
...st,
@@ -49,7 +52,10 @@ export function JobsCloseAutoAllocate({
Object.keys(partsAllocations).forEach((i) => {
const defaultProfitCenter = defaults.profits[i.toUpperCase()];
if (!!defaultProfitCenter && partsAllocations[i].total.getAmount() > 0) {
if (
!!defaultProfitCenter &&
Dinero(partsAllocations[i].total).getAmount() > 0
) {
setPartsAllocations((st) => {
return {
...st,