diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel
index f5995934e..50131a0f4 100644
--- a/bodyshop_translations.babel
+++ b/bodyshop_translations.babel
@@ -22303,6 +22303,27 @@
+
+ referral_source_other
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
referralsource
false
@@ -30375,6 +30396,27 @@
+
+ comments
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
cost
false
diff --git a/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx b/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx
index 2c42c7b58..b2c2b42e1 100644
--- a/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx
+++ b/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx
@@ -2,6 +2,7 @@ import { useMutation } from "@apollo/client";
import {
Button,
Form,
+ Input,
notification,
Popover,
Select,
@@ -112,24 +113,32 @@ export function JobsConvertButton({
)}
{bodyshop.enforce_referral && (
-
-
-
+ <>
+
+
+
+
+
+
+ >
)}
+
+
+
+
+
+
-
+
-
+
-
+
-
+
@@ -135,72 +136,72 @@ export function JobsDetailRates({ jobRO, form, job, bodyshop }) {
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
{
//
- //
+ //
//
//
- //
+ //
//
}
-
+
diff --git a/client/src/components/parts-order-list-table/parts-order-list-table.component.jsx b/client/src/components/parts-order-list-table/parts-order-list-table.component.jsx
index e47221051..c9ce0c9a9 100644
--- a/client/src/components/parts-order-list-table/parts-order-list-table.component.jsx
+++ b/client/src/components/parts-order-list-table/parts-order-list-table.component.jsx
@@ -27,6 +27,7 @@ import CurrencyFormatter from "../../utils/CurrencyFormatter";
import { DateFormatter } from "../../utils/DateFormatter";
import { alphaSort } from "../../utils/sorters";
import { TemplateList } from "../../utils/TemplateConstants";
+import DataLabel from "../data-label/data-label.component";
import PartsOrderBackorderEta from "../parts-order-backorder-eta/parts-order-backorder-eta.component";
import PartsOrderLineBackorderButton from "../parts-order-line-backorder-button/parts-order-line-backorder-button.component";
import PartsReceiveModalContainer from "../parts-receive-modal/parts-receive-modal.container";
@@ -379,6 +380,9 @@ export function PartsOrderListTableComponent({
rowKey="id"
dataSource={record.parts_order_lines}
/>
+
+ {record.comments}
+
);
};
diff --git a/client/src/components/parts-order-modal/parts-order-modal.component.jsx b/client/src/components/parts-order-modal/parts-order-modal.component.jsx
index 5318220f2..4da7ade50 100644
--- a/client/src/components/parts-order-modal/parts-order-modal.component.jsx
+++ b/client/src/components/parts-order-modal/parts-order-modal.component.jsx
@@ -152,6 +152,9 @@ export default function PartsOrderModalComponent({
);
}}
+
+
+
setSendType(e.target.value)}
diff --git a/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx b/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx
index 74d2fff28..bf0bb45ce 100644
--- a/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx
+++ b/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx
@@ -124,7 +124,7 @@ export function ScheduleJobModalComponent({
handleDateBlur();
}}
>
- {d}
+ {d}
))}
diff --git a/client/src/graphql/bills.queries.js b/client/src/graphql/bills.queries.js
index aa6948d6a..cb9aa755d 100644
--- a/client/src/graphql/bills.queries.js
+++ b/client/src/graphql/bills.queries.js
@@ -93,6 +93,7 @@ export const QUERY_BILLS_BY_JOBID = gql`
backordered_on
}
order_number
+ comments
user_email
}
bills(where: { jobid: { _eq: $jobid } }, order_by: { date: desc }) {
diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js
index 0640e101f..828fd848e 100644
--- a/client/src/graphql/jobs.queries.js
+++ b/client/src/graphql/jobs.queries.js
@@ -359,6 +359,7 @@ export const GET_JOB_BY_PK = gql`
kmin
kmout
referral_source
+ referral_source_other
unit_number
po_number
special_coverage_policy
@@ -563,6 +564,7 @@ export const GET_JOB_BY_PK = gql`
parts_order {
id
order_number
+ comments
order_date
user_email
vendor {
@@ -964,6 +966,7 @@ export const CONVERT_JOB_TO_RO = gql`
$driveable: Boolean
$towin: Boolean
$referral_source: String
+ $referral_source_other: String
) {
update_jobs(
where: { id: { _eq: $jobId } }
@@ -975,6 +978,7 @@ export const CONVERT_JOB_TO_RO = gql`
towin: $towin
driveable: $driveable
referral_source: $referral_source
+ referral_source_other: $referral_source_other
}
) {
returning {
@@ -984,6 +988,7 @@ export const CONVERT_JOB_TO_RO = gql`
class
ins_co_nm
referral_source
+ referral_source_other
}
}
}
@@ -1497,6 +1502,7 @@ export const QUERY_ALL_JOB_FIELDS = gql`
rate_mash
rate_matd
referral_source
+ referral_source_other
regie_number
selling_dealer
selling_dealer_contact
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index 077e82c85..e85376b2e 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -1336,6 +1336,7 @@
"rate_mapa": "Paint Materials",
"rate_mash": "Shop Material",
"rate_matd": "Tire Disposal",
+ "referral_source_other": "Other Referral Source",
"referralsource": "Referral Source",
"regie_number": "Registration #",
"repairtotal": "Repair Total",
@@ -1812,6 +1813,7 @@
"act_price": "Price",
"backordered_eta": "B.O. ETA",
"backordered_on": "B.O. On",
+ "comments": "Comments",
"cost": "Cost",
"db_price": "List Price",
"deliver_by": "Date",
@@ -2022,7 +2024,7 @@
},
"subjects": {
"jobs": {
- "parts_order": "$t(printcenter.jobs.parts_order) PO: {{ro_number}}"
+ "parts_order": "Parts Order PO: {{ro_number}}"
}
},
"vendors": {
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index eddd2aca4..766b50960 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -1336,6 +1336,7 @@
"rate_mapa": "Tasa de materiales de pintura",
"rate_mash": "Comprar material de tarifa",
"rate_matd": "Tasa de eliminación de neumáticos",
+ "referral_source_other": "",
"referralsource": "Fuente de referencia",
"regie_number": "N. ° de registro",
"repairtotal": "Reparación total",
@@ -1812,6 +1813,7 @@
"act_price": "",
"backordered_eta": "",
"backordered_on": "",
+ "comments": "",
"cost": "",
"db_price": "",
"deliver_by": "",
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index c7825635d..ad1276a61 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -1336,6 +1336,7 @@
"rate_mapa": "Taux de matériaux de peinture",
"rate_mash": "Tarif du matériel de la boutique",
"rate_matd": "Taux d'élimination des pneus",
+ "referral_source_other": "",
"referralsource": "Source de référence",
"regie_number": "Enregistrement #",
"repairtotal": "Réparation totale",
@@ -1812,6 +1813,7 @@
"act_price": "",
"backordered_eta": "",
"backordered_on": "",
+ "comments": "",
"cost": "",
"db_price": "",
"deliver_by": "",
diff --git a/client/src/utils/DateFormatter.jsx b/client/src/utils/DateFormatter.jsx
index 883e518ce..9452e67bc 100644
--- a/client/src/utils/DateFormatter.jsx
+++ b/client/src/utils/DateFormatter.jsx
@@ -3,7 +3,11 @@ import moment from "moment";
import React from "react";
export function DateFormatter(props) {
- return props.children ? moment(props.children).format("MM/DD/YYYY") : null;
+ return props.children
+ ? moment(props.children).format(
+ props.includeDay ? "ddd MM/DD/YYYY" : "MM/DD/YYYY"
+ )
+ : null;
}
export function DateTimeFormatter(props) {
diff --git a/client/src/utils/RenderTemplate.js b/client/src/utils/RenderTemplate.js
index d8fcc27d6..5b0122c91 100644
--- a/client/src/utils/RenderTemplate.js
+++ b/client/src/utils/RenderTemplate.js
@@ -209,17 +209,21 @@ const fetchContextData = async (templateObject) => {
`${server}/odata/assets?$filter=name eq '${templateObject.name}.query'`
);
- let templateQueryToExecute,
- useShopSpecificTemplate = false;
+ let templateQueryToExecute;
+ let useShopSpecificTemplate = false;
// let shopSpecificTemplate;
if (shopSpecificFolder) {
let shopSpecificTemplate = jsReportQueries.data.value.find(
(f) => f?.folder?.shortid === shopSpecificFolder.shortid
);
- useShopSpecificTemplate = true;
- templateQueryToExecute = atob(shopSpecificTemplate.content);
- } else {
+ if (shopSpecificTemplate) {
+ useShopSpecificTemplate = true;
+ templateQueryToExecute = atob(shopSpecificTemplate.content);
+ }
+ }
+
+ if (!templateQueryToExecute) {
const generalTemplate = jsReportQueries.data.value.find((f) => !f.folder);
useShopSpecificTemplate = false;
templateQueryToExecute = atob(generalTemplate.content);
diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml
index 9eee43482..08edb71cb 100644
--- a/hasura/metadata/tables.yaml
+++ b/hasura/metadata/tables.yaml
@@ -2716,6 +2716,7 @@
- rate_mash
- rate_matd
- referral_source
+ - referral_source_other
- regie_number
- ro_number
- scheduled_completion
@@ -2963,6 +2964,7 @@
- rate_mash
- rate_matd
- referral_source
+ - referral_source_other
- regie_number
- ro_number
- scheduled_completion
@@ -3220,6 +3222,7 @@
- rate_mash
- rate_matd
- referral_source
+ - referral_source_other
- regie_number
- ro_number
- scheduled_completion
@@ -3779,6 +3782,7 @@
- active:
_eq: true
columns:
+ - comments
- created_at
- deliver_by
- id
@@ -3796,6 +3800,7 @@
- role: user
permission:
columns:
+ - comments
- created_at
- deliver_by
- id
@@ -3823,6 +3828,7 @@
- role: user
permission:
columns:
+ - comments
- created_at
- deliver_by
- id
diff --git a/hasura/migrations/1633371928424_alter_table_public_jobs_add_column_referral_soure_other/down.sql b/hasura/migrations/1633371928424_alter_table_public_jobs_add_column_referral_soure_other/down.sql
new file mode 100644
index 000000000..c9ae4c4f4
--- /dev/null
+++ b/hasura/migrations/1633371928424_alter_table_public_jobs_add_column_referral_soure_other/down.sql
@@ -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;
diff --git a/hasura/migrations/1633371928424_alter_table_public_jobs_add_column_referral_soure_other/up.sql b/hasura/migrations/1633371928424_alter_table_public_jobs_add_column_referral_soure_other/up.sql
new file mode 100644
index 000000000..5f5bef695
--- /dev/null
+++ b/hasura/migrations/1633371928424_alter_table_public_jobs_add_column_referral_soure_other/up.sql
@@ -0,0 +1,2 @@
+alter table "public"."jobs" add column "referral_soure_other" text
+ null;
diff --git a/hasura/migrations/1633371952863_alter_table_public_jobs_alter_column_referral_soure_other/down.sql b/hasura/migrations/1633371952863_alter_table_public_jobs_alter_column_referral_soure_other/down.sql
new file mode 100644
index 000000000..b7237950c
--- /dev/null
+++ b/hasura/migrations/1633371952863_alter_table_public_jobs_alter_column_referral_soure_other/down.sql
@@ -0,0 +1 @@
+alter table "public"."jobs" rename column "referral_source_other" to "referral_soure_other";
diff --git a/hasura/migrations/1633371952863_alter_table_public_jobs_alter_column_referral_soure_other/up.sql b/hasura/migrations/1633371952863_alter_table_public_jobs_alter_column_referral_soure_other/up.sql
new file mode 100644
index 000000000..b61ffafae
--- /dev/null
+++ b/hasura/migrations/1633371952863_alter_table_public_jobs_alter_column_referral_soure_other/up.sql
@@ -0,0 +1 @@
+alter table "public"."jobs" rename column "referral_soure_other" to "referral_source_other";
diff --git a/hasura/migrations/1633373374089_alter_table_public_parts_orders_add_column_comments/down.sql b/hasura/migrations/1633373374089_alter_table_public_parts_orders_add_column_comments/down.sql
new file mode 100644
index 000000000..390edb6b9
--- /dev/null
+++ b/hasura/migrations/1633373374089_alter_table_public_parts_orders_add_column_comments/down.sql
@@ -0,0 +1,4 @@
+-- Could not auto-generate a down migration.
+-- Please write an appropriate down migration for the SQL below:
+-- alter table "public"."parts_orders" add column "comments" text
+-- null;
diff --git a/hasura/migrations/1633373374089_alter_table_public_parts_orders_add_column_comments/up.sql b/hasura/migrations/1633373374089_alter_table_public_parts_orders_add_column_comments/up.sql
new file mode 100644
index 000000000..fe751d2c2
--- /dev/null
+++ b/hasura/migrations/1633373374089_alter_table_public_parts_orders_add_column_comments/up.sql
@@ -0,0 +1,2 @@
+alter table "public"."parts_orders" add column "comments" text
+ null;
diff --git a/server/graphql-client/queries.js b/server/graphql-client/queries.js
index 9a83dffc1..7e7f3de29 100644
--- a/server/graphql-client/queries.js
+++ b/server/graphql-client/queries.js
@@ -555,6 +555,7 @@ exports.GET_JOB_BY_PK = ` query GET_JOB_BY_PK($id: uuid!) {
kmin
kmout
referral_source
+ referral_source_other
unit_number
po_number
special_coverage_policy