IO-3624 Finalize admin config UX and validation polish

This commit is contained in:
Dave
2026-03-25 15:25:59 -04:00
parent b8246e03c1
commit e49500887d
33 changed files with 2223 additions and 960 deletions

View File

@@ -1,6 +1,6 @@
import { DeleteFilled, HolderOutlined } from "@ant-design/icons";
import { useTreatmentsWithConfig } from "@splitsoftware/splitio-react";
import { Button, DatePicker, Form, Input, InputNumber, Radio, Select, Space, Switch } from "antd";
import { Button, Col, DatePicker, Divider, Form, Input, InputNumber, Radio, Row, Select, Space, Switch } from "antd";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -12,7 +12,8 @@ import DataLabel from "../data-label/data-label.component";
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";
import { getFormListItemTitle } from "../form-list-move-arrows/form-list-item-title.utils";
import ConfigListEmptyState from "../layout-form-row/config-list-empty-state.component.jsx";
import { buildSectionActionButton, renderListOrEmpty } from "../layout-form-row/config-list-actions.utils.jsx";
import InlineValidatedFormRow from "../layout-form-row/inline-validated-form-row.component.jsx";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
import {
INLINE_TITLE_GROUP_STYLE,
@@ -20,7 +21,8 @@ import {
INLINE_TITLE_INPUT_STYLE,
INLINE_TITLE_LABEL_STYLE,
INLINE_TITLE_ROW_STYLE,
INLINE_TITLE_SEPARATOR_STYLE
INLINE_TITLE_SEPARATOR_STYLE,
INLINE_TITLE_SWITCH_GROUP_STYLE
} from "../layout-form-row/inline-form-row-title.utils.js";
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
import ShopInfoResponsibilitycentersTaxesComponent from "./shop-info.responsibilitycenters.taxes.component";
@@ -42,14 +44,9 @@ export default connect(mapStateToProps, mapDispatchToProps)(ShopInfoResponsibili
export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
const { t } = useTranslation();
const taxAccountRowCol = { xs: 24, sm: 12, md: 12, lg: 6, xl: 6, xxl: 6 };
const taxAccountFullRowCol = { xs: 24 };
const dmsPayers = Form.useWatch(["cdk_configuration", "payers"], form) || [];
const buildSectionActionButton = (key, label, onClick) => (
<Button key={key} type="primary" block onClick={onClick}>
{label}
</Button>
);
const renderListOrEmpty = (fields, actionLabel, renderItems) =>
fields.length === 0 ? <ConfigListEmptyState actionLabel={actionLabel} /> : renderItems();
const hasDMSKey = bodyshopHasDmsKey(bodyshop);
@@ -98,229 +95,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
<div>
<RbacWrapper action="shop:responsibilitycenter">
<LayoutFormRow header={t("bodyshop.labels.accountingsetup")} id="accountingsetup">
{[
...(HasFeatureAccess({ featureName: "export", bodyshop })
? !hasDMSKey
? [
<Form.Item
key="qbo"
label={t("bodyshop.labels.qbo")}
valuePropName="checked"
name={["accountingconfig", "qbo"]}
>
<Switch />
</Form.Item>,
InstanceRenderManager({
imex: (
<Form.Item key="qbo_usa_wrapper" shouldUpdate noStyle>
{() => (
<Form.Item
label={t("bodyshop.labels.qbo_usa")}
shouldUpdate
valuePropName="checked"
name={["accountingconfig", "qbo_usa"]}
>
<Switch disabled={!form.getFieldValue(["accountingconfig", "qbo"])} />
</Form.Item>
)}
</Form.Item>
)
}),
<Form.Item
key="qbo_departmentid"
label={t("bodyshop.labels.qbo_departmentid")}
name={["accountingconfig", "qbo_departmentid"]}
>
<Input />
</Form.Item>,
<Form.Item
key="accountingtiers"
label={t("bodyshop.labels.accountingtiers")}
rules={[
{
required: true
//message: t("general.validation.required"),
}
]}
name={["accountingconfig", "tiers"]}
>
<Radio.Group>
<Radio value={2}>2</Radio>
<Radio value={3}>3</Radio>
</Radio.Group>
</Form.Item>,
<Form.Item key="twotierpref_wrapper" shouldUpdate>
{() => {
return (
<Form.Item
label={t("bodyshop.labels.2tiersetup")}
shouldUpdate
rules={[
{
required: form.getFieldValue(["accountingconfig", "tiers"]) === 2
//message: t("general.validation.required"),
}
]}
name={["accountingconfig", "twotierpref"]}
>
<Radio.Group disabled={form.getFieldValue(["accountingconfig", "tiers"]) === 3}>
<Radio value="name">{t("bodyshop.labels.2tiername")}</Radio>
<Radio value="source">{t("bodyshop.labels.2tiersource")}</Radio>
</Radio.Group>
</Form.Item>
);
}}
</Form.Item>,
<Form.Item
key="printlater"
label={t("bodyshop.labels.printlater")}
valuePropName="checked"
name={["accountingconfig", "printlater"]}
>
<Switch />
</Form.Item>,
<Form.Item
key="emaillater"
label={t("bodyshop.labels.emaillater")}
valuePropName="checked"
name={["accountingconfig", "emaillater"]}
>
<Switch />
</Form.Item>,
<Form.Item
key="ReceivableCustomField1"
name={["accountingconfig", "ReceivableCustomField1"]}
label={t("bodyshop.fields.ReceivableCustomField", { number: 1 })}
>
{ReceivableCustomFieldSelect}
</Form.Item>,
<Form.Item
key="ReceivableCustomField2"
name={["accountingconfig", "ReceivableCustomField2"]}
label={t("bodyshop.fields.ReceivableCustomField", { number: 2 })}
>
{ReceivableCustomFieldSelect}
</Form.Item>,
<Form.Item
key="ReceivableCustomField3"
name={["accountingconfig", "ReceivableCustomField3"]}
label={t("bodyshop.fields.ReceivableCustomField", { number: 3 })}
>
{ReceivableCustomFieldSelect}
</Form.Item>,
<Form.Item
key="md_classes"
name={["md_classes"]}
label={t("bodyshop.fields.md_classes")}
rules={[
({ getFieldValue }) => {
return {
required: getFieldValue("enforce_class"),
//message: t("general.validation.required"),
type: "array"
};
}
]}
>
<Select mode="tags" />
</Form.Item>,
<Form.Item
key="enforce_class"
name={["enforce_class"]}
label={t("bodyshop.fields.enforce_class")}
valuePropName="checked"
>
<Switch />
</Form.Item>,
<Form.Item
key="accumulatePayableLines"
name={["accountingconfig", "accumulatePayableLines"]}
label={t("bodyshop.fields.accumulatePayableLines")}
valuePropName="checked"
>
<Switch />
</Form.Item>
]
: []
: []),
<Form.Item
key="inhousevendorid"
label={t("bodyshop.fields.inhousevendorid")}
name={"inhousevendorid"}
rules={[
{
required: true
}
]}
>
<Input />
</Form.Item>,
<Form.Item
key="default_adjustment_rate"
label={t("bodyshop.fields.default_adjustment_rate")}
name={"default_adjustment_rate"}
rules={[
{
required: true
}
]}
>
<InputNumber min={0} precision={2} />
</Form.Item>,
InstanceRenderManager({
imex: (
<Form.Item key="federal_tax_id" label={t("bodyshop.fields.federal_tax_id")} name="federal_tax_id">
<Input />
</Form.Item>
)
}),
<Form.Item key="state_tax_id" label={t("bodyshop.fields.state_tax_id")} name="state_tax_id">
<Input />
</Form.Item>,
...(HasFeatureAccess({ featureName: "bills", bodyshop })
? [
InstanceRenderManager({
imex: (
<Form.Item
key="invoice_federal_tax_rate"
label={t("bodyshop.fields.invoice_federal_tax_rate")}
name={["bill_tax_rates", "federal_tax_rate"]}
rules={[
{
required: true
}
]}
>
<InputNumber />
</Form.Item>
)
}),
<Form.Item
key="invoice_state_tax_rate"
label={t("bodyshop.fields.invoice_state_tax_rate")}
name={["bill_tax_rates", "state_tax_rate"]}
rules={[
{
required: true
}
]}
>
<InputNumber />
</Form.Item>,
<Form.Item
key="invoice_local_tax_rate"
label={t("bodyshop.fields.invoice_local_tax_rate")}
name={["bill_tax_rates", "local_tax_rate"]}
rules={[
{
required: true
}
]}
>
<InputNumber />
</Form.Item>
]
: []),
<>
<Form.Item
key="md_payment_types"
name={["md_payment_types"]}
@@ -333,85 +108,354 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
]}
>
<Select mode="tags" />
</Form.Item>,
...(HasFeatureAccess({ featureName: "timetickets", bodyshop })
? [
</Form.Item>
<div style={{ display: "grid", gap: 16, marginTop: 16 }}>
<Row gutter={[16, 0]} wrap>
<Col xs={24} sm={12} xl={8}>
<Form.Item
key="tt_allow_post_to_invoiced"
name={["tt_allow_post_to_invoiced"]}
label={t("bodyshop.fields.tt_allow_post_to_invoiced")}
valuePropName="checked"
key="inhousevendorid"
label={t("bodyshop.fields.inhousevendorid")}
name={"inhousevendorid"}
rules={[
{
required: true
}
]}
>
<Switch />
</Form.Item>,
<Form.Item
key="tt_enforce_hours_for_tech_console"
name={["tt_enforce_hours_for_tech_console"]}
label={t("bodyshop.fields.tt_enforce_hours_for_tech_console")}
valuePropName="checked"
>
<Switch />
<Input />
</Form.Item>
]
: []),
...(HasFeatureAccess({ featureName: "bills", bodyshop })
? [
</Col>
<Col xs={24} sm={12} xl={8}>
<Form.Item
key="bill_allow_post_to_closed"
name={["bill_allow_post_to_closed"]}
label={t("bodyshop.fields.bill_allow_post_to_closed")}
valuePropName="checked"
key="default_adjustment_rate"
label={t("bodyshop.fields.default_adjustment_rate")}
name={"default_adjustment_rate"}
rules={[
{
required: true
}
]}
>
<Switch />
</Form.Item>,
<Form.Item
key="disableBillCostCalculation"
name={["accountingconfig", "disableBillCostCalculation"]}
label={t("bodyshop.fields.disableBillCostCalculation")}
valuePropName="checked"
>
<Switch />
<InputNumber min={0} precision={2} />
</Form.Item>
]
: []),
...(HasFeatureAccess({ featureName: "export", bodyshop })
? [
...(ClosingPeriod.treatment === "on"
? [
<Form.Item
key="ClosingPeriod"
name={["accountingconfig", "ClosingPeriod"]}
label={t("bodyshop.fields.closingperiod")}
>
<DatePicker.RangePicker format="MM/DD/YYYY" presets={DatePickerRanges} />
</Col>
{InstanceRenderManager({
imex: (
<Col xs={24} sm={12} xl={8}>
<Form.Item key="federal_tax_id" label={t("bodyshop.fields.federal_tax_id")} name="federal_tax_id">
<Input />
</Form.Item>
</Col>
)
})}
<Col xs={24} sm={12} xl={8}>
<Form.Item key="state_tax_id" label={t("bodyshop.fields.state_tax_id")} name="state_tax_id">
<Input />
</Form.Item>
</Col>
{HasFeatureAccess({ featureName: "export", bodyshop }) &&
ClosingPeriod.treatment === "on" && (
<Col xs={24} sm={12} xl={8}>
<Form.Item
key="ClosingPeriod"
name={["accountingconfig", "ClosingPeriod"]}
label={t("bodyshop.fields.closingperiod")}
>
<DatePicker.RangePicker format="MM/DD/YYYY" presets={DatePickerRanges} />
</Form.Item>
</Col>
)}
{HasFeatureAccess({ featureName: "export", bodyshop }) &&
ADPPayroll.treatment === "on" && (
<Col xs={24} sm={12} xl={8}>
<Form.Item
key="companyCode"
name={["accountingconfig", "companyCode"]}
label={t("bodyshop.fields.companycode")}
>
<Input />
</Form.Item>
</Col>
)}
{HasFeatureAccess({ featureName: "export", bodyshop }) &&
ADPPayroll.treatment === "on" && (
<Col xs={24} sm={12} xl={8}>
<Form.Item key="batchID" name={["accountingconfig", "batchID"]} label={t("bodyshop.fields.batchid")}>
<Input />
</Form.Item>
</Col>
)}
{HasFeatureAccess({ featureName: "export", bodyshop }) && !hasDMSKey && (
<>
<Col xs={24} sm={12} xl={8}>
<Form.Item
key="accountingtiers"
label={t("bodyshop.labels.accountingtiers")}
rules={[
{
required: true
//message: t("general.validation.required"),
}
]}
name={["accountingconfig", "tiers"]}
>
<Radio.Group>
<Radio value={2}>2</Radio>
<Radio value={3}>3</Radio>
</Radio.Group>
</Form.Item>
</Col>
<Col xs={24} sm={12} xl={8}>
<Form.Item key="twotierpref_wrapper" shouldUpdate noStyle>
{() => {
return (
<Form.Item
label={t("bodyshop.labels.2tiersetup")}
shouldUpdate
rules={[
{
required: form.getFieldValue(["accountingconfig", "tiers"]) === 2
//message: t("general.validation.required"),
}
]}
name={["accountingconfig", "twotierpref"]}
>
<Radio.Group disabled={form.getFieldValue(["accountingconfig", "tiers"]) === 3}>
<Radio value="name">{t("bodyshop.labels.2tiername")}</Radio>
<Radio value="source">{t("bodyshop.labels.2tiersource")}</Radio>
</Radio.Group>
</Form.Item>
);
}}
</Form.Item>
</Col>
<Col xs={24} sm={12} xl={8}>
<Form.Item
key="md_classes"
name={["md_classes"]}
label={t("bodyshop.fields.md_classes")}
rules={[
({ getFieldValue }) => {
return {
required: getFieldValue("enforce_class"),
//message: t("general.validation.required"),
type: "array"
};
}
]}
>
<Select mode="tags" />
</Form.Item>
</Col>
</>
)}
</Row>
<Divider style={{ margin: "0" }} />
<Row gutter={[16, 0]} wrap>
{HasFeatureAccess({ featureName: "export", bodyshop }) && !hasDMSKey && (
<>
<Col xs={24} sm={12} xl={8}>
<Form.Item
key="printlater"
label={t("bodyshop.labels.printlater")}
valuePropName="checked"
name={["accountingconfig", "printlater"]}
>
<Switch />
</Form.Item>
</Col>
<Col xs={24} sm={12} xl={8}>
<Form.Item
key="emaillater"
label={t("bodyshop.labels.emaillater")}
valuePropName="checked"
name={["accountingconfig", "emaillater"]}
>
<Switch />
</Form.Item>
</Col>
<Col xs={24} sm={12} xl={8}>
<Form.Item
key="enforce_class"
name={["enforce_class"]}
label={t("bodyshop.fields.enforce_class")}
valuePropName="checked"
>
<Switch />
</Form.Item>
</Col>
<Col xs={24} sm={12} xl={8}>
<Form.Item
key="accumulatePayableLines"
name={["accountingconfig", "accumulatePayableLines"]}
label={t("bodyshop.fields.accumulatePayableLines")}
valuePropName="checked"
>
<Switch />
</Form.Item>
</Col>
</>
)}
{HasFeatureAccess({ featureName: "timetickets", bodyshop }) && (
<>
<Col xs={24} sm={12} xl={8}>
<Form.Item
key="tt_allow_post_to_invoiced"
name={["tt_allow_post_to_invoiced"]}
label={t("bodyshop.fields.tt_allow_post_to_invoiced")}
valuePropName="checked"
>
<Switch />
</Form.Item>
</Col>
<Col xs={24} sm={12} xl={8}>
<Form.Item
key="tt_enforce_hours_for_tech_console"
name={["tt_enforce_hours_for_tech_console"]}
label={t("bodyshop.fields.tt_enforce_hours_for_tech_console")}
valuePropName="checked"
>
<Switch />
</Form.Item>
</Col>
</>
)}
{HasFeatureAccess({ featureName: "bills", bodyshop }) && (
<>
<Col xs={24} sm={12} xl={8}>
<Form.Item
key="bill_allow_post_to_closed"
name={["bill_allow_post_to_closed"]}
label={t("bodyshop.fields.bill_allow_post_to_closed")}
valuePropName="checked"
>
<Switch />
</Form.Item>
</Col>
<Col xs={24} sm={12} xl={8}>
<Form.Item
key="disableBillCostCalculation"
name={["accountingconfig", "disableBillCostCalculation"]}
label={t("bodyshop.fields.disableBillCostCalculation")}
valuePropName="checked"
>
<Switch />
</Form.Item>
</Col>
</>
)}
</Row>
{HasFeatureAccess({ featureName: "export", bodyshop }) && !hasDMSKey && (
<LayoutFormRow
header={t("bodyshop.labels.responsibilitycenters.quickbooks_qbd")}
grow
style={{ marginBottom: 0 }}
extra={
<Space size={12} align="center" split={<span style={INLINE_TITLE_SEPARATOR_STYLE} />}>
<div style={INLINE_TITLE_SWITCH_GROUP_STYLE}>
<span style={INLINE_TITLE_LABEL_STYLE}>{t("bodyshop.labels.qbo")}</span>
<Form.Item noStyle valuePropName="checked" name={["accountingconfig", "qbo"]}>
<Switch />
</Form.Item>
]
: []),
...(ADPPayroll.treatment === "on"
? [
<Form.Item
key="companyCode"
name={["accountingconfig", "companyCode"]}
label={t("bodyshop.fields.companycode")}
>
<Input />
</Form.Item>
]
: []),
...(ADPPayroll.treatment === "on"
? [
<Form.Item
key="batchID"
name={["accountingconfig", "batchID"]}
label={t("bodyshop.fields.batchid")}
>
<Input />
</Form.Item>
]
: [])
]
: [])
]}
</div>
{InstanceRenderManager({
imex: (
<div style={INLINE_TITLE_SWITCH_GROUP_STYLE}>
<span style={INLINE_TITLE_LABEL_STYLE}>{t("bodyshop.labels.qbo_usa")}</span>
<Form.Item key="qbo_usa_wrapper" shouldUpdate noStyle>
{() => (
<Form.Item noStyle valuePropName="checked" name={["accountingconfig", "qbo_usa"]}>
<Switch disabled={!form.getFieldValue(["accountingconfig", "qbo"])} />
</Form.Item>
)}
</Form.Item>
</div>
)
})}
</Space>
}
>
<Form.Item
key="qbo_departmentid"
label={t("bodyshop.labels.qbo_departmentid")}
name={["accountingconfig", "qbo_departmentid"]}
>
<Input />
</Form.Item>
<Form.Item
key="ReceivableCustomField1"
name={["accountingconfig", "ReceivableCustomField1"]}
label={t("bodyshop.fields.ReceivableCustomField", { number: 1 })}
>
{ReceivableCustomFieldSelect}
</Form.Item>
<Form.Item
key="ReceivableCustomField2"
name={["accountingconfig", "ReceivableCustomField2"]}
label={t("bodyshop.fields.ReceivableCustomField", { number: 2 })}
>
{ReceivableCustomFieldSelect}
</Form.Item>
<Form.Item
key="ReceivableCustomField3"
name={["accountingconfig", "ReceivableCustomField3"]}
label={t("bodyshop.fields.ReceivableCustomField", { number: 3 })}
>
{ReceivableCustomFieldSelect}
</Form.Item>
</LayoutFormRow>
)}
{HasFeatureAccess({ featureName: "bills", bodyshop }) && (
<LayoutFormRow header={t("bodyshop.labels.responsibilitycenters.invoices")} grow style={{ marginBottom: 0 }}>
{InstanceRenderManager({
imex: (
<Form.Item
key="invoice_federal_tax_rate"
label={t("bodyshop.fields.responsibilitycenters.invoice_federal_tax_rate_short")}
name={["bill_tax_rates", "federal_tax_rate"]}
rules={[
{
required: true
}
]}
>
<InputNumber suffix="%" />
</Form.Item>
)
})}
<Form.Item
key="invoice_state_tax_rate"
label={t("bodyshop.fields.responsibilitycenters.invoice_state_tax_rate_short")}
name={["bill_tax_rates", "state_tax_rate"]}
rules={[
{
required: true
}
]}
>
<InputNumber suffix="%" />
</Form.Item>
<Form.Item
key="invoice_local_tax_rate"
label={t("bodyshop.fields.responsibilitycenters.invoice_local_tax_rate_short")}
name={["bill_tax_rates", "local_tax_rate"]}
rules={[
{
required: true
}
]}
>
<InputNumber suffix="%" />
</Form.Item>
</LayoutFormRow>
)}
</div>
</>
</LayoutFormRow>
{hasDMSKey && (
<LayoutFormRow header={t("bodyshop.labels.dms_setup")} id="dms_setup">
@@ -465,7 +509,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
label={t("bodyshop.fields.dms.sendmaterialscosting")}
name={["cdk_configuration", "sendmaterialscosting"]}
>
<InputNumber min={0} max={100} />
<InputNumber min={0} max={100} suffix="%" />
</Form.Item>
{bodyshop.pbs_serialnumber && (
<Form.Item
@@ -687,8 +731,13 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
{renderListOrEmpty(fields, t("bodyshop.actions.add_cost_center"), () =>
fields.map((field, index) => {
return (
<Form.Item key={field.key}>
<LayoutFormRow
<Form.Item noStyle key={field.key}>
<InlineValidatedFormRow
form={form}
errorNames={[
["md_responsibility_centers", "costs", field.name, "name"],
["md_responsibility_centers", "costs", field.name, "accountdesc"]
]}
noDivider
title={
<div style={INLINE_TITLE_ROW_STYLE}>
@@ -804,7 +853,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
<Input onBlur={handleBlur} />
</Form.Item>
)}
</LayoutFormRow>
</InlineValidatedFormRow>
</Form.Item>
);
})
@@ -830,8 +879,13 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
{renderListOrEmpty(fields, t("bodyshop.actions.add_profit_center"), () =>
fields.map((field, index) => {
return (
<Form.Item key={field.key}>
<LayoutFormRow
<Form.Item noStyle key={field.key}>
<InlineValidatedFormRow
form={form}
errorNames={[
["md_responsibility_centers", "profits", field.name, "name"],
["md_responsibility_centers", "profits", field.name, "accountdesc"]
]}
noDivider
title={
<div style={INLINE_TITLE_ROW_STYLE}>
@@ -974,7 +1028,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
/>
</Form.Item>
]}
</LayoutFormRow>
</InlineValidatedFormRow>
</Form.Item>
);
})
@@ -3277,90 +3331,110 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
)}
<LayoutFormRow header={t("bodyshop.labels.responsibilitycenters.tax_accounts")} id="tax_accounts">
<Form.Item
label={t("bodyshop.fields.responsibilitycenters.federal_tax")}
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "federal", "name"]}
>
<Input />
</Form.Item>
<Form.Item
label={t("bodyshop.fields.responsibilitycenter_accountdesc")}
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "federal", "accountdesc"]}
>
<Input />
</Form.Item>
<Form.Item
label={t("bodyshop.fields.responsibilitycenter_accountitem")}
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "federal", "accountitem"]}
>
<Input />
</Form.Item>
{hasDMSKey && (
<Form.Item
label={t("bodyshop.fields.dms.dms_acctnumber")}
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "federal", "dms_acctnumber"]}
<div style={{ display: "grid", gap: 16 }}>
<LayoutFormRow
header={t("bodyshop.fields.responsibilitycenters.federal_tax")}
grow
style={{ marginBottom: 0 }}
>
<Input />
</Form.Item>
)}
<Form.Item
label={t("bodyshop.fields.responsibilitycenter_rate")}
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "federal", "rate"]}
>
<InputNumber precision={2} />
</Form.Item>
{InstanceRenderManager({
imex: [
<Form.Item
key="state_tax_name"
label={t("bodyshop.fields.responsibilitycenters.state_tax")}
label={t("bodyshop.fields.responsibilitycenters.federal_tax")}
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "state", "name"]}
name={["md_responsibility_centers", "taxes", "federal", "name"]}
col={taxAccountRowCol}
>
<Input />
</Form.Item>,
</Form.Item>
<Form.Item
key="state_tax_accountdesc"
label={t("bodyshop.fields.responsibilitycenter_accountdesc")}
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "state", "accountdesc"]}
name={["md_responsibility_centers", "taxes", "federal", "accountdesc"]}
col={taxAccountRowCol}
>
<Input />
</Form.Item>,
</Form.Item>
<Form.Item
key="state_tax_accountitem"
label={t("bodyshop.fields.responsibilitycenter_accountitem")}
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "state", "accountitem"]}
name={["md_responsibility_centers", "taxes", "federal", "accountitem"]}
col={taxAccountRowCol}
>
<Input />
</Form.Item>,
hasDMSKey ? (
</Form.Item>
<Form.Item
label={t("bodyshop.fields.responsibilitycenter_rate")}
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "federal", "rate"]}
col={taxAccountRowCol}
>
<InputNumber precision={2} suffix="%" />
</Form.Item>
{hasDMSKey && (
<Form.Item
key="state_tax_dms_acctnumber"
label={t("bodyshop.fields.dms.dms_acctnumber")}
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "state", "dms_acctnumber"]}
name={["md_responsibility_centers", "taxes", "federal", "dms_acctnumber"]}
col={taxAccountFullRowCol}
>
<Input />
</Form.Item>
) : null,
<Form.Item
key="state_tax_rate"
label={t("bodyshop.fields.responsibilitycenter_rate")}
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "state", "rate"]}
>
<InputNumber precision={2} />
</Form.Item>
],
rome: null
})}
)}
</LayoutFormRow>
{InstanceRenderManager({
imex: (
<LayoutFormRow
header={t("bodyshop.fields.responsibilitycenters.state_tax")}
grow
style={{ marginBottom: 0 }}
>
<Form.Item
label={t("bodyshop.fields.responsibilitycenters.state_tax")}
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "state", "name"]}
col={taxAccountRowCol}
>
<Input />
</Form.Item>
<Form.Item
label={t("bodyshop.fields.responsibilitycenter_accountdesc")}
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "state", "accountdesc"]}
col={taxAccountRowCol}
>
<Input />
</Form.Item>
<Form.Item
label={t("bodyshop.fields.responsibilitycenter_accountitem")}
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "state", "accountitem"]}
col={taxAccountRowCol}
>
<Input />
</Form.Item>
<Form.Item
label={t("bodyshop.fields.responsibilitycenter_rate")}
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "state", "rate"]}
col={taxAccountRowCol}
>
<InputNumber precision={2} suffix="%" />
</Form.Item>
{hasDMSKey && (
<Form.Item
label={t("bodyshop.fields.dms.dms_acctnumber")}
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "state", "dms_acctnumber"]}
col={taxAccountFullRowCol}
>
<Input />
</Form.Item>
)}
</LayoutFormRow>
),
rome: null
})}
</div>
</LayoutFormRow>
{DmsAp.treatment === "on" && (
@@ -3400,7 +3474,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
rules={[{ required: true }]}
name={["md_responsibility_centers", "taxes", "federal_itc", "rate"]}
>
<InputNumber precision={2} />
<InputNumber precision={2} suffix="%" />
</Form.Item>
</LayoutFormRow>
)}
@@ -3541,8 +3615,13 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
{renderListOrEmpty(fields, t("bodyshop.actions.newsalestaxcode"), () =>
fields.map((field, index) => {
return (
<Form.Item key={field.key}>
<LayoutFormRow
<Form.Item noStyle key={field.key}>
<InlineValidatedFormRow
form={form}
errorNames={[
["md_responsibility_centers", "sales_tax_codes", field.name, "description"],
["md_responsibility_centers", "sales_tax_codes", field.name, "code"]
]}
id="sales_tax_codes"
noDivider
title={
@@ -3623,7 +3702,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
>
<Switch />
</Form.Item>
</LayoutFormRow>
</InlineValidatedFormRow>
</Form.Item>
);
})