IO-1424 Add other referral source

This commit is contained in:
Patrick Fic
2021-10-04 11:43:33 -07:00
parent 96f292f61c
commit 4995e44e06
14 changed files with 80 additions and 18 deletions

View File

@@ -22303,6 +22303,27 @@
</translation> </translation>
</translations> </translations>
</concept_node> </concept_node>
<concept_node>
<name>referral_source_other</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> <concept_node>
<name>referralsource</name> <name>referralsource</name>
<definition_loaded>false</definition_loaded> <definition_loaded>false</definition_loaded>

View File

@@ -2,6 +2,7 @@ import { useMutation } from "@apollo/client";
import { import {
Button, Button,
Form, Form,
Input,
notification, notification,
Popover, Popover,
Select, Select,
@@ -112,24 +113,32 @@ export function JobsConvertButton({
</Form.Item> </Form.Item>
)} )}
{bodyshop.enforce_referral && ( {bodyshop.enforce_referral && (
<Form.Item <>
name={"referral_source"} <Form.Item
label={t("jobs.fields.referralsource")} name={"referral_source"}
rules={[ label={t("jobs.fields.referralsource")}
{ rules={[
required: bodyshop.enforce_referral, {
//message: t("general.validation.required"), required: bodyshop.enforce_referral,
}, //message: t("general.validation.required"),
]} },
> ]}
<Select> >
{bodyshop.md_referral_sources.map((s) => ( <Select>
<Select.Option key={s} value={s}> {bodyshop.md_referral_sources.map((s) => (
{s} <Select.Option key={s} value={s}>
</Select.Option> {s}
))} </Select.Option>
</Select> ))}
</Form.Item> </Select>
</Form.Item>
<Form.Item
label={t("jobs.fields.referral_source_other")}
name="referral_source_other"
>
<Input />
</Form.Item>
</>
)} )}
<Form.Item <Form.Item
label={t("jobs.fields.ca_gst_registrant")} label={t("jobs.fields.ca_gst_registrant")}

View File

@@ -181,6 +181,12 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
))} ))}
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item
label={t("jobs.fields.referral_source_other")}
name="referral_source_other"
>
<Input />
</Form.Item>
</LayoutFormRow> </LayoutFormRow>
</Collapse.Panel> </Collapse.Panel>
<Collapse.Panel <Collapse.Panel

View File

@@ -114,6 +114,12 @@ export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) {
))} ))}
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item
label={t("jobs.fields.referral_source_other")}
name="referral_source_other"
>
<Input />
</Form.Item>
<Form.Item label={t("jobs.fields.alt_transport")} name="alt_transport"> <Form.Item label={t("jobs.fields.alt_transport")} name="alt_transport">
<Select disabled={jobRO} allowClear> <Select disabled={jobRO} allowClear>
{bodyshop.appt_alt_transport.map((s) => ( {bodyshop.appt_alt_transport.map((s) => (

View File

@@ -359,6 +359,7 @@ export const GET_JOB_BY_PK = gql`
kmin kmin
kmout kmout
referral_source referral_source
referral_source_other
unit_number unit_number
po_number po_number
special_coverage_policy special_coverage_policy
@@ -964,6 +965,7 @@ export const CONVERT_JOB_TO_RO = gql`
$driveable: Boolean $driveable: Boolean
$towin: Boolean $towin: Boolean
$referral_source: String $referral_source: String
$referral_source_other: String
) { ) {
update_jobs( update_jobs(
where: { id: { _eq: $jobId } } where: { id: { _eq: $jobId } }
@@ -975,6 +977,7 @@ export const CONVERT_JOB_TO_RO = gql`
towin: $towin towin: $towin
driveable: $driveable driveable: $driveable
referral_source: $referral_source referral_source: $referral_source
referral_source_other: $referral_source_other
} }
) { ) {
returning { returning {
@@ -984,6 +987,7 @@ export const CONVERT_JOB_TO_RO = gql`
class class
ins_co_nm ins_co_nm
referral_source referral_source
referral_source_other
} }
} }
} }
@@ -1497,6 +1501,7 @@ export const QUERY_ALL_JOB_FIELDS = gql`
rate_mash rate_mash
rate_matd rate_matd
referral_source referral_source
referral_source_other
regie_number regie_number
selling_dealer selling_dealer
selling_dealer_contact selling_dealer_contact

View File

@@ -1336,6 +1336,7 @@
"rate_mapa": "Paint Materials", "rate_mapa": "Paint Materials",
"rate_mash": "Shop Material", "rate_mash": "Shop Material",
"rate_matd": "Tire Disposal", "rate_matd": "Tire Disposal",
"referral_source_other": "Other Referral Source",
"referralsource": "Referral Source", "referralsource": "Referral Source",
"regie_number": "Registration #", "regie_number": "Registration #",
"repairtotal": "Repair Total", "repairtotal": "Repair Total",

View File

@@ -1336,6 +1336,7 @@
"rate_mapa": "Tasa de materiales de pintura", "rate_mapa": "Tasa de materiales de pintura",
"rate_mash": "Comprar material de tarifa", "rate_mash": "Comprar material de tarifa",
"rate_matd": "Tasa de eliminación de neumáticos", "rate_matd": "Tasa de eliminación de neumáticos",
"referral_source_other": "",
"referralsource": "Fuente de referencia", "referralsource": "Fuente de referencia",
"regie_number": "N. ° de registro", "regie_number": "N. ° de registro",
"repairtotal": "Reparación total", "repairtotal": "Reparación total",

View File

@@ -1336,6 +1336,7 @@
"rate_mapa": "Taux de matériaux de peinture", "rate_mapa": "Taux de matériaux de peinture",
"rate_mash": "Tarif du matériel de la boutique", "rate_mash": "Tarif du matériel de la boutique",
"rate_matd": "Taux d'élimination des pneus", "rate_matd": "Taux d'élimination des pneus",
"referral_source_other": "",
"referralsource": "Source de référence", "referralsource": "Source de référence",
"regie_number": "Enregistrement #", "regie_number": "Enregistrement #",
"repairtotal": "Réparation totale", "repairtotal": "Réparation totale",

View File

@@ -2716,6 +2716,7 @@
- rate_mash - rate_mash
- rate_matd - rate_matd
- referral_source - referral_source
- referral_source_other
- regie_number - regie_number
- ro_number - ro_number
- scheduled_completion - scheduled_completion
@@ -2963,6 +2964,7 @@
- rate_mash - rate_mash
- rate_matd - rate_matd
- referral_source - referral_source
- referral_source_other
- regie_number - regie_number
- ro_number - ro_number
- scheduled_completion - scheduled_completion
@@ -3220,6 +3222,7 @@
- rate_mash - rate_mash
- rate_matd - rate_matd
- referral_source - referral_source
- referral_source_other
- regie_number - regie_number
- ro_number - ro_number
- scheduled_completion - scheduled_completion

View File

@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."jobs" add column "referral_soure_other" text
-- null;

View File

@@ -0,0 +1,2 @@
alter table "public"."jobs" add column "referral_soure_other" text
null;

View File

@@ -0,0 +1 @@
alter table "public"."jobs" rename column "referral_source_other" to "referral_soure_other";

View File

@@ -0,0 +1 @@
alter table "public"."jobs" rename column "referral_soure_other" to "referral_source_other";

View File

@@ -555,6 +555,7 @@ exports.GET_JOB_BY_PK = ` query GET_JOB_BY_PK($id: uuid!) {
kmin kmin
kmout kmout
referral_source referral_source
referral_source_other
unit_number unit_number
po_number po_number
special_coverage_policy special_coverage_policy