import { DeleteFilled } from "@ant-design/icons";
import { Button, Form, Input, InputNumber, Select, Space, Switch, Typography } from "antd";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import styled from "styled-components";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
import DataLabel from "../data-label/data-label.component";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { useSplitTreatments } from "@splitsoftware/splitio-react";
import ShopInfoResponsibilitycentersTaxesComponent from "./shop-info.responsibilitycenters.taxes.component";
import InstanceRenderManager from "../../utils/instanceRenderMgr";
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";

const SelectorDiv = styled.div`
  .ant-form-item .ant-select {
    width: 125px;
  }
`;

const mapStateToProps = createStructuredSelector({
  //currentUser: selectCurrentUser
  bodyshop: selectBodyshop
});
const mapDispatchToProps = (dispatch) => ({
  //setUserLanguage: language => dispatch(setUserLanguage(language))
});
export default connect(mapStateToProps, mapDispatchToProps)(ShopInfoResponsibilityCenterComponent);

export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
  const { t } = useTranslation();

  const {
    treatments: { Qb_Multi_Ar, DmsAp }
  } = useSplitTreatments({
    attributes: {},
    names: ["Qb_Multi_Ar", "DmsAp"],
    splitKey: bodyshop && 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 handleBlur = () => {
    setCostOptions([...(form.getFieldValue(["md_responsibility_centers", "costs"]).map((i) => i && i.name) || [])]);
    setProfitOptions([...(form.getFieldValue(["md_responsibility_centers", "profits"]).map((i) => i && i.name) || [])]);
  };

  return (
    <div>
      {(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
        <>
          {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>
            <Form.Item
              label={t("bodyshop.fields.dms.default_journal")}
              rules={[
                {
                  required: true
                  //message: t("general.validation.required"),
                }
              ]}
              name={["cdk_configuration", "default_journal"]}
            >
              <Input />
            </Form.Item>
            <Form.Item
              label={t("bodyshop.fields.dms.srcco")}
              rules={[
                {
                  required: true
                  //message: t("general.validation.required"),
                }
              ]}
              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
                  //message: t("general.validation.required"),
                }
              ]}
              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.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>
          <LayoutFormRow header={t("bodyshop.labels.dms.cdk.payers")}>
            <Form.List name={["cdk_configuration", "payers"]}>
              {(fields, { add, remove, move }) => {
                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.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"]}
                            // rules={[
                            //   {
                            //     required: true,
                            //   },
                            // ]}
                          >
                            <Select allowClear showSearch>
                              <Select.Option value="ro_number">{t("jobs.fields.ro_number")}</Select.Option>
                              <Select.Option value="clm_no">{t("jobs.fields.clm_no")}</Select.Option>
                              <Select.Option value="po_number">{t("jobs.fields.ponumber")}</Select.Option>
                              <Select.Option value="account_number">
                                {t("jobs.fields.dms.control_type.account_number")}
                              </Select.Option>
                            </Select>
                          </Form.Item>

                          <Space align="center">
                            <DeleteFilled
                              onClick={() => {
                                remove(field.name);
                              }}
                            />
                            <FormListMoveArrows move={move} index={index} total={fields.length} />
                          </Space>
                        </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>
        </>
      )}

      {bodyshop.pbs_serialnumber && (
        <>
          <DataLabel label={t("bodyshop.labels.dms.pbs_serialnumber")}>
            {form.getFieldValue("pbs_serialnumber")}
          </DataLabel>
        </>
      )}
      <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) => (
                  <Form.Item key={field.key}>
                    <LayoutFormRow noDivider>
                      <Form.Item
                        label={t("bodyshop.fields.responsibilitycenter")}
                        key={`${index}name`}
                        name={[field.name, "name"]}
                        rules={[
                          {
                            required: true
                            //message: t("general.validation.required"),
                          }
                        ]}
                      >
                        <Input onBlur={handleBlur} />
                      </Form.Item>
                      <Form.Item
                        label={t("bodyshop.fields.responsibilitycenter_accountname")}
                        key={`${index}accountname`}
                        name={[field.name, "accountname"]}
                        rules={[
                          {
                            required: true
                            //message: t("general.validation.required"),
                          }
                        ]}
                      >
                        <Input onBlur={handleBlur} />
                      </Form.Item>
                      {/* <Form.Item
                        label={t(
                          "bodyshop.fields.responsibilitycenter_accountnumber"
                        )}
                        key={`${index}accountnumber`}
                        name={[field.name, "accountnumber"]}
                        rules={[
                          {
                            required: true,
                            //message: t("general.validation.required"),
                          },
                        ]}
                      >
                        <Input onBlur={handleBlur} />
                      </Form.Item> */}
                      <Form.Item
                        label={t("bodyshop.fields.responsibilitycenter_accountdesc")}
                        key={`${index}accountdesc`}
                        name={[field.name, "accountdesc"]}
                        rules={[
                          {
                            required: true
                            //message: t("general.validation.required"),
                          }
                        ]}
                      >
                        <Input onBlur={handleBlur} />
                      </Form.Item>
                      {/* <Form.Item
                        label={t(
                          "bodyshop.fields.responsibilitycenter_accountitem"
                        )}
                        key={`${index}accountitem`}
                        name={[field.name, "accountitem"]}
                        rules={[
                          {
                            required: true,
                            //message: t("general.validation.required"),
                          },
                        ]}
                      >
                        <Input onBlur={handleBlur} />
                      </Form.Item> */}

                      {(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
                        <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 || bodyshop.pbs_serialnumber) && (
                        <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>
                      )}
                      <Space align="center">
                        <DeleteFilled
                          onClick={() => {
                            remove(field.name);
                          }}
                        />
                        <FormListMoveArrows move={move} index={index} total={fields.length} />
                      </Space>
                    </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) => (
                  <Form.Item key={field.key}>
                    <LayoutFormRow noDivider>
                      <Form.Item
                        label={t("bodyshop.fields.responsibilitycenter")}
                        key={`${index}name`}
                        name={[field.name, "name"]}
                        rules={[
                          {
                            required: true
                            //message: t("general.validation.required"),
                          }
                        ]}
                      >
                        <Input onBlur={handleBlur} />
                      </Form.Item>
                      {/* <Form.Item
                        label={t(
                          "bodyshop.fields.responsibilitycenter_accountname"
                        )}
                        key={`${index}accountname`}
                        name={[field.name, "accountname"]}
                        rules={[
                          {
                            required: true,
                            //message: t("general.validation.required"),
                          },
                        ]}
                      >
                        <Input onBlur={handleBlur} />
                      </Form.Item>
                      <Form.Item
                        label={t(
                          "bodyshop.fields.responsibilitycenter_accountnumber"
                        )}
                        key={`${index}accountnumber`}
                        name={[field.name, "accountnumber"]}
                        rules={[
                          {
                            required: true,
                            //message: t("general.validation.required"),
                          },
                        ]}
                      >
                        <Input onBlur={handleBlur} />
                      </Form.Item> */}
                      <Form.Item
                        label={t("bodyshop.fields.responsibilitycenter_accountdesc")}
                        key={`${index}accountdesc`}
                        name={[field.name, "accountdesc"]}
                        rules={[
                          {
                            required: true
                            //message: t("general.validation.required"),
                          }
                        ]}
                      >
                        <Input onBlur={handleBlur} />
                      </Form.Item>
                      <Form.Item
                        label={t("bodyshop.fields.responsibilitycenter_accountitem")}
                        key={`${index}accountitem`}
                        name={[field.name, "accountitem"]}
                        rules={[
                          {
                            required: true
                            //message: t("general.validation.required"),
                          }
                        ]}
                      >
                        <Input onBlur={handleBlur} />
                      </Form.Item>
                      {(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
                        <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>
                      )}
                      <Space align="center">
                        <DeleteFilled
                          onClick={() => {
                            remove(field.name);
                          }}
                        />
                        <FormListMoveArrows move={move} index={index} total={fields.length} />
                      </Space>
                    </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>
        {(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
          <>
            <Form.List name={["md_responsibility_centers", "dms_defaults"]}>
              {(fields, { add, remove, move }) => {
                return (
                  <div>
                    {fields.map((field, index) => (
                      <Form.Item key={field.key}>
                        <div>
                          <LayoutFormRow id="mappingname">
                            <Form.Item
                              label={t("bodyshop.fields.dms.mappingname")}
                              key={`${index}name`}
                              name={[field.name, "name"]}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                }
                              ]}
                            >
                              <Input />
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.gst_override")}
                              name={[field.name, "gst_override"]}
                            >
                              <Input />
                            </Form.Item>
                            <DeleteFilled
                              onClick={() => {
                                remove(field.name);
                              }}
                            />
                          </LayoutFormRow>
                          <LayoutFormRow header={t("bodyshop.labels.defaultcostsmapping")} id="defaultcostsmapping">
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.ats")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.laa")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.lab")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.lad")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.lae")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.laf")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.lag")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.lam")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.lar")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.las")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.lau")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.la1")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.la2")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.la3")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.la4")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.paa")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pac")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pag")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pal")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pam")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pan")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pao")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pap")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.par")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pas")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pasl")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.tow")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.mapa")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.mash")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {costOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                          </LayoutFormRow>
                          <LayoutFormRow header={t("bodyshop.labels.defaultprofitsmapping")}>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.ats")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.laa")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.lab")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.lad")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.lae")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.laf")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.lag")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.lam")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.lar")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.las")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.lau")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.la1")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.la2")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.la3")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.la4")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.paa")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pac")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pag")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pal")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pam")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pan")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pao")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pap")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.par")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pas")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.pasl")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.tow")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.mapa")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                            <Form.Item
                              label={t("bodyshop.fields.responsibilitycenters.mash")}
                              rules={[
                                {
                                  required: true
                                  //message: t("general.validation.required"),
                                },
                                ({ getFieldValue }) => ({
                                  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>
                                {profitOptions.map((item, idx) => (
                                  <Select.Option key={idx} value={item}>
                                    {item}
                                  </Select.Option>
                                ))}
                              </Select>
                            </Form.Item>
                          </LayoutFormRow>
                        </div>
                      </Form.Item>
                    ))}
                    <Form.Item>
                      <Button
                        type="dashed"
                        onClick={() => {
                          add();
                        }}
                        style={{ width: "100%" }}
                      >
                        {t("general.actions.add")}
                      </Button>
                    </Form.Item>
                  </div>
                );
              }}
            </Form.List>
          </>
        )}

        <LayoutFormRow header={t("bodyshop.labels.defaultcostsmapping")}>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.ats")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.laa")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.lab")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.lad")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.lae")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.laf")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.lag")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.lam")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.lar")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.las")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.lau")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.la1")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.la2")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.la3")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.la4")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.paa")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pac")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pag")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pal")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pam")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pan")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pao")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pap")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.par")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pas")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pasl")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.tow")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.mapa")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.mash")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {costOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
        </LayoutFormRow>
        <LayoutFormRow header={t("bodyshop.labels.defaultprofitsmapping")}>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.ats")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.laa")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.lab")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.lad")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.lae")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.laf")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.lag")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.lam")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.lar")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.las")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.lau")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.la1")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.la2")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.la3")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.la4")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.paa")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pac")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pag")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pal")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pam")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pan")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pao")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pap")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.par")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pas")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.pasl")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.tow")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.mapa")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.mash")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              },
              ({ getFieldValue }) => ({
                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>
              {profitOptions.map((item, idx) => (
                <Select.Option key={idx} value={item}>
                  {item}
                </Select.Option>
              ))}
            </Select>
          </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
              //message: t("general.validation.required"),
            }
          ]}
          name={["md_responsibility_centers", "taxes", "federal", "name"]}
        >
          <Input />
        </Form.Item>
        {/* <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_accountnumber")}
          rules={[
            {
              required: true,
              //message: t("general.validation.required"),
            },
          ]}
          name={[
            "md_responsibility_centers",
            "taxes",
            "federal",
            "accountnumber",
          ]}
        >
          <Input />
        </Form.Item> */}
        {/* <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_accountname")}
          rules={[
            {
              required: true,
              //message: t("general.validation.required"),
            },
          ]}
          name={[
            "md_responsibility_centers",
            "taxes",
            "federal",
            "accountname",
          ]}
        >
          <Input />
        </Form.Item> */}
        <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_accountdesc")}
          rules={[
            {
              required: true
              //message: t("general.validation.required"),
            }
          ]}
          name={["md_responsibility_centers", "taxes", "federal", "accountdesc"]}
        >
          <Input />
        </Form.Item>
        <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_accountitem")}
          rules={[
            {
              required: true
              //message: t("general.validation.required"),
            }
          ]}
          name={["md_responsibility_centers", "taxes", "federal", "accountitem"]}
        >
          <Input />
        </Form.Item>
        {(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
          <Form.Item
            label={t("bodyshop.fields.dms.dms_acctnumber")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              }
            ]}
            name={["md_responsibility_centers", "taxes", "federal", "dms_acctnumber"]}
          >
            <Input />
          </Form.Item>
        )}
        <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_rate")}
          rules={[
            {
              required: true
              //message: t("general.validation.required"),
            }
          ]}
          name={["md_responsibility_centers", "taxes", "federal", "rate"]}
        >
          <InputNumber precision={2} />
        </Form.Item>
      </LayoutFormRow>
      {DmsAp.treatment === "on" && (
        <LayoutFormRow id="federal_tax_itc">
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.federal_tax_itc")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              }
            ]}
            name={["md_responsibility_centers", "taxes", "federal_itc", "name"]}
          >
            <Input />
          </Form.Item>
          {/* <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_accountnumber")}
          rules={[
            {
              required: true,
              //message: t("general.validation.required"),
            },
          ]}
          name={[
            "md_responsibility_centers",
            "taxes",
            "federal_itc",
            "accountnumber",
          ]}
        >
          <Input />
        </Form.Item> */}
          {/* <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_accountname")}
          rules={[
            {
              required: true,
              //message: t("general.validation.required"),
            },
          ]}
          name={[
            "md_responsibility_centers",
            "taxes",
            "federal_itc",
            "accountname",
          ]}
        >
          <Input />
        </Form.Item> */}
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenter_accountdesc")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              }
            ]}
            name={["md_responsibility_centers", "taxes", "federal_itc", "accountdesc"]}
          >
            <Input />
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenter_accountitem")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              }
            ]}
            name={["md_responsibility_centers", "taxes", "federal_itc", "accountitem"]}
          >
            <Input />
          </Form.Item>
          {(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
            <Form.Item
              label={t("bodyshop.fields.dms.dms_acctnumber")}
              rules={[
                {
                  required: true
                  //message: t("general.validation.required"),
                }
              ]}
              name={["md_responsibility_centers", "taxes", "federal_itc", "dms_acctnumber"]}
            >
              <Input />
            </Form.Item>
          )}
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenter_rate")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              }
            ]}
            name={["md_responsibility_centers", "taxes", "federal_itc", "rate"]}
          >
            <InputNumber precision={2} />
          </Form.Item>
        </LayoutFormRow>
      )}

      {InstanceRenderManager({
        imex: (
          <LayoutFormRow id="state_tax">
            <Form.Item
              label={t("bodyshop.fields.responsibilitycenters.state_tax")}
              rules={[
                {
                  required: true
                  //message: t("general.validation.required"),
                }
              ]}
              name={["md_responsibility_centers", "taxes", "state", "name"]}
            >
              <Input />
            </Form.Item>
            {/* <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_accountnumber")}
          rules={[
            {
              required: true,
              //message: t("general.validation.required"),
            },
          ]}
          name={[
            "md_responsibility_centers",
            "taxes",
            "state",
            "accountnumber",
          ]}
        >
          <Input />
        </Form.Item>
        <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_accountname")}
          rules={[
            {
              required: true,
              //message: t("general.validation.required"),
            },
          ]}
          name={["md_responsibility_centers", "taxes", "state", "accountname"]}
        >
          <Input />
        </Form.Item> */}
            <Form.Item
              label={t("bodyshop.fields.responsibilitycenter_accountdesc")}
              rules={[
                {
                  required: true
                  //message: t("general.validation.required"),
                }
              ]}
              name={["md_responsibility_centers", "taxes", "state", "accountdesc"]}
            >
              <Input />
            </Form.Item>
            <Form.Item
              label={t("bodyshop.fields.responsibilitycenter_accountitem")}
              rules={[
                {
                  required: true
                  //message: t("general.validation.required"),
                }
              ]}
              name={["md_responsibility_centers", "taxes", "state", "accountitem"]}
            >
              <Input />
            </Form.Item>
            {(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
              <Form.Item
                label={t("bodyshop.fields.dms.dms_acctnumber")}
                rules={[
                  {
                    required: true
                    //message: t("general.validation.required"),
                  }
                ]}
                name={["md_responsibility_centers", "taxes", "state", "dms_acctnumber"]}
              >
                <Input />
              </Form.Item>
            )}
            <Form.Item
              label={t("bodyshop.fields.responsibilitycenter_rate")}
              rules={[
                {
                  required: true
                  //message: t("general.validation.required"),
                }
              ]}
              name={["md_responsibility_centers", "taxes", "state", "rate"]}
            >
              <InputNumber precision={2} />
            </Form.Item>
          </LayoutFormRow>
        ),
        rome: <ShopInfoResponsibilitycentersTaxesComponent form={form} />
      })}

      {InstanceRenderManager({
        rome: (
          <>
            <Form.Item
              label={t("bodyshop.fields.responsibilitycenters.itemexemptcode")}
              rules={[
                {
                  required: true
                  //message: t("general.validation.required"),
                }
              ]}
              name={["md_responsibility_centers", "taxes", "itemexemptcode"]}
            >
              <Input />
            </Form.Item>
            <Form.Item
              label={t("bodyshop.fields.responsibilitycenters.invoiceexemptcode")}
              rules={[
                {
                  required: true
                  //message: t("general.validation.required"),
                }
              ]}
              name={["md_responsibility_centers", "taxes", "invoiceexemptcode"]}
            >
              <Input />
            </Form.Item>
          </>
        ),
        promanager: "USE_ROME"
      })}

      {/*<LayoutFormRow id="local_tax">*/}
      {/*  <Form.Item*/}
      {/*    label={t("bodyshop.fields.responsibilitycenters.local_tax")}*/}
      {/*    rules={[*/}
      {/*      {*/}
      {/*        required: true,*/}
      {/*        //message: t("general.validation.required"),*/}
      {/*      },*/}
      {/*    ]}*/}
      {/*    name={["md_responsibility_centers", "taxes", "local", "name"]}*/}
      {/*  >*/}
      {/*    <Input />*/}
      {/*  </Form.Item>*/}
      {/*  /!* <Form.Item*/}
      {/*    label={t("bodyshop.fields.responsibilitycenter_accountnumber")}*/}
      {/*    rules={[*/}
      {/*      {*/}
      {/*        required: true,*/}
      {/*        //message: t("general.validation.required"),*/}
      {/*      },*/}
      {/*    ]}*/}
      {/*    name={[*/}
      {/*      "md_responsibility_centers",*/}
      {/*      "taxes",*/}
      {/*      "local",*/}
      {/*      "accountnumber",*/}
      {/*    ]}*/}
      {/*  >*/}
      {/*    <Input />*/}
      {/*  </Form.Item>*/}
      {/*  <Form.Item*/}
      {/*    label={t("bodyshop.fields.responsibilitycenter_accountname")}*/}
      {/*    rules={[*/}
      {/*      {*/}
      {/*        required: true,*/}
      {/*        //message: t("general.validation.required"),*/}
      {/*      },*/}
      {/*    ]}*/}
      {/*    name={["md_responsibility_centers", "taxes", "local", "accountname"]}*/}
      {/*  >*/}
      {/*    <Input />*/}
      {/*  </Form.Item> *!/*/}
      {/*  <Form.Item*/}
      {/*    label={t("bodyshop.fields.responsibilitycenter_accountdesc")}*/}
      {/*    rules={[*/}
      {/*      {*/}
      {/*        required: true,*/}
      {/*        //message: t("general.validation.required"),*/}
      {/*      },*/}
      {/*    ]}*/}
      {/*    name={["md_responsibility_centers", "taxes", "local", "accountdesc"]}*/}
      {/*  >*/}
      {/*    <Input />*/}
      {/*  </Form.Item>*/}
      {/*  <Form.Item*/}
      {/*    label={t("bodyshop.fields.responsibilitycenter_accountitem")}*/}
      {/*    rules={[*/}
      {/*      {*/}
      {/*        required: true,*/}
      {/*        //message: t("general.validation.required"),*/}
      {/*      },*/}
      {/*    ]}*/}
      {/*    name={["md_responsibility_centers", "taxes", "local", "accountitem"]}*/}
      {/*  >*/}
      {/*    <Input />*/}
      {/*  </Form.Item>*/}
      {/*  {(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (*/}
      {/*    <Form.Item*/}
      {/*      label={t("bodyshop.fields.dms.dms_acctnumber")}*/}
      {/*      rules={[*/}
      {/*        {*/}
      {/*          required: true,*/}
      {/*          //message: t("general.validation.required"),*/}
      {/*        },*/}
      {/*      ]}*/}
      {/*      name={[*/}
      {/*        "md_responsibility_centers",*/}
      {/*        "taxes",*/}
      {/*        "local",*/}
      {/*        "dms_acctnumber",*/}
      {/*      ]}*/}
      {/*    >*/}
      {/*      <Input />*/}
      {/*    </Form.Item>*/}
      {/*  )}*/}
      {/*  <Form.Item*/}
      {/*    label={t("bodyshop.fields.responsibilitycenter_rate")}*/}
      {/*    rules={[*/}
      {/*      {*/}
      {/*        required: true,*/}
      {/*        //message: t("general.validation.required"),*/}
      {/*      },*/}
      {/*    ]}*/}
      {/*    name={["md_responsibility_centers", "taxes", "local", "rate"]}*/}
      {/*  >*/}
      {/*    <InputNumber precision={2} />*/}
      {/*  </Form.Item>*/}
      {/*</LayoutFormRow>*/}
      <LayoutFormRow header={<div>AR</div>} id="AR">
        {/* <Form.Item
          label={t("bodyshop.fields.responsibilitycenters.ar")}
          rules={[
            {
              required: true,
              //message: t("general.validation.required"),
            },
          ]}
          name={["md_responsibility_centers", "ar", "name"]}
        >
          <Input />
        </Form.Item>
        <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_accountnumber")}
          rules={[
            {
              required: true,
              //message: t("general.validation.required"),
            },
          ]}
          name={["md_responsibility_centers", "ar", "accountnumber"]}
        >
          <Input />
        </Form.Item> */}
        <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_accountname")}
          rules={[
            {
              required: true
              //message: t("general.validation.required"),
            }
          ]}
          name={["md_responsibility_centers", "ar", "accountname"]}
        >
          <Input />
        </Form.Item>
        {/* <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_accountdesc")}
          rules={[
            {
              required: true,
              //message: t("general.validation.required"),
            },
          ]}
          name={["md_responsibility_centers", "ar", "accountdesc"]}
        >
          <Input />
        </Form.Item>
        <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_accountitem")}
          rules={[
            {
              required: true,
              //message: t("general.validation.required"),
            },
          ]}
          name={["md_responsibility_centers", "ar", "accountitem"]}
        >
          <Input />
        </Form.Item> */}
      </LayoutFormRow>

      {DmsAp.treatment === "on" && (
        <LayoutFormRow header={t("bodyshop.fields.responsibilitycenters.ap")} id="ap">
          {/* <Form.Item
            label={t("bodyshop.fields.responsibilitycenters.ap")}
            rules={[
              {
                required: true,
                //message: t("general.validation.required"),
              },
            ]}
            name={["md_responsibility_centers", "ap", "name"]}
          >
            <Input />
          </Form.Item> */}
          {/* <Form.Item
            label={t("bodyshop.fields.responsibilitycenter_accountnumber")}
            rules={[
              {
                required: true,
                //message: t("general.validation.required"),
              },
            ]}
            name={["md_responsibility_centers", "ap", "accountnumber"]}
          >
            <Input />
          </Form.Item> */}
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenter_accountname")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              }
            ]}
            name={["md_responsibility_centers", "ap", "accountname"]}
          >
            <Input />
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.responsibilitycenter_accountdesc")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              }
            ]}
            name={["md_responsibility_centers", "ap", "accountdesc"]}
          >
            <Input />
          </Form.Item>
          <Form.Item
            label={t("bodyshop.fields.dms.dms_acctnumber")}
            rules={[
              {
                required: true
                //message: t("general.validation.required"),
              }
            ]}
            name={["md_responsibility_centers", "ap", "dms_acctnumber"]}
          >
            <Input />
          </Form.Item>
        </LayoutFormRow>
      )}
      <LayoutFormRow header={<div>Refund</div>} id="refund">
        {/* <Form.Item
          label={t("bodyshop.fields.responsibilitycenters.refund")}
          rules={[
            {
              required: true,
              //message: t("general.validation.required"),
            },
          ]}
          name={["md_responsibility_centers", "refund", "name"]}
        >
          <Input />
        </Form.Item> */}
        {/* <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_accountnumber")}
          rules={[
            {
              required: true,
              //message: t("general.validation.required"),
            },
          ]}
          name={["md_responsibility_centers", "refund", "accountnumber"]}
        >
          <Input />
        </Form.Item> */}
        {/* <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_accountname")}
          rules={[
            {
              required: true,
              //message: t("general.validation.required"),
            },
          ]}
          name={["md_responsibility_centers", "refund", "accountname"]}
        >
          <Input />
        </Form.Item>
        <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_accountdesc")}
          rules={[
            {
              required: true,
              //message: t("general.validation.required"),
            },
          ]}
          name={["md_responsibility_centers", "refund", "accountdesc"]}
        >
          <Input />
        </Form.Item> */}
        <Form.Item
          label={t("bodyshop.fields.responsibilitycenter_accountitem")}
          rules={[
            {
              required: true
              //message: t("general.validation.required"),
            }
          ]}
          name={["md_responsibility_centers", "refund", "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
                //message: t("general.validation.required"),
              }
            ]}
            name={["md_responsibility_centers", "qb_multiple_payers", "accountitem"]}
          >
            <Input />
          </Form.Item>
        </LayoutFormRow>
      )}
      <Typography.Title level={4}>{t("bodyshop.labels.responsibilitycenters.sales_tax_codes")}</Typography.Title>
      <Form.List name={["md_responsibility_centers", "sales_tax_codes"]}>
        {(fields, { add, remove }) => {
          return (
            <div>
              {fields.map((field, index) => (
                <Form.Item key={field.key}>
                  <LayoutFormRow id="sales_tax_codes">
                    <Form.Item
                      label={t("bodyshop.fields.responsibilitycenters.sales_tax_codes.description")}
                      key={`${index}description`}
                      name={[field.name, "description"]}
                      rules={[
                        {
                          required: true
                          //message: t("general.validation.required"),
                        }
                      ]}
                    >
                      <Input />
                    </Form.Item>
                    <Form.Item
                      label={t("bodyshop.fields.responsibilitycenters.sales_tax_codes.code")}
                      key={`${index}code`}
                      name={[field.name, "code"]}
                      rules={[
                        {
                          required: true
                          //message: t("general.validation.required"),
                        }
                      ]}
                    >
                      <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>
                    <DeleteFilled
                      onClick={() => {
                        remove(field.name);
                      }}
                    />
                  </LayoutFormRow>
                </Form.Item>
              ))}
              <Form.Item>
                <Button
                  type="dashed"
                  onClick={() => {
                    add();
                  }}
                  style={{ width: "100%" }}
                >
                  {t("bodyshop.actions.newsalestaxcode")}
                </Button>
              </Form.Item>
            </div>
          );
        }}
      </Form.List>
    </div>
  );
}
