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

@@ -87,7 +87,7 @@ export function JobsCloseComponent({ job, bodyshop, jobTotals }) {
const labmatAllocatedTotal = Dinero({
amount: labmatAllocatedTotalsArray.reduce((acc, val) => {
return (acc = acc + val.amount.getAmount());
return (acc = acc + Dinero(val.amount).getAmount());
}, 0),
});
@@ -97,7 +97,7 @@ export function JobsCloseComponent({ job, bodyshop, jobTotals }) {
const partsAllocatedTotal = Dinero({
amount: partsAllocatedTotalsArray.reduce((acc, val) => {
return (acc = acc + val.amount.getAmount());
return (acc = acc + Dinero(val.amount).getAmount());
}, 0),
});

View File

@@ -10,6 +10,8 @@ import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component";
import { QUERY_JOB_CLOSE_DETAILS } from "../../graphql/jobs.queries";
import { setBreadcrumbs } from "../../redux/application/application.actions";
import JobsCloseComponent from "./jobs-close.component";
import { Result } from "antd";
import JobCalculateTotals from "../../components/job-calculate-totals/job-calculate-totals.component";
const mapDispatchToProps = (dispatch) => ({
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
@@ -47,13 +49,19 @@ export function JobsCloseContainer({ setBreadcrumbs }) {
if (loading) return <LoadingSpinner />;
if (error) return <AlertComponent message={error.message} type="error" />;
if (!!!data.jobs_by_pk) return <NotFound />;
if (!data.jobs_by_pk.job_totals)
return (
<Result
title={t("jobs.errors.nofinancial")}
extra={<JobCalculateTotals job={data.jobs_by_pk} />}
/>
);
return (
<RbacWrapper action="jobs:close">
<div>
<JobsCloseComponent
job={data ? data.jobs_by_pk : {}}
jobTotals={JSON.parse(data.jobs_by_pk.job_totals)}
jobTotals={data.jobs_by_pk.job_totals}
/>
</div>
</RbacWrapper>