From: Galen Charlton Date: Tue, 17 May 2022 15:19:22 +0000 (+0000) Subject: LP#1929749: insert current year as FY if no fiscal years are actually defined X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a3a178ac62471cbc1c5e4643e995aa62ef46fe04;p=working%2FEvergreen.git LP#1929749: insert current year as FY if no fiscal years are actually defined Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.service.ts b/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.service.ts index 2a61d5d845..8e555ae6f3 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.service.ts @@ -142,6 +142,15 @@ export class PicklistUploadService { {atomic: true} ).toPromise().then(years => { this.fiscalYears = years.filter( y => y.calendar() === this.org.get(org).fiscal_calendar()); + // if there are no entries, inject a special entry for the current year + if (!this.fiscalYears.length) { + const afy = this.idl.create('acqfy'); + afy.id(-1); + afy.calendar(-1); + const now = new Date(); + afy.year(now.getFullYear()); + this.fiscalYears = [ afy ]; + } return this.fiscalYears; }); }