diff --git a/client/src/components/bill-form/bill-form.lines.component.jsx b/client/src/components/bill-form/bill-form.lines.component.jsx index fa04375d0..dd49b4677 100644 --- a/client/src/components/bill-form/bill-form.lines.component.jsx +++ b/client/src/components/bill-form/bill-form.lines.component.jsx @@ -59,39 +59,52 @@ export function BillEnterModalLinesComponent({ }; }, formInput: (record, index) => ( - { - setFieldsValue({ - billlines: getFieldsValue(["billlines"]).billlines.map( - (item, idx) => { - if (idx === index) { - return { - ...item, - line_desc: opt.line_desc, - quantity: opt.part_qty || 1, - actual_price: opt.cost, - cost_center: opt.part_type - ? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid - ? opt.part_type !== "PAE" - ? opt.part_type - : null - : responsibilityCenters.defaults && - (responsibilityCenters.defaults.costs[ - opt.part_type - ] || - null) - : null, - }; - } - return item; - } - ), - }); + + prev.is_credit_memo !== cur.is_credit_memo + } + > + {() => { + return ( + { + setFieldsValue({ + billlines: getFieldsValue(["billlines"]).billlines.map( + (item, idx) => { + if (idx === index) { + return { + ...item, + line_desc: opt.line_desc, + quantity: opt.part_qty || 1, + actual_price: opt.cost, + cost_center: opt.part_type + ? bodyshop.pbs_serialnumber || + bodyshop.cdk_dealerid + ? opt.part_type !== "PAE" + ? opt.part_type + : null + : responsibilityCenters.defaults && + (responsibilityCenters.defaults.costs[ + opt.part_type + ] || + null) + : null, + }; + } + return item; + } + ), + }); + }} + /> + ); }} - /> + ), }, { diff --git a/client/src/components/bill-line-search-select/bill-line-search-select.component.jsx b/client/src/components/bill-line-search-select/bill-line-search-select.component.jsx index 910d29856..38ca6c8b5 100644 --- a/client/src/components/bill-line-search-select/bill-line-search-select.component.jsx +++ b/client/src/components/bill-line-search-select/bill-line-search-select.component.jsx @@ -4,9 +4,12 @@ import { useTranslation } from "react-i18next"; //To be used as a form element only. const { Option } = Select; -const BillLineSearchSelect = ({ options, disabled, ...restProps }, ref) => { +const BillLineSearchSelect = ( + { options, disabled, allowRemoved, ...restProps }, + ref +) => { const { t } = useTranslation(); - + console.log(allowRemoved); return (