Refactored capturing of resp. centers. + added auto allocate BOD-131
This commit is contained in:
@@ -6,9 +6,9 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import JobsClosePartsAllocation from "../../components/jobs-close-parts-allocation/jobs-close-parts-allocation.component";
|
||||
import Dinero from "dinero.js";
|
||||
import JobsCloseTotals from "../../components/jobs-close-totals/jobs-close-totals.component";
|
||||
import JobsCloseAutoAllocate from "../../components/jobs-close-auto-allocate/jobs-close-auto-allocate.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
|
||||
@@ -22,7 +22,6 @@ export function JobsCloseComponent({ job, bodyshop, jobTotals }) {
|
||||
return acc;
|
||||
}, {})
|
||||
);
|
||||
console.log("JobsCloseComponent -> labmatAllocations", labmatAllocations);
|
||||
|
||||
const [partsAllocations, setPartsAllocations] = useState({
|
||||
...Object.keys(jobTotals.parts.parts.list).reduce((acc, val) => {
|
||||
@@ -30,14 +29,12 @@ export function JobsCloseComponent({ job, bodyshop, jobTotals }) {
|
||||
|
||||
return acc;
|
||||
}, {}),
|
||||
sublet: {
|
||||
pas: {
|
||||
...jobTotals.parts.sublets,
|
||||
allocations: [],
|
||||
},
|
||||
});
|
||||
|
||||
console.log("JobsCloseComponent -> partsAllocations", partsAllocations);
|
||||
|
||||
const labmatAllocatedTotalsArray = Object.keys(labmatAllocations)
|
||||
.filter((i) => !i.includes("subtotal"))
|
||||
.map((i) => labmatAllocations[i].allocations)
|
||||
@@ -66,6 +63,12 @@ export function JobsCloseComponent({ job, bodyshop, jobTotals }) {
|
||||
labMatTotal={labmatAllocatedTotal}
|
||||
partsTotal={partsAllocatedTotal}
|
||||
/>
|
||||
<JobsCloseAutoAllocate
|
||||
labmatAllocations={labmatAllocations}
|
||||
setLabmatAllocations={setLabmatAllocations}
|
||||
partsAllocations={partsAllocations}
|
||||
setPartsAllocations={setPartsAllocations}
|
||||
/>
|
||||
<JobsCloseLaborMaterialAllocation
|
||||
labmatAllocations={labmatAllocations}
|
||||
setLabmatAllocations={setLabmatAllocations}
|
||||
|
||||
@@ -13,7 +13,6 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import JobsCloseComponent from "./jobs-close.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user