Merged in release/2026-06-05 (pull request #3269)
feature/IO-3567-New-Job-Line-Tab - Fix
This commit is contained in:
@@ -36,6 +36,7 @@ export function BillEnterModalLinesComponent({
|
||||
const { t } = useTranslation();
|
||||
const { setFieldsValue, getFieldsValue, getFieldValue } = form;
|
||||
const firstFieldRefs = useRef({});
|
||||
const lineDescriptionRefs = useRef({});
|
||||
|
||||
const CONTROL_HEIGHT = 32;
|
||||
|
||||
@@ -94,6 +95,23 @@ export function BillEnterModalLinesComponent({
|
||||
});
|
||||
};
|
||||
|
||||
const focusLineDescription = (index) => {
|
||||
const lineDescription = lineDescriptionRefs.current[index];
|
||||
|
||||
if (typeof lineDescription?.focus === "function") {
|
||||
lineDescription.focus({ preventScroll: true });
|
||||
return;
|
||||
}
|
||||
|
||||
lineDescription?.resizableTextArea?.textArea?.focus?.({ preventScroll: true });
|
||||
};
|
||||
|
||||
const focusJobLineSelect = (index) => {
|
||||
window.setTimeout(() => {
|
||||
firstFieldRefs.current[index]?.focus?.({ preventScroll: true });
|
||||
}, 0);
|
||||
};
|
||||
|
||||
// Only fill actual_cost when the user forward-tabs out of Retail (actual_price)
|
||||
const autofillActualCost = (index) => {
|
||||
if (bodyshop.accountingconfig?.disableBillCostCalculation) return;
|
||||
@@ -195,6 +213,12 @@ export function BillEnterModalLinesComponent({
|
||||
minHeight: `${CONTROL_HEIGHT}px`
|
||||
}}
|
||||
allowRemoved={form.getFieldValue("is_credit_memo") || false}
|
||||
onInputKeyDown={(event) => {
|
||||
if (event.key !== "Tab" || event.shiftKey || event.defaultPrevented) return;
|
||||
|
||||
event.preventDefault();
|
||||
focusLineDescription(index);
|
||||
}}
|
||||
onSelect={(value, opt) => {
|
||||
// IMPORTANT:
|
||||
// Do NOT autofill actual_cost here. It should only fill when the user forward-tabs
|
||||
@@ -221,6 +245,7 @@ export function BillEnterModalLinesComponent({
|
||||
};
|
||||
})
|
||||
});
|
||||
focusJobLineSelect(index);
|
||||
}}
|
||||
/>
|
||||
)
|
||||
@@ -236,7 +261,16 @@ export function BillEnterModalLinesComponent({
|
||||
label: t("billlines.fields.line_desc"),
|
||||
rules: [{ required: true }]
|
||||
}),
|
||||
formInput: () => <Input.TextArea disabled={disabled} autoSize tabIndex={0} />
|
||||
formInput: (record, index) => (
|
||||
<Input.TextArea
|
||||
ref={(el) => {
|
||||
lineDescriptionRefs.current[index] = el;
|
||||
}}
|
||||
disabled={disabled}
|
||||
autoSize
|
||||
tabIndex={0}
|
||||
/>
|
||||
)
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
@@ -3054,7 +3054,7 @@
|
||||
"appointment_confirmation": "Appointment Confirmation"
|
||||
},
|
||||
"banners": {
|
||||
"esignature_promo": "Tired of getting paper signatures? Try E-Signatures today. Contact sales to add this feature."
|
||||
"esignature_promo": "Tired of getting paper signatures? Try E-Signatures today. Contact support to add this feature."
|
||||
},
|
||||
"bills": {
|
||||
"inhouse_invoice": "In House Invoice"
|
||||
|
||||
Reference in New Issue
Block a user