3552 lines
177 KiB
JavaScript
3552 lines
177 KiB
JavaScript
import { DeleteFilled } from "@ant-design/icons";
|
|
import { useTreatmentsWithConfig } from "@splitsoftware/splitio-react";
|
|
import { Button, DatePicker, Form, Input, InputNumber, Radio, Select, Space, Switch } from "antd";
|
|
import { useState } from "react";
|
|
import { useTranslation } from "react-i18next";
|
|
import { connect } from "react-redux";
|
|
import { createStructuredSelector } from "reselect";
|
|
import styled from "styled-components";
|
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
|
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
|
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 LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
|
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
|
import ShopInfoResponsibilitycentersTaxesComponent from "./shop-info.responsibilitycenters.taxes.component";
|
|
import { bodyshopHasDmsKey } from "../../utils/dmsUtils.js";
|
|
import DatePickerRanges from "../../utils/DatePickerRanges";
|
|
|
|
const SelectorDiv = styled.div`
|
|
.ant-form-item .ant-select {
|
|
width: 125px;
|
|
}
|
|
`;
|
|
|
|
const mapStateToProps = createStructuredSelector({
|
|
bodyshop: selectBodyshop
|
|
});
|
|
const mapDispatchToProps = () => ({});
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(ShopInfoResponsibilityCenterComponent);
|
|
|
|
export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
|
const { t } = useTranslation();
|
|
const dmsPayers = Form.useWatch(["cdk_configuration", "payers"], form) || [];
|
|
const costResponsibilityCenters = Form.useWatch(["md_responsibility_centers", "costs"], form) || [];
|
|
const profitResponsibilityCenters = Form.useWatch(["md_responsibility_centers", "profits"], form) || [];
|
|
|
|
const hasDMSKey = bodyshopHasDmsKey(bodyshop);
|
|
|
|
const {
|
|
treatments: { ClosingPeriod, ADPPayroll, Qb_Multi_Ar, DmsAp }
|
|
} = useTreatmentsWithConfig({
|
|
attributes: {},
|
|
names: ["ClosingPeriod", "ADPPayroll", "Qb_Multi_Ar", "DmsAp"],
|
|
splitKey: bodyshop?.imexshopid
|
|
});
|
|
|
|
const [costOptions, setCostOptions] = useState([
|
|
...((form.getFieldValue(["md_responsibility_centers", "costs"]) &&
|
|
form.getFieldValue(["md_responsibility_centers", "costs"]).map((i) => i && i.name)) ||
|
|
[])
|
|
]);
|
|
|
|
const [profitOptions, setProfitOptions] = useState([
|
|
...((form.getFieldValue(["md_responsibility_centers", "profits"]) &&
|
|
form.getFieldValue(["md_responsibility_centers", "profits"]).map((i) => i && i.name)) ||
|
|
[])
|
|
]);
|
|
|
|
const getCenterNames = (path) => {
|
|
const centers = form.getFieldValue(path) || [];
|
|
return centers.map((i) => i && i.name).filter(Boolean);
|
|
};
|
|
|
|
const handleBlur = () => {
|
|
setCostOptions(getCenterNames(["md_responsibility_centers", "costs"]));
|
|
setProfitOptions(getCenterNames(["md_responsibility_centers", "profits"]));
|
|
};
|
|
|
|
const ReceivableCustomFieldSelect = (
|
|
<Select
|
|
allowClear
|
|
options={[
|
|
{ value: "v_vin", label: "VIN" },
|
|
{ value: "clm_no", label: "Claim No." },
|
|
{ value: "ded_amt", label: "Deductible Amount" }
|
|
]}
|
|
/>
|
|
);
|
|
|
|
return (
|
|
<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"]}
|
|
label={t("bodyshop.fields.md_payment_types")}
|
|
rules={[
|
|
{
|
|
required: true,
|
|
type: "array"
|
|
}
|
|
]}
|
|
>
|
|
<Select mode="tags" />
|
|
</Form.Item>,
|
|
...(HasFeatureAccess({ featureName: "timetickets", bodyshop })
|
|
? [
|
|
<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>,
|
|
<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>
|
|
]
|
|
: []),
|
|
...(HasFeatureAccess({ featureName: "bills", bodyshop })
|
|
? [
|
|
<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>,
|
|
<Form.Item
|
|
key="disableBillCostCalculation"
|
|
name={["accountingconfig", "disableBillCostCalculation"]}
|
|
label={t("bodyshop.fields.disableBillCostCalculation")}
|
|
valuePropName="checked"
|
|
>
|
|
<Switch />
|
|
</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} />
|
|
</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>
|
|
]
|
|
: [])
|
|
]
|
|
: [])
|
|
]}
|
|
</LayoutFormRow>
|
|
{hasDMSKey && (
|
|
<LayoutFormRow header={t("bodyshop.labels.dms_setup")} id="dms_setup">
|
|
<div>
|
|
<LayoutFormRow id="dmsconfiguration" grow={true}>
|
|
{bodyshop.rr_dealerid && (
|
|
<DataLabel label={t("bodyshop.labels.dms.rr_dealerid")}>
|
|
{form.getFieldValue("rr_dealerid")}
|
|
</DataLabel>
|
|
)}
|
|
{bodyshop.cdk_dealerid && (
|
|
<DataLabel label={t("bodyshop.labels.dms.cdk_dealerid")}>
|
|
{form.getFieldValue("cdk_dealerid")}
|
|
</DataLabel>
|
|
)}
|
|
{bodyshop.pbs_serialnumber && (
|
|
<DataLabel label={t("bodyshop.labels.dms.pbs_serialnumber")}>
|
|
{form.getFieldValue("pbs_serialnumber")}
|
|
</DataLabel>
|
|
)}
|
|
</LayoutFormRow>
|
|
<LayoutFormRow>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.default_journal")}
|
|
rules={[{ required: true }]}
|
|
name={["cdk_configuration", "default_journal"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.srcco")}
|
|
rules={[{ required: true }]}
|
|
name={["cdk_configuration", "srcco"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.generic_customer_number")}
|
|
name={["cdk_configuration", "generic_customer_number"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.cashierid")}
|
|
rules={[{ required: true }]}
|
|
name={["cdk_configuration", "cashierid"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.sendmaterialscosting")}
|
|
name={["cdk_configuration", "sendmaterialscosting"]}
|
|
>
|
|
<InputNumber min={0} max={100} />
|
|
</Form.Item>
|
|
{bodyshop.pbs_serialnumber && (
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.disablecontactvehiclecreation")}
|
|
valuePropName="checked"
|
|
name={["pbs_configuration", "disablecontactvehicle"]}
|
|
>
|
|
<Switch />
|
|
</Form.Item>
|
|
)}
|
|
{bodyshop.pbs_serialnumber && (
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.disablebillwip")}
|
|
valuePropName="checked"
|
|
name={["pbs_configuration", "disablebillwip"]}
|
|
>
|
|
<Switch />
|
|
</Form.Item>
|
|
)}
|
|
{bodyshop.pbs_serialnumber && (
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.ro_posting")}
|
|
valuePropName="checked"
|
|
name={["pbs_configuration", "ro_posting"]}
|
|
>
|
|
<Switch />
|
|
</Form.Item>
|
|
)}
|
|
{bodyshop.pbs_serialnumber && (
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.appostingaccount")}
|
|
name={["pbs_configuration", "appostingaccount"]}
|
|
>
|
|
<Select
|
|
options={[
|
|
{ value: "wip", label: "WIP" },
|
|
{ value: "cogs", label: "COGS" }
|
|
]}
|
|
/>
|
|
</Form.Item>
|
|
)}
|
|
{bodyshop.pbs_serialnumber && (
|
|
<Form.Item label={t("bodyshop.fields.dms.apcontrol")} name={["pbs_configuration", "apcontrol"]}>
|
|
<Select
|
|
options={[
|
|
{ value: "ro", label: "RO Number" },
|
|
{ value: "vendordmsid", label: "Vendor DMS ID" }
|
|
]}
|
|
/>
|
|
</Form.Item>
|
|
)}
|
|
</LayoutFormRow>
|
|
|
|
{!bodyshop.rr_dealerid && (
|
|
<>
|
|
<LayoutFormRow header={t("bodyshop.labels.dms.cdk.payers")}>
|
|
<Form.List name={["cdk_configuration", "payers"]}>
|
|
{(fields, { add, remove, move }) => {
|
|
return (
|
|
<div>
|
|
{fields.map((field, index) => {
|
|
const dmsPayer = dmsPayers[field.name] || {};
|
|
|
|
return (
|
|
<Form.Item key={field.key}>
|
|
<LayoutFormRow
|
|
noDivider
|
|
title={getFormListItemTitle(
|
|
t("jobs.fields.dms.payer.name"),
|
|
index,
|
|
dmsPayer.name,
|
|
dmsPayer.dms_acctnumber
|
|
)}
|
|
extra={
|
|
<Space align="center" size="small">
|
|
<Button
|
|
type="text"
|
|
icon={<DeleteFilled />}
|
|
onClick={() => {
|
|
remove(field.name);
|
|
}}
|
|
/>
|
|
<FormListMoveArrows
|
|
move={move}
|
|
index={index}
|
|
total={fields.length}
|
|
orientation="horizontal"
|
|
/>
|
|
</Space>
|
|
}
|
|
>
|
|
<Form.Item
|
|
label={t("jobs.fields.dms.payer.name")}
|
|
key={`${index}name`}
|
|
name={[field.name, "name"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("jobs.fields.dms.payer.dms_acctnumber")}
|
|
key={`${index}dms_acctnumber`}
|
|
name={[field.name, "dms_acctnumber"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("jobs.fields.dms.payer.control_type")}
|
|
key={`${index}control_type`}
|
|
name={[field.name, "control_type"]}
|
|
>
|
|
<Select
|
|
allowClear
|
|
showSearch
|
|
options={[
|
|
{ value: "ro_number", label: t("jobs.fields.ro_number") },
|
|
{ value: "clm_no", label: t("jobs.fields.clm_no") },
|
|
{ value: "po_number", label: t("jobs.fields.ponumber") },
|
|
{
|
|
value: "account_number",
|
|
label: t("jobs.fields.dms.control_type.account_number")
|
|
}
|
|
]}
|
|
/>
|
|
</Form.Item>
|
|
</LayoutFormRow>
|
|
</Form.Item>
|
|
);
|
|
})}
|
|
<Form.Item>
|
|
<Button
|
|
type="dashed"
|
|
onClick={() => {
|
|
add();
|
|
}}
|
|
style={{ width: "100%" }}
|
|
>
|
|
{t("general.actions.add")}
|
|
</Button>
|
|
</Form.Item>
|
|
</div>
|
|
);
|
|
}}
|
|
</Form.List>
|
|
</LayoutFormRow>
|
|
<LayoutFormRow header={t("bodyshop.labels.dms.cdk.controllist")}>
|
|
<Form.List name={["cdk_configuration", "controllist"]}>
|
|
{(fields, { add, remove }) => {
|
|
return (
|
|
<div>
|
|
{fields.map((field, index) => (
|
|
<Form.Item key={field.key}>
|
|
<LayoutFormRow noDivider>
|
|
<Form.Item
|
|
label={t("jobs.fields.dms.payer.name")}
|
|
key={`${index}name`}
|
|
name={[field.name, "name"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("jobs.fields.dms.payer.controlnumber")}
|
|
key={`${index}controlnumber`}
|
|
name={[field.name, "controlnumber"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<DeleteFilled
|
|
onClick={() => {
|
|
remove(field.name);
|
|
}}
|
|
/>
|
|
</LayoutFormRow>
|
|
</Form.Item>
|
|
))}
|
|
<Form.Item>
|
|
<Button
|
|
type="dashed"
|
|
onClick={() => {
|
|
add();
|
|
}}
|
|
style={{ width: "100%" }}
|
|
>
|
|
{t("general.actions.add")}
|
|
</Button>
|
|
</Form.Item>
|
|
</div>
|
|
);
|
|
}}
|
|
</Form.List>
|
|
</LayoutFormRow>
|
|
</>
|
|
)}
|
|
</div>
|
|
</LayoutFormRow>
|
|
)}
|
|
{HasFeatureAccess({ featureName: "export", bodyshop }) && (
|
|
<>
|
|
<LayoutFormRow header={t("bodyshop.labels.responsibilitycenters.costs")} id="costs">
|
|
<Form.List name={["md_responsibility_centers", "costs"]}>
|
|
{(fields, { add, remove, move }) => {
|
|
return (
|
|
<div>
|
|
{fields.map((field, index) => {
|
|
const responsibilityCenter = costResponsibilityCenters[field.name] || {};
|
|
|
|
return (
|
|
<Form.Item key={field.key}>
|
|
<LayoutFormRow
|
|
noDivider
|
|
title={getFormListItemTitle(
|
|
t("bodyshop.fields.responsibilitycenter"),
|
|
index,
|
|
responsibilityCenter.name,
|
|
responsibilityCenter.accountname
|
|
)}
|
|
extra={
|
|
<Space align="center" size="small">
|
|
<Button
|
|
type="text"
|
|
icon={<DeleteFilled />}
|
|
onClick={() => {
|
|
remove(field.name);
|
|
}}
|
|
/>
|
|
<FormListMoveArrows
|
|
move={move}
|
|
index={index}
|
|
total={fields.length}
|
|
orientation="horizontal"
|
|
/>
|
|
</Space>
|
|
}
|
|
>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenter")}
|
|
key={`${index}name`}
|
|
name={[field.name, "name"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input onBlur={handleBlur} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenter_accountname")}
|
|
key={`${index}accountname`}
|
|
name={[field.name, "accountname"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input onBlur={handleBlur} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenter_accountdesc")}
|
|
key={`${index}accountdesc`}
|
|
name={[field.name, "accountdesc"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input onBlur={handleBlur} />
|
|
</Form.Item>
|
|
|
|
{hasDMSKey && !bodyshop.rr_dealerid && (
|
|
<>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.dms_acctnumber")}
|
|
key={`${index}dms_acctnumber`}
|
|
name={[field.name, "dms_acctnumber"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input onBlur={handleBlur} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.dms_wip_acctnumber")}
|
|
key={`${index}dms_wip_acctnumber`}
|
|
name={[field.name, "dms_wip_acctnumber"]}
|
|
rules={[
|
|
{
|
|
required: true
|
|
}
|
|
]}
|
|
>
|
|
<Input onBlur={handleBlur} />
|
|
</Form.Item>
|
|
</>
|
|
)}
|
|
|
|
{bodyshop.cdk_dealerid && (
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.dms_control_override")}
|
|
key={`${index}dms_control_override`}
|
|
name={[field.name, "dms_control_override"]}
|
|
>
|
|
<Input onBlur={handleBlur} />
|
|
</Form.Item>
|
|
)}
|
|
</LayoutFormRow>
|
|
</Form.Item>
|
|
);
|
|
})}
|
|
<Form.Item>
|
|
<Button
|
|
type="dashed"
|
|
onClick={() => {
|
|
add();
|
|
}}
|
|
style={{ width: "100%" }}
|
|
>
|
|
{t("general.actions.add")}
|
|
</Button>
|
|
</Form.Item>
|
|
</div>
|
|
);
|
|
}}
|
|
</Form.List>
|
|
</LayoutFormRow>
|
|
<LayoutFormRow header={t("bodyshop.labels.responsibilitycenters.profits")} id="profits">
|
|
<Form.List name={["md_responsibility_centers", "profits"]}>
|
|
{(fields, { add, remove, move }) => {
|
|
return (
|
|
<div>
|
|
{fields.map((field, index) => {
|
|
const responsibilityCenter = profitResponsibilityCenters[field.name] || {};
|
|
|
|
return (
|
|
<Form.Item key={field.key}>
|
|
<LayoutFormRow
|
|
noDivider
|
|
title={getFormListItemTitle(
|
|
t("bodyshop.fields.responsibilitycenter"),
|
|
index,
|
|
responsibilityCenter.name,
|
|
responsibilityCenter.accountdesc
|
|
)}
|
|
extra={
|
|
<Space align="center" size="small">
|
|
<Button
|
|
type="text"
|
|
icon={<DeleteFilled />}
|
|
onClick={() => {
|
|
remove(field.name);
|
|
}}
|
|
/>
|
|
<FormListMoveArrows
|
|
move={move}
|
|
index={index}
|
|
total={fields.length}
|
|
orientation="horizontal"
|
|
/>
|
|
</Space>
|
|
}
|
|
>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenter")}
|
|
key={`${index}name`}
|
|
name={[field.name, "name"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input onBlur={handleBlur} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenter_accountdesc")}
|
|
key={`${index}accountdesc`}
|
|
name={[field.name, "accountdesc"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input onBlur={handleBlur} />
|
|
</Form.Item>
|
|
{!hasDMSKey && (
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenter_accountitem")}
|
|
key={`${index}accountitem`}
|
|
name={[field.name, "accountitem"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input onBlur={handleBlur} />
|
|
</Form.Item>
|
|
)}
|
|
{hasDMSKey && !bodyshop.rr_dealerid && (
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.dms_acctnumber")}
|
|
key={`${index}dms_acctnumber`}
|
|
name={[field.name, "dms_acctnumber"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input onBlur={handleBlur} />
|
|
</Form.Item>
|
|
)}
|
|
{bodyshop.cdk_dealerid && (
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.dms_control_override")}
|
|
key={`${index}dms_control_override`}
|
|
name={[field.name, "dms_control_override"]}
|
|
>
|
|
<Input onBlur={handleBlur} />
|
|
</Form.Item>
|
|
)}
|
|
{bodyshop.rr_dealerid && (
|
|
<>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.gogcode")}
|
|
key={`${index}rr_gogcode`}
|
|
name={[field.name, "rr_gogcode"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input onBlur={handleBlur} />
|
|
</Form.Item>
|
|
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.item_type")}
|
|
key={`${index}rr_item_type`}
|
|
name={[field.name, "rr_item_type"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Select
|
|
options={[
|
|
{ value: "G", label: t("bodyshop.fields.responsibilitycenters.item_type_gog") },
|
|
{
|
|
value: "P",
|
|
label: t("bodyshop.fields.responsibilitycenters.item_type_paint")
|
|
},
|
|
{
|
|
value: "F",
|
|
label: t("bodyshop.fields.responsibilitycenters.item_type_freight")
|
|
}
|
|
]}
|
|
/>
|
|
</Form.Item>
|
|
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.taxable_flag")}
|
|
key={`${index}rr_cust_txbl_flag`}
|
|
name={[field.name, "rr_cust_txbl_flag"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Select
|
|
options={[
|
|
{ value: "T", label: t("bodyshop.fields.responsibilitycenters.taxable") },
|
|
{ value: "N", label: t("bodyshop.fields.responsibilitycenters.nontaxable") }
|
|
]}
|
|
/>
|
|
</Form.Item>
|
|
</>
|
|
)}
|
|
</LayoutFormRow>
|
|
</Form.Item>
|
|
);
|
|
})}
|
|
<Form.Item>
|
|
<Button
|
|
type="dashed"
|
|
onClick={() => {
|
|
add();
|
|
}}
|
|
style={{ width: "100%" }}
|
|
>
|
|
{t("general.actions.add")}
|
|
</Button>
|
|
</Form.Item>
|
|
</div>
|
|
);
|
|
}}
|
|
</Form.List>
|
|
</LayoutFormRow>
|
|
<SelectorDiv>
|
|
{hasDMSKey && (
|
|
<LayoutFormRow id="mappingname" header={t("bodyshop.labels.dms.dms_allocations")}>
|
|
<Form.List name={["md_responsibility_centers", "dms_defaults"]}>
|
|
{(fields, { add, remove }) => {
|
|
return (
|
|
<div>
|
|
{fields.map((field, index) => {
|
|
const dmsDefault = form.getFieldValue([
|
|
"md_responsibility_centers",
|
|
"dms_defaults",
|
|
field.name
|
|
]) || { name: undefined };
|
|
|
|
return (
|
|
<Form.Item key={field.key}>
|
|
<LayoutFormRow
|
|
title={getFormListItemTitle(
|
|
t("bodyshop.fields.dms.mappingname"),
|
|
index,
|
|
dmsDefault.name
|
|
)}
|
|
extra={
|
|
<Button
|
|
type="text"
|
|
icon={<DeleteFilled />}
|
|
onClick={() => {
|
|
remove(field.name);
|
|
}}
|
|
/>
|
|
}
|
|
>
|
|
<div>
|
|
<LayoutFormRow noDivider>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.mappingname")}
|
|
key={`${index}name`}
|
|
name={[field.name, "name"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.gst_override")}
|
|
name={[field.name, "gst_override"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
</LayoutFormRow>
|
|
<LayoutFormRow header={t("bodyshop.labels.dms.costsmapping")}>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.ats")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-ats`}
|
|
name={[field.name, "costs", "ATS"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.laa")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-LAA`}
|
|
name={[field.name, "costs", "LAA"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lab")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-LAB`}
|
|
name={[field.name, "costs", "LAB"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lad")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-LAD`}
|
|
name={[field.name, "costs", "LAD"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lae")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-LAE`}
|
|
name={[field.name, "costs", "LAE"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.laf")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-LAF`}
|
|
name={[field.name, "costs", "LAF"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lag")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-LAG`}
|
|
name={[field.name, "costs", "LAG"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lam")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-LAM`}
|
|
name={[field.name, "costs", "LAM"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lar")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-LAR`}
|
|
name={[field.name, "costs", "LAR"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.las")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-LAS`}
|
|
name={[field.name, "costs", "LAS"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lau")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-LAU`}
|
|
name={[field.name, "costs", "LAU"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.la1")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-LA1`}
|
|
name={[field.name, "costs", "LA1"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.la2")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-LA2`}
|
|
name={[field.name, "costs", "LA2"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.la3")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-LA3`}
|
|
name={[field.name, "costs", "LA3"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.la4")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-LA4`}
|
|
name={[field.name, "costs", "LA4"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.paa")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-PAA`}
|
|
name={[field.name, "costs", "PAA"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pac")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-PAC`}
|
|
name={[field.name, "costs", "PAC"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pag")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-PAG`}
|
|
name={[field.name, "costs", "PAG"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pal")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-PAL`}
|
|
name={[field.name, "costs", "PAL"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pam")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-PAM`}
|
|
name={[field.name, "costs", "PAM"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pan")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-PAN`}
|
|
name={[field.name, "costs", "PAN"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pao")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-PAO`}
|
|
name={[field.name, "costs", "PAO"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pap")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-PAP`}
|
|
name={[field.name, "costs", "PAP"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.par")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-PAR`}
|
|
name={[field.name, "costs", "PAR"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pas")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-PAS`}
|
|
name={[field.name, "costs", "PAS"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pasl")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-PASL`}
|
|
name={[field.name, "costs", "PASL"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.tow")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-TOW`}
|
|
name={[field.name, "costs", "TOW"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.mapa")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-MAPA`}
|
|
name={[field.name, "costs", "MAPA"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.mash")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}costs-MASH`}
|
|
name={[field.name, "costs", "MASH"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={costOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
</LayoutFormRow>
|
|
<LayoutFormRow header={t("bodyshop.labels.dms.profitsmapping")}>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.ats")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-ATS`}
|
|
name={[field.name, "profits", "ATS"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.laa")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-LAA`}
|
|
name={[field.name, "profits", "LAA"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lab")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-LAB`}
|
|
name={[field.name, "profits", "LAB"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lad")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-LAD`}
|
|
name={[field.name, "profits", "LAD"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lae")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-LAE`}
|
|
name={[field.name, "profits", "LAE"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.laf")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-LAF`}
|
|
name={[field.name, "profits", "LAF"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lag")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-LAG`}
|
|
name={[field.name, "profits", "LAG"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lam")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-LAM`}
|
|
name={[field.name, "profits", "LAM"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lar")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-LAR`}
|
|
name={[field.name, "profits", "LAR"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.las")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-LAS`}
|
|
name={[field.name, "profits", "LAS"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lau")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-LAU`}
|
|
name={[field.name, "profits", "LAU"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.la1")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-LA1`}
|
|
name={[field.name, "profits", "LA1"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.la2")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-LA2`}
|
|
name={[field.name, "profits", "LA2"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.la3")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-LA3`}
|
|
name={[field.name, "profits", "LA3"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.la4")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-LA4`}
|
|
name={[field.name, "profits", "LA4"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.paa")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-PAA`}
|
|
name={[field.name, "profits", "PAA"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pac")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-PAC`}
|
|
name={[field.name, "profits", "PAC"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pag")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-PAG`}
|
|
name={[field.name, "profits", "PAG"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pal")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-PAL`}
|
|
name={[field.name, "profits", "PAL"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pam")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-PAM`}
|
|
name={[field.name, "profits", "PAM"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pan")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-PAN`}
|
|
name={[field.name, "profits", "PAN"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pao")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-PAO`}
|
|
name={[field.name, "profits", "PAO"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pap")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-PAP`}
|
|
name={[field.name, "profits", "PAP"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.par")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-PAR`}
|
|
name={[field.name, "profits", "PAR"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pas")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-PAS`}
|
|
name={[field.name, "profits", "PAS"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pasl")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-PASL`}
|
|
name={[field.name, "profits", "PASL"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.tow")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-TOW`}
|
|
name={[field.name, "profits", "TOW"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.mapa")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-MAPA`}
|
|
name={[field.name, "profits", "MAPA"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.mash")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
key={`${index}profits-MASH`}
|
|
name={[field.name, "profits", "MASH"]}
|
|
>
|
|
<Select
|
|
showSearch
|
|
options={profitOptions.map((item) => ({ value: item, label: item }))}
|
|
/>
|
|
</Form.Item>
|
|
</LayoutFormRow>
|
|
</div>
|
|
</LayoutFormRow>
|
|
</Form.Item>
|
|
);
|
|
})}
|
|
<Form.Item>
|
|
<Button
|
|
type="dashed"
|
|
onClick={() => {
|
|
add();
|
|
}}
|
|
style={{ width: "100%" }}
|
|
>
|
|
{t("general.actions.add")}
|
|
</Button>
|
|
</Form.Item>
|
|
</div>
|
|
);
|
|
}}
|
|
</Form.List>
|
|
</LayoutFormRow>
|
|
)}
|
|
|
|
<LayoutFormRow header={t("bodyshop.labels.defaultcostsmapping")}>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.ats")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "ATS"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.laa")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "LAA"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lab")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "LAB"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lad")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "LAD"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lae")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "LAE"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.laf")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "LAF"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lag")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "LAG"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lam")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "LAM"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lar")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "LAR"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.las")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "LAS"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lau")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "LAU"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.la1")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "LA1"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.la2")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "LA2"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.la3")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "LA3"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.la4")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "LA4"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.paa")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "PAA"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pac")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "PAC"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pag")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "PAG"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pal")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "PAL"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pam")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "PAM"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pan")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "PAN"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pao")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "PAO"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pap")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "PAP"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.par")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "PAR"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pas")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "PAS"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pasl")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "PASL"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.tow")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "TOW"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.mapa")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "MAPA"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.mash")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (costOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "costs", "MASH"]}
|
|
>
|
|
<Select showSearch options={costOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
</LayoutFormRow>
|
|
<LayoutFormRow header={t("bodyshop.labels.defaultprofitsmapping")}>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.ats")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "ATS"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.laa")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "LAA"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lab")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "LAB"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lad")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "LAD"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lae")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "LAE"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.laf")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "LAF"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lag")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "LAG"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lam")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "LAM"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lar")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "LAR"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.las")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "LAS"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.lau")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "LAU"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.la1")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "LA1"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.la2")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "LA2"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.la3")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "LA3"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.la4")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "LA4"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.paa")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "PAA"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pac")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "PAC"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pag")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "PAG"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pal")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "PAL"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pam")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "PAM"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pan")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "PAN"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pao")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "PAO"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pap")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "PAP"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.par")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "PAR"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pas")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "PAS"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.pasl")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "PASL"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.tow")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "TOW"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.mapa")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "MAPA"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.mash")}
|
|
rules={[
|
|
{ required: true },
|
|
() => ({
|
|
validator(rule, value) {
|
|
if (profitOptions.includes(value)) {
|
|
return Promise.resolve();
|
|
}
|
|
return Promise.reject(t("bodyshop.validation.centermustexist"));
|
|
}
|
|
})
|
|
]}
|
|
name={["md_responsibility_centers", "defaults", "profits", "MASH"]}
|
|
>
|
|
<Select showSearch options={profitOptions.map((item) => ({ value: item, label: item }))} />
|
|
</Form.Item>
|
|
</LayoutFormRow>
|
|
</SelectorDiv>
|
|
</>
|
|
)}
|
|
|
|
<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"]}
|
|
>
|
|
<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")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "taxes", "state", "name"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>,
|
|
<Form.Item
|
|
key="state_tax_accountdesc"
|
|
label={t("bodyshop.fields.responsibilitycenter_accountdesc")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "taxes", "state", "accountdesc"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>,
|
|
<Form.Item
|
|
key="state_tax_accountitem"
|
|
label={t("bodyshop.fields.responsibilitycenter_accountitem")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "taxes", "state", "accountitem"]}
|
|
>
|
|
<Input />
|
|
</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"]}
|
|
>
|
|
<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>
|
|
|
|
{DmsAp.treatment === "on" && (
|
|
<LayoutFormRow id="federal_tax_itc">
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.federal_tax_itc")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "taxes", "federal_itc", "name"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenter_accountdesc")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "taxes", "federal_itc", "accountdesc"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenter_accountitem")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "taxes", "federal_itc", "accountitem"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
{hasDMSKey && (
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.dms_acctnumber")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "taxes", "federal_itc", "dms_acctnumber"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
)}
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenter_rate")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "taxes", "federal_itc", "rate"]}
|
|
>
|
|
<InputNumber precision={2} />
|
|
</Form.Item>
|
|
</LayoutFormRow>
|
|
)}
|
|
{InstanceRenderManager({
|
|
imex: null,
|
|
rome: <ShopInfoResponsibilitycentersTaxesComponent form={form} />
|
|
})}
|
|
{HasFeatureAccess({ featureName: "export", bodyshop }) && (
|
|
<>
|
|
{InstanceRenderManager({
|
|
rome: (
|
|
<LayoutFormRow header={t("bodyshop.labels.responsibilitycenters.quickbooks_us")} id="quickbooks_us">
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.itemexemptcode_short")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "taxes", "itemexemptcode"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.invoiceexemptcode_short")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "taxes", "invoiceexemptcode"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
</LayoutFormRow>
|
|
)
|
|
})}
|
|
<LayoutFormRow header={<div>AR</div>} id="AR">
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenter_accountname")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "ar", "accountname"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
</LayoutFormRow>
|
|
{DmsAp.treatment === "on" && (
|
|
<LayoutFormRow header={t("bodyshop.fields.responsibilitycenters.ap")} id="ap">
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenter_accountname")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "ap", "accountname"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenter_accountdesc")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "ap", "accountdesc"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.dms.dms_acctnumber")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "ap", "dms_acctnumber"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
</LayoutFormRow>
|
|
)}
|
|
<LayoutFormRow header={<div>Refund</div>} id="refund">
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenter_accountitem")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "refund", "accountitem"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
</LayoutFormRow>
|
|
{InstanceRenderManager({
|
|
rome: (
|
|
<LayoutFormRow header={<div>Adjustments</div>} id="refund">
|
|
{hasDMSKey ? (
|
|
<>
|
|
<Form.Item
|
|
label={t("bodyshop.labels.responsibilitycenters.ttl_adjustment")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "ttl_adjustment", "dms_acctnumber"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.labels.responsibilitycenters.ttl_tax_adjustment")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "ttl_tax_adjustment", "dms_acctnumber"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
</>
|
|
) : (
|
|
<>
|
|
<Form.Item
|
|
label={t("bodyshop.labels.responsibilitycenters.ttl_adjustment")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "ttl_adjustment", "accountitem"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.labels.responsibilitycenters.ttl_tax_adjustment")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "ttl_tax_adjustment", "accountitem"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
</>
|
|
)}
|
|
</LayoutFormRow>
|
|
)
|
|
})}
|
|
{Qb_Multi_Ar.treatment === "on" && (
|
|
<LayoutFormRow header={<div>Multiple Payers Item</div>} id="accountitem">
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenter_accountitem")}
|
|
rules={[{ required: true }]}
|
|
name={["md_responsibility_centers", "qb_multiple_payers", "accountitem"]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
</LayoutFormRow>
|
|
)}
|
|
<LayoutFormRow id="mappingname" header={t("bodyshop.labels.responsibilitycenters.sales_tax_codes")}>
|
|
<Form.List name={["md_responsibility_centers", "sales_tax_codes"]}>
|
|
{(fields, { add, remove }) => {
|
|
return (
|
|
<div>
|
|
{fields.map((field, index) => {
|
|
const salesTaxCode =
|
|
form.getFieldValue(["md_responsibility_centers", "sales_tax_codes", field.name]) || {};
|
|
|
|
return (
|
|
<Form.Item key={field.key}>
|
|
<LayoutFormRow
|
|
id="sales_tax_codes"
|
|
noDivider
|
|
title={getFormListItemTitle(
|
|
t("bodyshop.fields.responsibilitycenters.sales_tax_codes.description"),
|
|
index,
|
|
salesTaxCode.description,
|
|
salesTaxCode.code
|
|
)}
|
|
extra={
|
|
<Button
|
|
type="text"
|
|
icon={<DeleteFilled />}
|
|
onClick={() => {
|
|
remove(field.name);
|
|
}}
|
|
/>
|
|
}
|
|
>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.sales_tax_codes.description")}
|
|
key={`${index}description`}
|
|
name={[field.name, "description"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.sales_tax_codes.code")}
|
|
key={`${index}code`}
|
|
name={[field.name, "code"]}
|
|
rules={[{ required: true }]}
|
|
>
|
|
<Input />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.sales_tax_codes.federal")}
|
|
key={`${index}federal`}
|
|
name={[field.name, "federal"]}
|
|
valuePropName="checked"
|
|
>
|
|
<Switch />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.sales_tax_codes.state")}
|
|
key={`${index}state`}
|
|
name={[field.name, "state"]}
|
|
valuePropName="checked"
|
|
>
|
|
<Switch />
|
|
</Form.Item>
|
|
<Form.Item
|
|
label={t("bodyshop.fields.responsibilitycenters.sales_tax_codes.local")}
|
|
key={`${index}local`}
|
|
name={[field.name, "local"]}
|
|
valuePropName="checked"
|
|
>
|
|
<Switch />
|
|
</Form.Item>
|
|
</LayoutFormRow>
|
|
</Form.Item>
|
|
);
|
|
})}
|
|
<Form.Item>
|
|
<Button
|
|
type="dashed"
|
|
onClick={() => {
|
|
add();
|
|
}}
|
|
style={{ width: "100%" }}
|
|
>
|
|
{t("bodyshop.actions.newsalestaxcode")}
|
|
</Button>
|
|
</Form.Item>
|
|
</div>
|
|
);
|
|
}}
|
|
</Form.List>
|
|
</LayoutFormRow>
|
|
</>
|
|
)}
|
|
</RbacWrapper>
|
|
</div>
|
|
);
|
|
}
|