diff --git a/client/src/components/global-search/global-search.component.jsx b/client/src/components/global-search/global-search.component.jsx index 0e5ddf8c8..ce8e526d7 100644 --- a/client/src/components/global-search/global-search.component.jsx +++ b/client/src/components/global-search/global-search.component.jsx @@ -45,7 +45,7 @@ export default function GlobalSearch() { {`${job.v_model_yr || ""} ${job.v_make_desc || ""} ${ job.v_model_desc || "" }`} - {`${job.clm_no}`} + {`${job.clm_no || ""}`} ), @@ -91,8 +91,8 @@ export default function GlobalSearch() { vehicle.v_make_desc || "" } ${vehicle.v_model_desc || ""}`} - {vehicle.plate_no} - {vehicle.v_vin} + {vehicle.plate_no || ""} + {vehicle.v_vin || ""} ), @@ -108,10 +108,11 @@ export default function GlobalSearch() { label: ( }> + {payment.paymentnum} {payment.job.ro_number} - {payment.job.memo} - {payment.job.amount} - {payment.job.transactionid} + {payment.memo || ""} + {payment.amount || ""} + {payment.transactionid || ""} ), diff --git a/client/src/components/job-detail-lines/job-lines.component.jsx b/client/src/components/job-detail-lines/job-lines.component.jsx index 8ac3bdd02..0d640fff1 100644 --- a/client/src/components/job-detail-lines/job-lines.component.jsx +++ b/client/src/components/job-detail-lines/job-lines.component.jsx @@ -295,18 +295,18 @@ export function JobLinesComponent({ onClick={async () => { await deleteJobLine({ variables: { joblineId: record.id }, - update(cache) { - cache.modify({ - id: cache.identify(job), - fields: { - joblines(existingJobLines, { readField }) { - return existingJobLines.filter( - (jlRef) => record.id !== readField("id", jlRef) - ); - }, - }, - }); - }, + // update(cache) { + // cache.modify({ + // id: cache.identify(job), + // fields: { + // joblines(existingJobLines, { readField }) { + // return existingJobLines.filter( + // (jlRef) => record.id !== readField("id", jlRef) + // ); + // }, + // }, + // }); + // }, }); await axios.post("/job/totalsssu", { id: job.id, diff --git a/client/src/components/job-reconciliation-bills-table/job-reconciliation-bills-table.component.jsx b/client/src/components/job-reconciliation-bills-table/job-reconciliation-bills-table.component.jsx index be0fba05d..40cd8120c 100644 --- a/client/src/components/job-reconciliation-bills-table/job-reconciliation-bills-table.component.jsx +++ b/client/src/components/job-reconciliation-bills-table/job-reconciliation-bills-table.component.jsx @@ -1,4 +1,4 @@ -import { Checkbox, PageHeader, Table } from "antd"; +import { Checkbox, Table, Typography } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import CurrencyFormatter from "../../utils/CurrencyFormatter"; @@ -21,6 +21,7 @@ export default function JobReconciliationBillsTable({ title: t("billlines.fields.line_desc"), dataIndex: "line_desc", key: "line_desc", + width: "35%", sorter: (a, b) => alphaSort(a.line_desc, b.line_desc), sortOrder: state.sortedInfo.columnKey === "line_desc" && state.sortedInfo.order, @@ -29,6 +30,8 @@ export default function JobReconciliationBillsTable({ title: t("billlines.labels.from"), dataIndex: "from", key: "from", + width: "20%", + ellipsis: true, render: (text, record) => `${record.bill.vendor && record.bill.vendor.name} / ${ record.bill.invoice_number @@ -57,7 +60,7 @@ export default function JobReconciliationBillsTable({ ), }, { - title: t("billlines.fields.quantity"), + title: t("joblines.fields.part_qty"), dataIndex: "quantity", key: "quantity", sorter: (a, b) => a.quantity - b.quantity, @@ -86,10 +89,12 @@ export default function JobReconciliationBillsTable({ }; return ( - +
+ {t("bills.labels.bills")} - + ); } diff --git a/client/src/components/job-reconciliation-modal/job-reconciliation-modal.component.jsx b/client/src/components/job-reconciliation-modal/job-reconciliation-modal.component.jsx index 7b5b8aac8..f817a4e73 100644 --- a/client/src/components/job-reconciliation-modal/job-reconciliation-modal.component.jsx +++ b/client/src/components/job-reconciliation-modal/job-reconciliation-modal.component.jsx @@ -22,21 +22,23 @@ export default function JobReconciliationModalComponent({ job, bills }) { ); return ( -
- -
- - - - - - +
+
+ +
+ + + + + + + - - {error && } - {data && ( - - )} - + {loading && } + {error && } + {data && ( + + )} ); } diff --git a/client/src/components/job-reconciliation-parts-table/job-reconciliation-parts-table.component.jsx b/client/src/components/job-reconciliation-parts-table/job-reconciliation-parts-table.component.jsx index 496c06e4b..2bb5a7f53 100644 --- a/client/src/components/job-reconciliation-parts-table/job-reconciliation-parts-table.component.jsx +++ b/client/src/components/job-reconciliation-parts-table/job-reconciliation-parts-table.component.jsx @@ -1,4 +1,4 @@ -import { PageHeader, Table } from "antd"; +import { PageHeader, Table, Typography } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import CurrencyFormatter from "../../utils/CurrencyFormatter"; @@ -102,11 +102,13 @@ export default function JobReconcilitionPartsTable({ }; return ( - +
+ {t("jobs.labels.lines")}
{t("jobs.labels.reconciliation.removedpartsstrikethrough")} - + ); } diff --git a/client/src/components/owner-detail-jobs/owner-detail-jobs.component.jsx b/client/src/components/owner-detail-jobs/owner-detail-jobs.component.jsx index d2703b34b..e6553e1ab 100644 --- a/client/src/components/owner-detail-jobs/owner-detail-jobs.component.jsx +++ b/client/src/components/owner-detail-jobs/owner-detail-jobs.component.jsx @@ -31,11 +31,14 @@ function OwnerDetailJobsComponent({ bodyshop, owner }) { title: t("jobs.fields.vehicle"), dataIndex: "vehicleid", key: "vehicleid", - render: (text, record) => ( - - {`${record.v_model_yr} ${record.v_make_desc} ${record.v_model_desc}`} - - ), + render: (text, record) => + record.vehicleid ? ( + + {`${record.v_model_yr} ${record.v_make_desc} ${record.v_model_desc}`} + + ) : ( + t("jobs.errors.novehicle") + ), }, { title: t("jobs.fields.clm_no"), diff --git a/client/src/graphql/jobs-lines.queries.js b/client/src/graphql/jobs-lines.queries.js index 2aeac31d8..82d373942 100644 --- a/client/src/graphql/jobs-lines.queries.js +++ b/client/src/graphql/jobs-lines.queries.js @@ -215,7 +215,11 @@ export const generateJobLinesUpdatesForInvoicing = (joblines) => { export const DELETE_JOB_LINE_BY_PK = gql` mutation DELETE_JOB_LINE_BY_PK($joblineId: uuid!) { - delete_joblines_by_pk(id: $joblineId) { + update_joblines_by_pk( + pk_columns: { id: $joblineId } + _set: { removed: true } + ) { + removed id } } diff --git a/client/src/graphql/search.queries.js b/client/src/graphql/search.queries.js index 472b5df03..1b3cd2914 100644 --- a/client/src/graphql/search.queries.js +++ b/client/src/graphql/search.queries.js @@ -36,6 +36,7 @@ export const GLOBAL_SEARCH_QUERY = gql` search_payments(args: { search: $search }) { id amount + paymentnum job { ro_number id diff --git a/client/src/pages/export-logs/export-logs.page.component.jsx b/client/src/pages/export-logs/export-logs.page.component.jsx index c187302b9..f5d6dd04a 100644 --- a/client/src/pages/export-logs/export-logs.page.component.jsx +++ b/client/src/pages/export-logs/export-logs.page.component.jsx @@ -79,12 +79,10 @@ export function ExportLogsPageComponent({ bodyshop }) { title: t("jobs.fields.ro_number"), dataIndex: "ro_number", key: "ro_number", - sorter: (a, b) => alphaSort(a.ro_number, b.ro_number), - sortOrder: sortcolumn === "ro_number" && sortorder, render: (text, record) => record.job && ( - + {(record.job && record.job.ro_number) || t("general.labels.na")} ), diff --git a/hasura/migrations/1625768789569_run_sql_migration/down.yaml b/hasura/migrations/1625768789569_run_sql_migration/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/migrations/1625768789569_run_sql_migration/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/migrations/1625768789569_run_sql_migration/up.yaml b/hasura/migrations/1625768789569_run_sql_migration/up.yaml new file mode 100644 index 000000000..f79c5cf37 --- /dev/null +++ b/hasura/migrations/1625768789569_run_sql_migration/up.yaml @@ -0,0 +1,11 @@ +- args: + cascade: false + read_only: false + sql: "CREATE OR REPLACE FUNCTION public.search_payments(search text)\n RETURNS + SETOF payments\n LANGUAGE plpgsql\n STABLE\nAS $function$\n\nBEGIN\n if search + = '' then\n return query select * from payments ;\n else \n return query + SELECT\n p.*\nFROM\n payments p, jobs j\nWHERE\np.jobid = j.id AND\n(\nsearch + <% p.paymentnum OR\nsearch <% j.ownr_fn OR\nsearch <% j.ownr_ln OR\nsearch <% + j.ownr_co_nm OR\nsearch <% j.ro_number OR\n search <% (p.payer) OR\n search + <% (p.transactionid) OR\n search <% (p.memo));\n end if;\n\n\tEND\n$function$;" + type: run_sql