Resolved allocation bug introduced by moving totals calculation to server side. BOD-267

This commit is contained in:
Patrick Fic
2020-08-26 17:09:00 -07:00
parent 721c938e8a
commit 5d58b2d9d7
3 changed files with 6 additions and 5 deletions

View File

@@ -40,7 +40,8 @@ export default function JobCloseLabMatAllocation({
Dinero({ Dinero({
amount: labmatAllocations[alloc].allocations.reduce( amount: labmatAllocations[alloc].allocations.reduce(
(acc, val) => { (acc, val) => {
return acc + Dinero(val.amount).getAmount(); console.log("val :>> ", val);
return acc + val.amount.getAmount();
}, },
0 0
), ),
@@ -57,7 +58,7 @@ export default function JobCloseLabMatAllocation({
Dinero({ Dinero({
amount: labmatAllocations[alloc].allocations.reduce( amount: labmatAllocations[alloc].allocations.reduce(
(acc, val) => { (acc, val) => {
return acc + Dinero(val.amount).getAmount(); return acc + val.amount.getAmount();
}, },
0 0
), ),

View File

@@ -40,7 +40,7 @@ export default function JobsClosePartsAllocation({
Dinero({ Dinero({
amount: partsAllocations[alloc].allocations.reduce( amount: partsAllocations[alloc].allocations.reduce(
(acc, val) => { (acc, val) => {
return acc + Dinero(val.amount).getAmount(); return acc + val.amount.getAmount();
}, },
0 0
), ),
@@ -57,7 +57,7 @@ export default function JobsClosePartsAllocation({
Dinero({ Dinero({
amount: partsAllocations[alloc].allocations.reduce( amount: partsAllocations[alloc].allocations.reduce(
(acc, val) => { (acc, val) => {
return acc + Dinero(val.amount).getAmount(); return acc + val.amount.getAmount();
}, },
0 0
), ),

View File

@@ -53,7 +53,7 @@ export function JobsCloseContainer({ setBreadcrumbs }) {
<div> <div>
<JobsCloseComponent <JobsCloseComponent
job={data ? data.jobs_by_pk : {}} job={data ? data.jobs_by_pk : {}}
jobTotals={data.jobs_by_pk.job_totals} jobTotals={JSON.parse(data.jobs_by_pk.job_totals)}
/> />
</div> </div>
</RbacWrapper> </RbacWrapper>