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}
rowSelection={{
onChange: handleOnRowClick,
getCheckboxProps: (record) => ({
disabled: record.removed,
}),
selectedRowKeys: selectedLines,
}}
rowClassName={(record) => record.removed && "text-strikethrough"}

View File

@@ -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) {

View File

@@ -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) {