LP#1929749: fix handling of match set and fiscal year
authorGalen Charlton <gmc@equinoxOLI.org>
Thu, 13 Jan 2022 23:02:41 +0000 (18:02 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Thu, 13 Jan 2022 23:02:41 +0000 (18:02 -0500)
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/acq/picklist/upload.component.ts

index b35b886..3b797b7 100644 (file)
@@ -374,9 +374,21 @@ export class UploadComponent implements OnInit, AfterViewInit, OnDestroy {
         );
     }
 
+    // helper method to return the year string rather than the FY ID
+    // TODO: can remove this once fiscal years are better managed
+    _getFiscalYearLabel(): string {
+        if (this.selectedFiscalYear) {
+            const found =  (this.vlagent.fiscalYears || []).find(x => x.id() === this.selectedFiscalYear);
+            return found ? found.year() : '';
+        } else {
+            return '';
+        }
+    }
+
     performCustomAction() {
 
         const vandelayOptions = {
+            match_set: this.selectedMatchSet,
             import_no_match: this.importNonMatching,
             auto_overlay_exact: this.mergeOnExact,
             auto_overlay_best_match: this.mergeOnBestMatch,
@@ -394,7 +406,7 @@ export class UploadComponent implements OnInit, AfterViewInit, OnDestroy {
             ordering_agency: this.orderingAgency,
             create_po: this.createPurchaseOrder,
             activate_po: this.activatePurchaseOrder,
-            fiscal_year: this.selectedFiscalYear,
+            fiscal_year: this._getFiscalYearLabel(),
             picklist: this.activeSelectionListId,
             vandelay: vandelayOptions
         };
@@ -504,6 +516,7 @@ export class UploadComponent implements OnInit, AfterViewInit, OnDestroy {
         const spoolType = this.recordType;
 
         const vandelayOptions = {
+            match_set: this.selectedMatchSet,
             import_no_match: this.importNonMatching,
             auto_overlay_exact: this.mergeOnExact,
             auto_overlay_best_match: this.mergeOnBestMatch,
@@ -521,7 +534,7 @@ export class UploadComponent implements OnInit, AfterViewInit, OnDestroy {
             ordering_agency: this.orderingAgency,
             create_po: this.createPurchaseOrder,
             activate_po: this.activatePurchaseOrder,
-            fiscal_year: this.selectedFiscalYear,
+            fiscal_year: this._getFiscalYearLabel(),
             picklist: this.activeSelectionListId,
             vandelay: vandelayOptions
         };