Added ins co to 3rd party payer & expanded md_ins_co IO-546
This commit is contained in:
@@ -3323,27 +3323,137 @@
|
|||||||
</concept_node>
|
</concept_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<concept_node>
|
<folder_node>
|
||||||
<name>md_ins_cos</name>
|
<name>md_ins_co</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<children>
|
||||||
<description></description>
|
<concept_node>
|
||||||
<comment></comment>
|
<name>city</name>
|
||||||
<default_text></default_text>
|
<definition_loaded>false</definition_loaded>
|
||||||
<translations>
|
<description></description>
|
||||||
<translation>
|
<comment></comment>
|
||||||
<language>en-US</language>
|
<default_text></default_text>
|
||||||
<approved>false</approved>
|
<translations>
|
||||||
</translation>
|
<translation>
|
||||||
<translation>
|
<language>en-US</language>
|
||||||
<language>es-MX</language>
|
<approved>false</approved>
|
||||||
<approved>false</approved>
|
</translation>
|
||||||
</translation>
|
<translation>
|
||||||
<translation>
|
<language>es-MX</language>
|
||||||
<language>fr-CA</language>
|
<approved>false</approved>
|
||||||
<approved>false</approved>
|
</translation>
|
||||||
</translation>
|
<translation>
|
||||||
</translations>
|
<language>fr-CA</language>
|
||||||
</concept_node>
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>name</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>state</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>street1</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>street2</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>zip</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
|
</children>
|
||||||
|
</folder_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>md_payment_types</name>
|
<name>md_payment_types</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
|
|||||||
@@ -1,14 +1,25 @@
|
|||||||
import { useQuery } from "@apollo/react-hooks";
|
import { useQuery } from "@apollo/react-hooks";
|
||||||
import { Button, Form, Input, InputNumber, Modal, Radio } from "antd";
|
import { Button, Form, Input, InputNumber, Modal, Radio, Select } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
import { SEARCH_VENDOR_AUTOCOMPLETE_WITH_ADDR } from "../../graphql/vendors.queries";
|
import { SEARCH_VENDOR_AUTOCOMPLETE_WITH_ADDR } from "../../graphql/vendors.queries";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
import VendorSearchSelect from "../vendor-search-select/vendor-search-select.component";
|
import VendorSearchSelect from "../vendor-search-select/vendor-search-select.component";
|
||||||
|
|
||||||
export default function Jobd3RdPartyModal({ jobId }) {
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(Jobd3RdPartyModal);
|
||||||
|
|
||||||
|
export function Jobd3RdPartyModal({ bodyshop, jobId }) {
|
||||||
const [isModalVisible, setIsModalVisible] = useState(false);
|
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
@@ -42,6 +53,18 @@ export default function Jobd3RdPartyModal({ jobId }) {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleInsSelect = (value, option) => {
|
||||||
|
form.setFieldsValue({
|
||||||
|
addr1: option.obj.name,
|
||||||
|
addr2: option.obj.street1,
|
||||||
|
addr3: option.obj.street2,
|
||||||
|
city: option.obj.city,
|
||||||
|
state: option.obj.state,
|
||||||
|
zip: option.obj.zip,
|
||||||
|
vendorid: null,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const handleVendorSelect = (vendorid, opt) => {
|
const handleVendorSelect = (vendorid, opt) => {
|
||||||
const vendor = VendorAutoCompleteData.vendors.filter(
|
const vendor = VendorAutoCompleteData.vendors.filter(
|
||||||
(v) => v.id === vendorid
|
(v) => v.id === vendorid
|
||||||
@@ -54,6 +77,7 @@ export default function Jobd3RdPartyModal({ jobId }) {
|
|||||||
city: vendor.city,
|
city: vendor.city,
|
||||||
state: vendor.state,
|
state: vendor.state,
|
||||||
zip: vendor.zip,
|
zip: vendor.zip,
|
||||||
|
ins_co_id: null,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -76,6 +100,18 @@ export default function Jobd3RdPartyModal({ jobId }) {
|
|||||||
onSelect={handleVendorSelect}
|
onSelect={handleVendorSelect}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.md_ins_co.name")}
|
||||||
|
name="ins_co_id"
|
||||||
|
>
|
||||||
|
<Select onSelect={handleInsSelect}>
|
||||||
|
{bodyshop.md_ins_cos.map((s) => (
|
||||||
|
<Select.Option key={s.name} obj={s} value={s.name}>
|
||||||
|
{s.name}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
<LayoutFormRow grow>
|
<LayoutFormRow grow>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("printcenter.jobs.3rdpartyfields.addr1")}
|
label={t("printcenter.jobs.3rdpartyfields.addr1")}
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO }) {
|
|||||||
>
|
>
|
||||||
<Select>
|
<Select>
|
||||||
{bodyshop.md_ins_cos.map((s) => (
|
{bodyshop.md_ins_cos.map((s) => (
|
||||||
<Select.Option key={s} value={s}>
|
<Select.Option key={s.name} value={s.name}>
|
||||||
{s}
|
{s.name}
|
||||||
</Select.Option>
|
</Select.Option>
|
||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
|
|||||||
@@ -569,6 +569,124 @@ export default function ShopInfoComponent({ form, saveLoading }) {
|
|||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Form.List>
|
</Form.List>
|
||||||
|
|
||||||
|
<Form.List name={["md_ins_cos"]}>
|
||||||
|
{(fields, { add, remove, move }) => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{fields.map((field, index) => (
|
||||||
|
<Form.Item
|
||||||
|
key={field.key}
|
||||||
|
style={{ padding: 0, margin: 2 }}
|
||||||
|
>
|
||||||
|
<div style={{ display: "flex" }}>
|
||||||
|
<Form.Item
|
||||||
|
style={{ padding: 0, margin: 2 }}
|
||||||
|
label={t("bodyshop.fields.md_ins_co.name")}
|
||||||
|
key={`${index}name`}
|
||||||
|
name={[field.name, "name"]}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
style={{ padding: 0, margin: 2 }}
|
||||||
|
label={t("bodyshop.fields.md_ins_co.street1")}
|
||||||
|
key={`${index}street1`}
|
||||||
|
name={[field.name, "street1"]}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
style={{ padding: 0, margin: 2 }}
|
||||||
|
label={t("bodyshop.fields.md_ins_co.street2")}
|
||||||
|
key={`${index}street2`}
|
||||||
|
name={[field.name, "street2"]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
style={{ padding: 0, margin: 2 }}
|
||||||
|
label={t("bodyshop.fields.md_ins_co.city")}
|
||||||
|
key={`${index}city`}
|
||||||
|
name={[field.name, "city"]}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
style={{ padding: 0, margin: 2 }}
|
||||||
|
label={t("bodyshop.fields.md_ins_co.state")}
|
||||||
|
key={`${index}state`}
|
||||||
|
name={[field.name, "state"]}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
style={{ padding: 0, margin: 2 }}
|
||||||
|
label={t("bodyshop.fields.md_ins_co.zip")}
|
||||||
|
key={`${index}zip`}
|
||||||
|
name={[field.name, "zip"]}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<DeleteFilled
|
||||||
|
onClick={() => {
|
||||||
|
remove(field.name);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<FormListMoveArrows
|
||||||
|
move={move}
|
||||||
|
index={index}
|
||||||
|
total={fields.length}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Form.Item>
|
||||||
|
))}
|
||||||
|
<Form.Item>
|
||||||
|
<Button
|
||||||
|
type="dashed"
|
||||||
|
onClick={() => {
|
||||||
|
add();
|
||||||
|
}}
|
||||||
|
style={{ width: "100%" }}
|
||||||
|
>
|
||||||
|
{t("general.actions.add")}
|
||||||
|
</Button>
|
||||||
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Form.List>
|
||||||
|
|
||||||
<LayoutFormRow>
|
<LayoutFormRow>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name={["md_payment_types"]}
|
name={["md_payment_types"]}
|
||||||
@@ -609,19 +727,7 @@ export default function ShopInfoComponent({ form, saveLoading }) {
|
|||||||
>
|
>
|
||||||
<Select mode="tags" />
|
<Select mode="tags" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
|
||||||
name={["md_ins_cos"]}
|
|
||||||
label={t("bodyshop.fields.md_ins_cos")}
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: t("general.validation.required"),
|
|
||||||
type: "array",
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Select mode="tags" />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name={["enforce_class"]}
|
name={["enforce_class"]}
|
||||||
label={t("bodyshop.fields.enforce_class")}
|
label={t("bodyshop.fields.enforce_class")}
|
||||||
|
|||||||
@@ -219,7 +219,14 @@
|
|||||||
"lab": "Body Hour Split",
|
"lab": "Body Hour Split",
|
||||||
"lar": "Refinish Hour Split"
|
"lar": "Refinish Hour Split"
|
||||||
},
|
},
|
||||||
"md_ins_cos": "Insurance Companies",
|
"md_ins_co": {
|
||||||
|
"city": "City",
|
||||||
|
"name": "Insurance Company Name",
|
||||||
|
"state": "State/Province",
|
||||||
|
"street1": "Street 1",
|
||||||
|
"street2": "Street 2",
|
||||||
|
"zip": "Zip/Postal Code"
|
||||||
|
},
|
||||||
"md_payment_types": "Payment Types",
|
"md_payment_types": "Payment Types",
|
||||||
"md_referral_sources": "Referral Sources",
|
"md_referral_sources": "Referral Sources",
|
||||||
"messaginglabel": "Messaging Preset Label",
|
"messaginglabel": "Messaging Preset Label",
|
||||||
|
|||||||
@@ -219,7 +219,14 @@
|
|||||||
"lab": "",
|
"lab": "",
|
||||||
"lar": ""
|
"lar": ""
|
||||||
},
|
},
|
||||||
"md_ins_cos": "",
|
"md_ins_co": {
|
||||||
|
"city": "",
|
||||||
|
"name": "",
|
||||||
|
"state": "",
|
||||||
|
"street1": "",
|
||||||
|
"street2": "",
|
||||||
|
"zip": ""
|
||||||
|
},
|
||||||
"md_payment_types": "",
|
"md_payment_types": "",
|
||||||
"md_referral_sources": "",
|
"md_referral_sources": "",
|
||||||
"messaginglabel": "",
|
"messaginglabel": "",
|
||||||
|
|||||||
@@ -219,7 +219,14 @@
|
|||||||
"lab": "",
|
"lab": "",
|
||||||
"lar": ""
|
"lar": ""
|
||||||
},
|
},
|
||||||
"md_ins_cos": "",
|
"md_ins_co": {
|
||||||
|
"city": "",
|
||||||
|
"name": "",
|
||||||
|
"state": "",
|
||||||
|
"street1": "",
|
||||||
|
"street2": "",
|
||||||
|
"zip": ""
|
||||||
|
},
|
||||||
"md_payment_types": "",
|
"md_payment_types": "",
|
||||||
"md_referral_sources": "",
|
"md_referral_sources": "",
|
||||||
"messaginglabel": "",
|
"messaginglabel": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user