WIP Bill Line deduction from Labor IO-571
This commit is contained in:
@@ -15,7 +15,7 @@ import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
export default function LaborAllocationsAdjustmentEdit({
|
||||
jobId,
|
||||
mod_lbr_ty,
|
||||
adjustments = [],
|
||||
adjustments,
|
||||
children,
|
||||
}) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
@@ -30,10 +30,10 @@ export default function LaborAllocationsAdjustmentEdit({
|
||||
variables: {
|
||||
jobId: jobId,
|
||||
job: {
|
||||
lbr_adjustments: [
|
||||
{ mod_lbr_ty: values.mod_lbr_ty, hours: values.hours },
|
||||
...adjustments.filter((a) => a.mod_lbr_ty !== values.mod_lbr_ty),
|
||||
],
|
||||
lbr_adjustments: {
|
||||
...adjustments,
|
||||
[values.mod_lbr_ty]: values.hours,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -61,8 +61,7 @@ export default function LaborAllocationsAdjustmentEdit({
|
||||
onFinish={handleFinish}
|
||||
initialValues={{
|
||||
mod_lbr_ty: mod_lbr_ty,
|
||||
hours: adjustments.filter((i) => i.mod_lbr_ty === mod_lbr_ty)[0]
|
||||
?.hours,
|
||||
hours: adjustments[mod_lbr_ty],
|
||||
}}
|
||||
>
|
||||
<Form.Item
|
||||
|
||||
Reference in New Issue
Block a user