LP1999544 Also fixes fund dropdown in PO charges
authorTiffany Little <tlittle@georgialibraries.org>
Fri, 16 Dec 2022 20:55:21 +0000 (15:55 -0500)
committerJason Stephenson <jason@sigio.com>
Tue, 14 Feb 2023 15:24:16 +0000 (10:24 -0500)
Signed-off-by: Tiffany Little <tlittle@georgialibraries.org>
Signed-off-by: John Amundson <jamundson@cwmars.org>
Signed-off-by: Jason Stephenson <jason@sigio.com>

Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.html
Open-ILS/src/eg2/src/app/staff/acq/po/charges.component.ts

index 9ecff20..ad84b16 100644 (file)
@@ -33,7 +33,7 @@
         [asyncSupportsEmptyTermClick]="true"
         [required]="true" [readOnly]="!charge.isnew() && !charge.ischanged()"
         [idlQuerySort]="{acqf: 'year DESC, code'}"
-        [idlQueryAnd]="{active: 't'}">
+        [idlQueryAnd]="{org: owners, active: 't'}">
       </eg-combobox>
       <span *ngIf="charge.fund_debit() && charge.fund_debit().fund() !== charge.fund()">
         <br>
@@ -63,7 +63,7 @@
     <div class="flex-2 p-2">
       <span *ngIf="!charge.isnew() && !charge.ischanged()">{{charge.estimated_cost() | currency}}</span>
       <input *ngIf="charge.isnew() || charge.ischanged()" type="number" min="0" class="form-control" 
-        i18n-placeholder placeholder="Esimated Cost..." [required]="true"
+        i18n-placeholder placeholder="Estimated Cost..." [required]="true"
         [ngModel]="charge.estimated_cost()" (ngModelChange)="charge.estimated_cost($event)"/>
       <span *ngIf="charge.fund_debit()">
         <br>
index d38f54b..25fc636 100644 (file)
@@ -2,6 +2,7 @@ import {Component, OnInit, OnDestroy, Input, ViewChild} from '@angular/core';
 import {Subscription} from 'rxjs';
 import {Router, ActivatedRoute, ParamMap} from '@angular/router';
 import {IdlService, IdlObject} from '@eg/core/idl.service';
+import {OrgService} from '@eg/core/org.service';
 import {AuthService} from '@eg/core/auth.service';
 import {NetService} from '@eg/core/net.service';
 import {EventService} from '@eg/core/event.service';
@@ -20,6 +21,7 @@ export class PoChargesComponent implements OnInit, OnDestroy {
     canModify = false;
     autoId = -1;
     poSubscription: Subscription;
+    owners: number[];
 
     @ViewChild('disencumberChargeDialog') disencumberChargeDialog: DisencumberChargeDialogComponent;
 
@@ -29,6 +31,7 @@ export class PoChargesComponent implements OnInit, OnDestroy {
         private evt: EventService,
         private auth: AuthService,
         private pcrud: PcrudService,
+        private org: OrgService,
         public  poService: PoService
     ) {}
 
@@ -44,6 +47,8 @@ export class PoChargesComponent implements OnInit, OnDestroy {
             this.showBody = this.po().po_items().length > 0;
             this.canModify = this.po().order_date() ? false : true;
         });
+
+        this.owners = this.org.ancestors(this.auth.user().ws_ou(), true);
     }
 
     ngOnDestroy() {