diff --git a/client/src/components/shop-info/shop-info.general.component.jsx b/client/src/components/shop-info/shop-info.general.component.jsx index f0ebb9826..b24c04a03 100644 --- a/client/src/components/shop-info/shop-info.general.component.jsx +++ b/client/src/components/shop-info/shop-info.general.component.jsx @@ -1,12 +1,9 @@ import { DeleteFilled } from "@ant-design/icons"; -import { useTreatmentsWithConfig } from "@splitsoftware/splitio-react"; -import { Button, DatePicker, Form, Input, InputNumber, Radio, Select, Space, Switch } from "antd"; +import { Button, Form, Input, InputNumber, Select, Space, Switch } from "antd"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; -import DatePickerRanges from "../../utils/DatePickerRanges"; -import InstanceRenderManager from "../../utils/instanceRenderMgr"; import FeatureWrapper, { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component"; import CurrencyInput from "../form-items-formatted/currency-form-item.component"; import FormItemEmail from "../form-items-formatted/email-form-item.component"; @@ -26,14 +23,6 @@ export default connect(mapStateToProps, mapDispatchToProps)(ShopInfoGeneral); export function ShopInfoGeneral({ form, bodyshop }) { const { t } = useTranslation(); - const { - treatments: { ClosingPeriod, ADPPayroll } - } = useTreatmentsWithConfig({ - attributes: {}, - names: ["ClosingPeriod", "ADPPayroll"], - splitKey: bodyshop?.imexshopid - }); - return (
@@ -143,299 +132,6 @@ export function ShopInfoGeneral({ form, bodyshop }) { - - {[ - ...(HasFeatureAccess({ featureName: "export", bodyshop }) - ? [ - - - , - InstanceRenderManager({ - imex: ( - - {() => ( - - - - )} - - ) - }), - - - , - - - 2 - 3 - - , - - {() => { - return ( - - - {t("bodyshop.labels.2tiername")} - {t("bodyshop.labels.2tiersource")} - - - ); - }} - , - - - , - - - - ] - : []), - - - , - - - , - InstanceRenderManager({ - imex: ( - - - - ) - }), - - - , - ...(HasFeatureAccess({ featureName: "bills", bodyshop }) - ? [ - InstanceRenderManager({ - imex: ( - - - - ) - }), - - - , - - - - ] - : []), - - - , - ...(HasFeatureAccess({ featureName: "export", bodyshop }) - ? [ - - {ReceivableCustomFieldSelect} - , - - {ReceivableCustomFieldSelect} - , - - {ReceivableCustomFieldSelect} - , - { - return { - required: getFieldValue("enforce_class"), - //message: t("general.validation.required"), - type: "array" - }; - } - ]} - > - - - ] - : []), - ...(ADPPayroll.treatment === "on" - ? [ - - - - ] - : []) - ] - : []), - - - - ]} - null}> {[ + + - VIN - Claim No. - Deductible Amount - -); diff --git a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx index 5841e2cd7..4551a2f9b 100644 --- a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx +++ b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx @@ -1,6 +1,6 @@ import { DeleteFilled } from "@ant-design/icons"; import { useTreatmentsWithConfig } from "@splitsoftware/splitio-react"; -import { Button, Form, Input, InputNumber, Select, Space, Switch } from "antd"; +import { Button, DatePicker, Form, Input, InputNumber, Radio, Select, Space, Switch } from "antd"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; @@ -15,6 +15,7 @@ import LayoutFormRow from "../layout-form-row/layout-form-row.component"; import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component"; import ShopInfoResponsibilitycentersTaxesComponent from "./shop-info.responsibilitycenters.taxes.component"; import { bodyshopHasDmsKey } from "../../utils/dmsUtils.js"; +import DatePickerRanges from "../../utils/DatePickerRanges"; const SelectorDiv = styled.div` .ant-form-item .ant-select { @@ -35,10 +36,10 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) { const hasDMSKey = bodyshopHasDmsKey(bodyshop); const { - treatments: { Qb_Multi_Ar, DmsAp } + treatments: { ClosingPeriod, ADPPayroll, Qb_Multi_Ar, DmsAp } } = useTreatmentsWithConfig({ attributes: {}, - names: ["Qb_Multi_Ar", "DmsAp"], + names: ["ClosingPeriod", "ADPPayroll", "Qb_Multi_Ar", "DmsAp"], splitKey: bodyshop?.imexshopid }); @@ -64,6 +65,14 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) { setProfitOptions(getCenterNames(["md_responsibility_centers", "profits"])); }; + const ReceivableCustomFieldSelect = ( + + ); + return (
@@ -287,6 +296,286 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) { )} + + {[ + ...(HasFeatureAccess({ featureName: "export", bodyshop }) + ? [ + + + , + InstanceRenderManager({ + imex: ( + + {() => ( + + + + )} + + ) + }), + + + , + + + 2 + 3 + + , + + {() => { + return ( + + + {t("bodyshop.labels.2tiername")} + {t("bodyshop.labels.2tiersource")} + + + ); + }} + , + + + , + + + + ] + : []), + + + , + + + , + InstanceRenderManager({ + imex: ( + + + + ) + }), + + + , + ...(HasFeatureAccess({ featureName: "bills", bodyshop }) + ? [ + InstanceRenderManager({ + imex: ( + + + + ) + }), + + + , + + + + ] + : []), + + + , + + + , + ...(ClosingPeriod.treatment === "on" + ? [ + + + + ] + : []), + ...(ADPPayroll.treatment === "on" + ? [ + + + + ] + : []), + ...(ADPPayroll.treatment === "on" + ? [ + + + + ] + : []) + ] + : []), + + + + ]} + {HasFeatureAccess({ featureName: "export", bodyshop }) && ( <>