IO-809 Disable reconciliation on removed joblines.

This commit is contained in:
Patrick Fic
2021-03-25 08:41:36 -07:00
parent f5dfd1ade4
commit 1eda8f8c31
3 changed files with 9 additions and 2 deletions

View File

@@ -113,6 +113,9 @@ export default function JobReconcilitionPartsTable({
onChange={handleTableChange} onChange={handleTableChange}
rowSelection={{ rowSelection={{
onChange: handleOnRowClick, onChange: handleOnRowClick,
getCheckboxProps: (record) => ({
disabled: record.removed,
}),
selectedRowKeys: selectedLines, selectedRowKeys: selectedLines,
}} }}
rowClassName={(record) => record.removed && "text-strikethrough"} rowClassName={(record) => record.removed && "text-strikethrough"}

View File

@@ -11,7 +11,7 @@ export const reconcileByAssocLine = (
const [selectedJobLines, setSelectedJobLines] = jobLineState; const [selectedJobLines, setSelectedJobLines] = jobLineState;
const allJoblinesFromBills = billLines const allJoblinesFromBills = billLines
.filter((bl) => !!bl.joblineid) .filter((bl) => bl.joblineid && !(bl.jobline && bl.jobline.removed))
.map((bl) => bl.joblineid); .map((bl) => bl.joblineid);
const duplicatedJobLinesbyInvoiceId = _.filter( const duplicatedJobLinesbyInvoiceId = _.filter(
@@ -73,7 +73,7 @@ export const reconcileByPrice = (
jobLines.forEach((jl) => { jobLines.forEach((jl) => {
const matchingBillLineIds = billLines 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); .map((bl) => bl.id);
if (matchingBillLineIds.length > 1) { if (matchingBillLineIds.length > 1) {

View File

@@ -608,6 +608,10 @@ export const GET_JOB_RECONCILIATION_BY_PK = gql`
line_desc line_desc
applicable_taxes applicable_taxes
deductedfromlbr deductedfromlbr
jobline {
id
removed
}
} }
} }
jobs_by_pk(id: $id) { jobs_by_pk(id: $id) {