IO-920 Required referral fields.

This commit is contained in:
Patrick Fic
2021-04-26 15:32:16 -07:00
parent e8db267a18
commit a408de0b90
16 changed files with 399 additions and 10 deletions

View File

@@ -94,6 +94,26 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO }) {
</Select>
</Form.Item>
)}
{bodyshop.enforce_referral && (
<Form.Item
name={"referral_source"}
label={t("jobs.fields.referralsource")}
rules={[
{
required: bodyshop.enforce_referral,
message: t("general.validation.required"),
},
]}
>
<Select>
{bodyshop.md_referral_sources.map((s) => (
<Select.Option key={s} value={s}>
{s}
</Select.Option>
))}
</Select>
</Form.Item>
)}
<Form.Item
label={t("jobs.fields.ca_gst_registrant")}
name="ca_gst_registrant"

View File

@@ -93,6 +93,12 @@ export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) {
<Form.Item
label={t("jobs.fields.referralsource")}
name="referral_source"
rules={[
{
required: job.converted && bodyshop.enforce_referral,
message: t("general.validation.required"),
},
]}
>
<Select disabled={jobRO} allowClear>
{bodyshop.md_referral_sources.map((s) => (

View File

@@ -354,6 +354,13 @@ export default function ShopInfoGeneral({ form }) {
>
<Select mode="tags" />
</Form.Item>
<Form.Item
name={["enforce_referral"]}
label={t("bodyshop.fields.enforce_referral")}
valuePropName="checked"
>
<Switch />
</Form.Item>
<Form.Item
name={["target_touchtime"]}
label={t("bodyshop.fields.target_touchtime")}

View File

@@ -82,7 +82,8 @@ export const QUERY_BODYSHOP = gql`
md_hour_split
sub_status
jobsizelimit
md_ccc_rates
md_ccc_rates
enforce_referral
employees {
id
active
@@ -164,7 +165,8 @@ export const UPDATE_SHOP = gql`
md_hour_split
sub_status
jobsizelimit
md_ccc_rates
md_ccc_rates
enforce_referral
employees {
id
first_name

View File

@@ -878,6 +878,7 @@ export const CONVERT_JOB_TO_RO = gql`
$ca_gst_registrant: Boolean
$driveable: Boolean
$towin: Boolean
$referral_source: String
) {
update_jobs(
where: { id: { _eq: $jobId } }
@@ -888,6 +889,7 @@ export const CONVERT_JOB_TO_RO = gql`
ca_gst_registrant: $ca_gst_registrant
towin: $towin
driveable: $driveable
referral_source: $referral_source
}
) {
returning {
@@ -896,6 +898,7 @@ export const CONVERT_JOB_TO_RO = gql`
converted
class
ins_co_nm
referral_source
}
}
}

View File

@@ -207,6 +207,7 @@
},
"email": "General Shop Email",
"enforce_class": "Enforce Class on Conversion?",
"enforce_referral": "Enforce Referrals",
"federal_tax_id": "Federal Tax ID (GST/HST)",
"inhousevendorid": "In House Vendor ID",
"insurance_vendor_id": "Insurance Vendor ID",

View File

@@ -207,6 +207,7 @@
},
"email": "",
"enforce_class": "",
"enforce_referral": "",
"federal_tax_id": "",
"inhousevendorid": "",
"insurance_vendor_id": "",

View File

@@ -207,6 +207,7 @@
},
"email": "",
"enforce_class": "",
"enforce_referral": "",
"federal_tax_id": "",
"inhousevendorid": "",
"insurance_vendor_id": "",