From: Galen Charlton Date: Mon, 29 Mar 2021 01:37:41 +0000 (-0400) Subject: funds: add routes for direct linking of funds and funding sources X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b0881ad281165bad0f4a6ae3035c92cefc9e0e7b;p=working%2FEvergreen.git funds: add routes for direct linking of funds and funding sources Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funding-sources.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funding-sources.component.ts index 4d31a4132d..cf7fb58ddc 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funding-sources.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funding-sources.component.ts @@ -1,4 +1,4 @@ -import {Component, Input, ViewChild, OnInit} from '@angular/core'; +import {Component, Input, ViewChild, OnInit, AfterViewInit} from '@angular/core'; import {Location} from '@angular/common'; import {FormatService} from '@eg/core/format.service'; import {GridDataSource, GridCellTextGenerator} from '@eg/share/grid/grid'; @@ -26,10 +26,12 @@ import {FundingSourceTransactionsDialogComponent} from './funding-source-transac templateUrl: './funding-sources.component.html' }) -export class FundingSourcesComponent extends AdminPageComponent implements OnInit { +export class FundingSourcesComponent extends AdminPageComponent implements OnInit, AfterViewInit { idlClass = 'acqfs'; classLabel: string; + @Input() startId: number; + @ViewChild('grid', { static: true }) grid: GridComponent; @ViewChild('fundingSourceTransactionsDialog', { static: false }) fundingSourceTransactionsDialog: FundingSourceTransactionsDialogComponent; @ViewChild('applyCreditDialog', { static: true }) applyCreditDialog: FmRecordEditorComponent; @@ -121,6 +123,16 @@ export class FundingSourcesComponent extends AdminPageComponent implements OnIni this.includeOrgDescendants = true; } + ngAfterViewInit() { + if (this.startId) { + this.pcrud.retrieve('acqfs', this.startId).subscribe( + acqfs => this.openTransactionsDialog([acqfs], 'allocations'), + err => {}, + () => this.startId = null + ); + } + } + calculateSummary(row: IdlObject): Observable { row['balance'] = 0; row['total_credits'] = 0; diff --git a/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funds-manager.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funds-manager.component.ts index d79c5da1e5..cbdd1642ca 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funds-manager.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funds-manager.component.ts @@ -1,4 +1,4 @@ -import {Component, Input, ViewChild, OnInit} from '@angular/core'; +import {Component, Input, ViewChild, OnInit, AfterViewInit} from '@angular/core'; import {Location} from '@angular/common'; import {FormatService} from '@eg/core/format.service'; import {GridDataSource, GridCellTextGenerator} from '@eg/share/grid/grid'; @@ -22,10 +22,12 @@ import {FundRolloverDialogComponent} from './fund-rollover-dialog.component'; templateUrl: './funds-manager.component.html' }) -export class FundsManagerComponent extends AdminPageComponent implements OnInit { +export class FundsManagerComponent extends AdminPageComponent implements OnInit, AfterViewInit { idlClass = 'acqf'; classLabel: string; + @Input() startId: number; + @ViewChild('fundDetailsDialog', { static: false }) fundDetailsDialog: FundDetailsDialogComponent; @ViewChild('fundRolloverDialog', { static: false }) fundRolloverDialog: FundRolloverDialogComponent; @ViewChild('grid', { static: true }) grid: GridComponent; @@ -121,6 +123,16 @@ export class FundsManagerComponent extends AdminPageComponent implements OnInit this.includeOrgDescendants = true; } + ngAfterViewInit() { + if (this.startId) { + this.pcrud.retrieve('acqf', this.startId).subscribe( + acqf => this.openFundDetailsDialog([acqf]), + err => {}, + () => this.startId = null + ); + } + } + checkRolloverPerms() { this.canRollover = false; diff --git a/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funds.component.html b/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funds.component.html index 0023e5734b..8f3836c425 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funds.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/funds.component.html @@ -3,24 +3,25 @@ -