From: Galen Charlton Date: Thu, 3 Jun 2021 16:09:17 +0000 (-0400) Subject: funds: flesh out more links for the fund debits table X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bb4a58d129ba6bc7ef19f6f01fee8fc3090ea499;p=working%2FEvergreen.git funds: flesh out more links for the fund debits table LH#12 Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/fund-details-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/fund-details-dialog.component.ts index a04515ba8f..a078e707f1 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/fund-details-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/fund-details-dialog.component.ts @@ -145,10 +145,14 @@ export class FundDetailsDialogComponent }; } else if (idlClass === 'acqfdeb') { search.push({ fund: this.fundId }); - searchOps['flesh'] = 2; + searchOps['flesh'] = 3; searchOps['flesh_fields'] = { - 'acqfdeb': ['invoice_entry'], - 'acqie': ['invoice', 'purchase_order', 'lineitem'] + 'acqfdeb': ['invoice_entry','invoice_items','po_items','lineitem_details'], + 'acqie': ['invoice', 'purchase_order', 'lineitem'], + 'acqii': ['invoice'], + 'acqpoi': ['purchase_order'], + 'acqlid': ['lineitem'], + 'jub': ['purchase_order'] }; } @@ -172,6 +176,9 @@ export class FundDetailsDialogComponent row['po_id'] = null; row['po_name'] = null; row['li_id'] = null; + // TODO need to verify this, but we may be able to get away with + // the assumption that a given fund debit never has more than + // one line item, purchase order, or invoice associated with it. if (row.invoice_entry()) { if (row.invoice_entry().invoice()) { row['invoice_id'] = row.invoice_entry().invoice().id(); @@ -185,6 +192,25 @@ export class FundDetailsDialogComponent row['li_id'] = row.invoice_entry().lineitem().id(); } } + if (row.lineitem_details() && row.lineitem_details().length) { + if (row.lineitem_details()[0].lineitem().purchase_order()) { + row['li_id'] = row.lineitem_details()[0].lineitem().id(); + row['po_id'] = row.lineitem_details()[0].lineitem().purchase_order().id(); + row['po_name'] = row.lineitem_details()[0].lineitem().purchase_order().name(); + } + } + if (row.po_items() && row.po_items().length) { + if (row.po_items()[0].purchase_order()) { + row['po_id'] = row.po_items()[0].purchase_order().id(); + row['po_name'] = row.po_items()[0].purchase_order().name(); + } + } + if (row.invoice_items() && row.invoice_items().length) { + if (row.invoice_items()[0].invoice()) { + row['invoice_id'] = row.invoice_items()[0].invoice().id(); + row['vendor_invoice_id'] = row.invoice_items()[0].invoice().inv_ident(); + } + } } return of(row); }