Merged in feature/2021-07-09 (pull request #133)
feature/2021-07-09 Approved-by: Patrick Fic
This commit is contained in:
@@ -45,7 +45,7 @@ export default function GlobalSearch() {
|
|||||||
<span>{`${job.v_model_yr || ""} ${job.v_make_desc || ""} ${
|
<span>{`${job.v_model_yr || ""} ${job.v_make_desc || ""} ${
|
||||||
job.v_model_desc || ""
|
job.v_model_desc || ""
|
||||||
}`}</span>
|
}`}</span>
|
||||||
<span>{`${job.clm_no}`}</span>
|
<span>{`${job.clm_no || ""}`}</span>
|
||||||
</Space>
|
</Space>
|
||||||
</Link>
|
</Link>
|
||||||
),
|
),
|
||||||
@@ -91,8 +91,8 @@ export default function GlobalSearch() {
|
|||||||
vehicle.v_make_desc || ""
|
vehicle.v_make_desc || ""
|
||||||
} ${vehicle.v_model_desc || ""}`}
|
} ${vehicle.v_model_desc || ""}`}
|
||||||
</span>
|
</span>
|
||||||
<span>{vehicle.plate_no}</span>
|
<span>{vehicle.plate_no || ""}</span>
|
||||||
<span> {vehicle.v_vin}</span>
|
<span> {vehicle.v_vin || ""}</span>
|
||||||
</Space>
|
</Space>
|
||||||
</Link>
|
</Link>
|
||||||
),
|
),
|
||||||
@@ -108,10 +108,11 @@ export default function GlobalSearch() {
|
|||||||
label: (
|
label: (
|
||||||
<Link to={`/manage/jobs/${payment.job.id}`}>
|
<Link to={`/manage/jobs/${payment.job.id}`}>
|
||||||
<Space size="small" split={<Divider type="vertical" />}>
|
<Space size="small" split={<Divider type="vertical" />}>
|
||||||
|
<span>{payment.paymentnum}</span>
|
||||||
<span>{payment.job.ro_number}</span>
|
<span>{payment.job.ro_number}</span>
|
||||||
<span>{payment.job.memo}</span>
|
<span>{payment.memo || ""}</span>
|
||||||
<span>{payment.job.amount}</span>
|
<span>{payment.amount || ""}</span>
|
||||||
<span>{payment.job.transactionid}</span>
|
<span>{payment.transactionid || ""}</span>
|
||||||
</Space>
|
</Space>
|
||||||
</Link>
|
</Link>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -295,18 +295,18 @@ export function JobLinesComponent({
|
|||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
await deleteJobLine({
|
await deleteJobLine({
|
||||||
variables: { joblineId: record.id },
|
variables: { joblineId: record.id },
|
||||||
update(cache) {
|
// update(cache) {
|
||||||
cache.modify({
|
// cache.modify({
|
||||||
id: cache.identify(job),
|
// id: cache.identify(job),
|
||||||
fields: {
|
// fields: {
|
||||||
joblines(existingJobLines, { readField }) {
|
// joblines(existingJobLines, { readField }) {
|
||||||
return existingJobLines.filter(
|
// return existingJobLines.filter(
|
||||||
(jlRef) => record.id !== readField("id", jlRef)
|
// (jlRef) => record.id !== readField("id", jlRef)
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
});
|
});
|
||||||
await axios.post("/job/totalsssu", {
|
await axios.post("/job/totalsssu", {
|
||||||
id: job.id,
|
id: job.id,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Checkbox, PageHeader, Table } from "antd";
|
import { Checkbox, Table, Typography } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
@@ -21,6 +21,7 @@ export default function JobReconciliationBillsTable({
|
|||||||
title: t("billlines.fields.line_desc"),
|
title: t("billlines.fields.line_desc"),
|
||||||
dataIndex: "line_desc",
|
dataIndex: "line_desc",
|
||||||
key: "line_desc",
|
key: "line_desc",
|
||||||
|
width: "35%",
|
||||||
sorter: (a, b) => alphaSort(a.line_desc, b.line_desc),
|
sorter: (a, b) => alphaSort(a.line_desc, b.line_desc),
|
||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "line_desc" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "line_desc" && state.sortedInfo.order,
|
||||||
@@ -29,6 +30,8 @@ export default function JobReconciliationBillsTable({
|
|||||||
title: t("billlines.labels.from"),
|
title: t("billlines.labels.from"),
|
||||||
dataIndex: "from",
|
dataIndex: "from",
|
||||||
key: "from",
|
key: "from",
|
||||||
|
width: "20%",
|
||||||
|
ellipsis: true,
|
||||||
render: (text, record) =>
|
render: (text, record) =>
|
||||||
`${record.bill.vendor && record.bill.vendor.name} / ${
|
`${record.bill.vendor && record.bill.vendor.name} / ${
|
||||||
record.bill.invoice_number
|
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",
|
dataIndex: "quantity",
|
||||||
key: "quantity",
|
key: "quantity",
|
||||||
sorter: (a, b) => a.quantity - b.quantity,
|
sorter: (a, b) => a.quantity - b.quantity,
|
||||||
@@ -86,10 +89,12 @@ export default function JobReconciliationBillsTable({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageHeader title={t("bills.labels.bills")}>
|
<div>
|
||||||
|
<Typography.Title level={4}>{t("bills.labels.bills")}</Typography.Title>
|
||||||
<Table
|
<Table
|
||||||
pagination={false}
|
pagination={false}
|
||||||
scroll={{ y: "40vh", x: true }}
|
size="small"
|
||||||
|
scroll={{ y: "80vh", x: true }}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
dataSource={invoiceLineData}
|
dataSource={invoiceLineData}
|
||||||
@@ -99,6 +104,6 @@ export default function JobReconciliationBillsTable({
|
|||||||
selectedRowKeys: selectedLines,
|
selectedRowKeys: selectedLines,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</PageHeader>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,21 +22,23 @@ export default function JobReconciliationModalComponent({ job, bills }) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div style={{ flex: 1, display: "flex", flexDirection: "column" }}>
|
||||||
<Row gutter={[16, 16]}>
|
<div style={{ flex: 1 }}>
|
||||||
<Col span={12}>
|
<Row gutter={8}>
|
||||||
<JobReconciliationPartsTable
|
<Col span={12}>
|
||||||
jobLineData={jobLineData}
|
<JobReconciliationPartsTable
|
||||||
jobLineState={jobLineState}
|
jobLineData={jobLineData}
|
||||||
/>
|
jobLineState={jobLineState}
|
||||||
</Col>
|
/>
|
||||||
<Col span={12}>
|
</Col>
|
||||||
<JobReconciliationBillsTable
|
<Col span={12}>
|
||||||
invoiceLineData={invoiceLineData}
|
<JobReconciliationBillsTable
|
||||||
billLineState={billLineState}
|
invoiceLineData={invoiceLineData}
|
||||||
/>
|
billLineState={billLineState}
|
||||||
</Col>
|
/>
|
||||||
</Row>
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</div>
|
||||||
<Row>
|
<Row>
|
||||||
<JobReconciliationTotals
|
<JobReconciliationTotals
|
||||||
jobLines={jobLineData}
|
jobLines={jobLineData}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
.imex-reconciliation-modal {
|
||||||
|
top: 20px;
|
||||||
|
.ant-modal-content {
|
||||||
|
height: 95vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
.ant-modal-body {
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@ import { selectReconciliation } from "../../redux/modals/modals.selectors";
|
|||||||
import JobReconciliationModalComponent from "./job-reconciliation-modal.component";
|
import JobReconciliationModalComponent from "./job-reconciliation-modal.component";
|
||||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
|
import "./job-reconciliation-modal.styles.scss";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
reconciliationModal: selectReconciliation,
|
reconciliationModal: selectReconciliation,
|
||||||
@@ -38,23 +39,23 @@ function JobReconciliationModalContainer({
|
|||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
title={t("jobs.labels.reconciliationheader")}
|
title={t("jobs.labels.reconciliationheader")}
|
||||||
width={"90%"}
|
width={"95%"}
|
||||||
visible={visible}
|
visible={visible}
|
||||||
okText={t("general.actions.close")}
|
okText={t("general.actions.close")}
|
||||||
onOk={handleCancel}
|
onOk={handleCancel}
|
||||||
onCancel={handleCancel}
|
onCancel={handleCancel}
|
||||||
cancelButtonProps={{ display: "none" }}
|
cancelButtonProps={{ display: "none" }}
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
|
className="imex-reconciliation-modal"
|
||||||
>
|
>
|
||||||
<LoadingSpinner loading={loading}>
|
{loading && <LoadingSpinner loading={loading} />}
|
||||||
{error && <AlertComponent message={error.message} type="error" />}
|
{error && <AlertComponent message={error.message} type="error" />}
|
||||||
{data && (
|
{data && (
|
||||||
<JobReconciliationModalComponent
|
<JobReconciliationModalComponent
|
||||||
job={data && data.jobs_by_pk}
|
job={data && data.jobs_by_pk}
|
||||||
bills={data && data.bills}
|
bills={data && data.bills}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</LoadingSpinner>
|
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { PageHeader, Table } from "antd";
|
import { PageHeader, Table, Typography } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
@@ -102,11 +102,13 @@ export default function JobReconcilitionPartsTable({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageHeader title={t("jobs.labels.lines")}>
|
<div>
|
||||||
|
<Typography.Title level={4}>{t("jobs.labels.lines")}</Typography.Title>
|
||||||
<Table
|
<Table
|
||||||
pagination={false}
|
pagination={false}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
scroll={{ y: "40vh", x: true }}
|
size="small"
|
||||||
|
scroll={{ y: "80vh", x: true }}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
dataSource={jobLineData}
|
dataSource={jobLineData}
|
||||||
onChange={handleTableChange}
|
onChange={handleTableChange}
|
||||||
@@ -122,6 +124,6 @@ export default function JobReconcilitionPartsTable({
|
|||||||
<div style={{ fontStyle: "italic", margin: "4px" }}>
|
<div style={{ fontStyle: "italic", margin: "4px" }}>
|
||||||
{t("jobs.labels.reconciliation.removedpartsstrikethrough")}
|
{t("jobs.labels.reconciliation.removedpartsstrikethrough")}
|
||||||
</div>
|
</div>
|
||||||
</PageHeader>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,11 +31,14 @@ function OwnerDetailJobsComponent({ bodyshop, owner }) {
|
|||||||
title: t("jobs.fields.vehicle"),
|
title: t("jobs.fields.vehicle"),
|
||||||
dataIndex: "vehicleid",
|
dataIndex: "vehicleid",
|
||||||
key: "vehicleid",
|
key: "vehicleid",
|
||||||
render: (text, record) => (
|
render: (text, record) =>
|
||||||
<Link to={`/manage/vehicles/${record.vehicleid}`}>
|
record.vehicleid ? (
|
||||||
{`${record.v_model_yr} ${record.v_make_desc} ${record.v_model_desc}`}
|
<Link to={`/manage/vehicles/${record.vehicleid}`}>
|
||||||
</Link>
|
{`${record.v_model_yr} ${record.v_make_desc} ${record.v_model_desc}`}
|
||||||
),
|
</Link>
|
||||||
|
) : (
|
||||||
|
t("jobs.errors.novehicle")
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("jobs.fields.clm_no"),
|
title: t("jobs.fields.clm_no"),
|
||||||
|
|||||||
@@ -215,7 +215,11 @@ export const generateJobLinesUpdatesForInvoicing = (joblines) => {
|
|||||||
|
|
||||||
export const DELETE_JOB_LINE_BY_PK = gql`
|
export const DELETE_JOB_LINE_BY_PK = gql`
|
||||||
mutation DELETE_JOB_LINE_BY_PK($joblineId: uuid!) {
|
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
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ export const GLOBAL_SEARCH_QUERY = gql`
|
|||||||
search_payments(args: { search: $search }) {
|
search_payments(args: { search: $search }) {
|
||||||
id
|
id
|
||||||
amount
|
amount
|
||||||
|
paymentnum
|
||||||
job {
|
job {
|
||||||
ro_number
|
ro_number
|
||||||
id
|
id
|
||||||
|
|||||||
@@ -79,12 +79,10 @@ export function ExportLogsPageComponent({ bodyshop }) {
|
|||||||
title: t("jobs.fields.ro_number"),
|
title: t("jobs.fields.ro_number"),
|
||||||
dataIndex: "ro_number",
|
dataIndex: "ro_number",
|
||||||
key: "ro_number",
|
key: "ro_number",
|
||||||
sorter: (a, b) => alphaSort(a.ro_number, b.ro_number),
|
|
||||||
sortOrder: sortcolumn === "ro_number" && sortorder,
|
|
||||||
|
|
||||||
render: (text, record) =>
|
render: (text, record) =>
|
||||||
record.job && (
|
record.job && (
|
||||||
<Link to={"/manage/jobs/" + record.job && record.job.id}>
|
<Link to={`/manage/jobs/${record.job.id}`}>
|
||||||
{(record.job && record.job.ro_number) || t("general.labels.na")}
|
{(record.job && record.job.ro_number) || t("general.labels.na")}
|
||||||
</Link>
|
</Link>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
11
hasura/migrations/1625768789569_run_sql_migration/up.yaml
Normal file
11
hasura/migrations/1625768789569_run_sql_migration/up.yaml
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user