From: Galen Charlton Date: Mon, 29 Mar 2021 02:42:39 +0000 (-0400) Subject: fnds: add a bunch of links X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0928c0ff1503c44eeb5eaf19a6ffe3c99fc994e5;p=working%2FEvergreen.git fnds: add a bunch of links Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/fund-details-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/fund-details-dialog.component.html index 98a8c3a129..3e05cba9f7 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/fund-details-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/fund-details-dialog.component.html @@ -73,9 +73,15 @@
- + + + {{row.funding_source().code()}} ({{getOrgShortname(row.funding_source().owner())}}) + + + @@ -92,15 +98,42 @@
- + + + {{row.src_fund().code()}} ({{row.src_fund().year()}}) ({{getOrgShortname(row.src_fund().org())}}) + + + + {{row.src_fund().code()}} ({{row.src_fund().year()}}) ({{getOrgShortname(row.src_fund().org())}}) + + + + - + + + {{row.dest_fund().code()}} ({{row.dest_fund().year()}}) ({{getOrgShortname(row.dest_fund().org())}}) + + + + {{row.dest_fund().code()}} ({{row.dest_fund().year()}}) ({{getOrgShortname(row.dest_fund().org())}}) + + + + + + + {{row.funding_source_credit().funding_source().code()}} ({{getOrgShortname(row.funding_source_credit().funding_source().owner())}}) + + +
@@ -111,6 +144,7 @@
@@ -120,7 +154,25 @@ - + + + {{row.li_id}} + + + + + + {{row.po_name}} + + + + + + {{row.vendor_invoice_id}} + + + + 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 f6efc48ad2..62a68f5c90 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 @@ -7,14 +7,17 @@ import {NetService} from '@eg/core/net.service'; import {AuthService} from '@eg/core/auth.service'; import {PcrudService} from '@eg/core/pcrud.service'; import {StoreService} from '@eg/core/store.service'; +import {OrgService} from '@eg/core/org.service'; import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component'; -import {GridDataSource} from '@eg/share/grid/grid'; +import {GridDataSource, GridCellTextGenerator} from '@eg/share/grid/grid'; import {Pager} from '@eg/share/util/pager'; import {NgbModal} from '@ng-bootstrap/ng-bootstrap'; import {StringComponent} from '@eg/share/string/string.component'; import {ToastService} from '@eg/share/toast/toast.service'; import {FundTagsComponent} from './fund-tags.component'; import {FundTransferDialogComponent} from './fund-transfer-dialog.component'; +import {map, mergeMap} from 'rxjs/operators'; +import {Observable, forkJoin, of} from 'rxjs'; @Component({ selector: 'eg-fund-details-dialog', @@ -40,6 +43,7 @@ export class FundDetailsDialogComponent activeTab = 'summary'; defaultTabType = 'summary'; + cellTextGenerator: GridCellTextGenerator; constructor( private idl: IdlService, @@ -48,6 +52,7 @@ export class FundDetailsDialogComponent private auth: AuthService, private pcrud: PcrudService, private store: StoreService, + private org: OrgService, private format: FormatService, private toast: ToastService, private modal: NgbModal @@ -65,6 +70,15 @@ export class FundDetailsDialogComponent this.onOpen$.subscribe(() => this._initRecord()); this.idlDef = this.idl.classes['acqf'] this.fieldOrder = 'name,code,year,org,active,currency_type,balance_stop_percentage,balance_warning_percentage,propagate,rollover'; + + this.cellTextGenerator = { + src_fund: row => row().code(), + dest_fund: row => row().code(), + funding_source: row => row().code(), + li_id: row => row.li_id, + po_id: row => row.po_name, + invoice_id: row => row.vendor_invoice_id + }; } private _initRecord() { @@ -121,8 +135,18 @@ export class FundDetailsDialogComponent { dest_fund: this.fundId } ] }); + searchOps['flesh'] = 2; + searchOps['flesh_fields'] = { + 'acqftr': ['funding_source_credit'], + 'acqfscred': ['funding_source'] + } } else if (idlClass === 'acqfdeb') { search.push({ fund: this.fundId }); + searchOps['flesh'] = 2; + searchOps['flesh_fields'] = { + 'acqfdeb': ['invoice_entry'], + 'acqie': ['invoice','purchase_order','lineitem'] + } } Object.keys(gridSource.filters).forEach(key => { @@ -131,13 +155,36 @@ export class FundDetailsDialogComponent }); }); - return this.pcrud.search( - idlClass, search, searchOps, reqOps); + return this.pcrud.search(idlClass, search, searchOps, reqOps) + .pipe(mergeMap((row) => this.doExtraFleshing(row))); }; return gridSource; } + doExtraFleshing(row: IdlObject): Observable { + if (row.classname === 'acqfdeb') { + row['vendor_invoice_id'] = null; + row['invoice_id'] = null; + row['po_id'] = null; + row['po_name'] = null; + row['li_id'] = null; + if (row.invoice_entry()) { + if (row.invoice_entry().invoice()) { + row['invoice_id'] = row.invoice_entry().invoice().id(); + row['vendor_invoice_id'] = row.invoice_entry().invoice().inv_ident(); + } + if (row.invoice_entry().purchase_order()) { + row['po_id'] = row.invoice_entry().purchase_order().id(); + row['po_name'] = row.invoice_entry().purchase_order().name(); + } + if (row.invoice_entry().lineitem()) { + row['li_id'] = row.invoice_entry().lineitem().id(); + } + } + } + return of(row); + } formatCurrency(value: any) { return this.format.transform({ value: value, @@ -194,4 +241,12 @@ export class FundDetailsDialogComponent this.defaultTabType = this.activeTab; this.store.setLocalItem('eg.acq.fund_details.default_tab', this.activeTab); } + + getOrgShortname(ou: any) { + if (typeof ou === 'object') { + return ou.shortname(); + } else { + return this.org.get(ou).shortname(); + } + } } diff --git a/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funding-source-transactions-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funding-source-transactions-dialog.component.html index a48042ce16..8e9927cecc 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funding-source-transactions-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funding-source-transactions-dialog.component.html @@ -52,7 +52,9 @@ - {{row.fund().code()}} ({{row.fund().year()}}) ({{getOrgShortname(row.fund().org())}}) + + {{row.fund().code()}} ({{row.fund().year()}}) ({{getOrgShortname(row.fund().org())}}) +