Refactored capturing of resp. centers. + added auto allocate BOD-131
This commit is contained in:
@@ -4,16 +4,13 @@ import { useTranslation } from "react-i18next";
|
||||
import AllocationButton from "../jobs-close-allocation-button/jobs-close-allocation-button.component";
|
||||
import AllocationTags from "../jobs-close-allocation-tags/jobs-close-allocation-tags.component";
|
||||
|
||||
|
||||
export default function JobCloseLabMatAllocation({
|
||||
labmatAllocations,
|
||||
setLabmatAllocations,
|
||||
labMatTotalAllocation
|
||||
labMatTotalAllocation,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<div style={{ display: "flex" }}>
|
||||
<table>
|
||||
@@ -53,6 +50,18 @@ export default function JobCloseLabMatAllocation({
|
||||
<td>
|
||||
<AllocationButton
|
||||
allocationKey={alloc}
|
||||
remainingAmount={labmatAllocations[alloc].total
|
||||
.subtract(
|
||||
Dinero({
|
||||
amount: labmatAllocations[alloc].allocations.reduce(
|
||||
(acc, val) => {
|
||||
return acc + val.amount.getAmount();
|
||||
},
|
||||
0
|
||||
),
|
||||
})
|
||||
)
|
||||
.getAmount()}
|
||||
allocation={labmatAllocations[alloc]}
|
||||
setAllocations={setLabmatAllocations}
|
||||
/>
|
||||
@@ -71,9 +80,9 @@ export default function JobCloseLabMatAllocation({
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>{labmatAllocations.subtotal.toFormat()}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>{labMatTotalAllocation.toFormat()}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user