Fixed bugs on parts allocations + added totals BOD-131

This commit is contained in:
Patrick Fic
2020-05-20 10:03:03 -07:00
parent 94777bf661
commit 0dbacf0b9e
8 changed files with 118 additions and 32 deletions

View File

@@ -7,6 +7,7 @@ import AllocationTags from "../jobs-close-allocation-tags/jobs-close-allocation-
export default function JobsClosePartsAllocation({
partsAllocations,
setPartsAllocations,
partsAllocatedTotal,
}) {
const { t } = useTranslation();
@@ -65,8 +66,15 @@ export default function JobsClosePartsAllocation({
})}
<tr>
<td></td>
<td></td>
<td></td>
<td>
{Dinero({
amount: Object.keys(partsAllocations).reduce((acc, val) => {
return (acc =
acc + partsAllocations[val].total.getAmount());
}, 0),
}).toFormat()}
</td>
<td>{partsAllocatedTotal.toFormat()}</td>
<td></td>
<td></td>
</tr>