From 1eda8f8c3182e93f0a8fe8280d57983b9339496c Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Thu, 25 Mar 2021 08:41:36 -0700 Subject: [PATCH] IO-809 Disable reconciliation on removed joblines. --- .../job-reconciliation-parts-table.component.jsx | 3 +++ .../job-reconciliation-totals.utility.js | 4 ++-- client/src/graphql/jobs.queries.js | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) 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 4c35fdd94..ceb5df6eb 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 @@ -113,6 +113,9 @@ export default function JobReconcilitionPartsTable({ onChange={handleTableChange} rowSelection={{ onChange: handleOnRowClick, + getCheckboxProps: (record) => ({ + disabled: record.removed, + }), selectedRowKeys: selectedLines, }} rowClassName={(record) => record.removed && "text-strikethrough"} diff --git a/client/src/components/job-reconciliation-totals/job-reconciliation-totals.utility.js b/client/src/components/job-reconciliation-totals/job-reconciliation-totals.utility.js index cb4b9fc82..b3f2771cc 100644 --- a/client/src/components/job-reconciliation-totals/job-reconciliation-totals.utility.js +++ b/client/src/components/job-reconciliation-totals/job-reconciliation-totals.utility.js @@ -11,7 +11,7 @@ export const reconcileByAssocLine = ( const [selectedJobLines, setSelectedJobLines] = jobLineState; const allJoblinesFromBills = billLines - .filter((bl) => !!bl.joblineid) + .filter((bl) => bl.joblineid && !(bl.jobline && bl.jobline.removed)) .map((bl) => bl.joblineid); const duplicatedJobLinesbyInvoiceId = _.filter( @@ -73,7 +73,7 @@ export const reconcileByPrice = ( jobLines.forEach((jl) => { const matchingBillLineIds = billLines - .filter((bl) => bl.actual_price === jl.act_price) + .filter((bl) => bl.actual_price === jl.act_price && !jl.removed) .map((bl) => bl.id); if (matchingBillLineIds.length > 1) { diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 2cef839a5..17aa2c0a9 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -608,6 +608,10 @@ export const GET_JOB_RECONCILIATION_BY_PK = gql` line_desc applicable_taxes deductedfromlbr + jobline { + id + removed + } } } jobs_by_pk(id: $id) {