Fixed bugs on parts allocations + added totals BOD-131
This commit is contained in:
@@ -22,10 +22,12 @@ export function JobsCloseLabmatAllocationButton({
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [state, setState] = useState({ center: "", amount: 0 });
|
||||
const { t } = useTranslation();
|
||||
|
||||
const handleAllocate = () => {
|
||||
const existingIndex = allocation.allocations.findIndex(
|
||||
(e) => e.center === state.center
|
||||
);
|
||||
console.log("handleAllocate -> existingIndex", existingIndex);
|
||||
|
||||
const newAllocations = allocation.allocations.slice(0);
|
||||
if (existingIndex > -1) {
|
||||
@@ -41,6 +43,7 @@ export function JobsCloseLabmatAllocationButton({
|
||||
amount: Dinero({ amount: state.amount * 100 }),
|
||||
});
|
||||
}
|
||||
|
||||
setAllocations((labMatState) => {
|
||||
return {
|
||||
...labMatState,
|
||||
|
||||
Reference in New Issue
Block a user