LP1929741 Batch of PO fixes
authorBill Erickson <berickxx@gmail.com>
Tue, 22 Jun 2021 15:43:05 +0000 (11:43 -0400)
committerJane Sandberg <js7389@princeton.edu>
Sun, 2 Oct 2022 15:02:49 +0000 (08:02 -0700)
* Avoid clearing the owning library during batch edit copy operations
* Leverage combobox startsWith for distribution formulas
* Disable the order ident selector so it cannot be modified after a PO
  is activated
* Add some icons to the PO actions for more eye-grabbiness.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Open-ILS/src/eg2/src/app/staff/acq/lineitem/batch-copies.component.ts
Open-ILS/src/eg2/src/app/staff/acq/lineitem/copies.component.html
Open-ILS/src/eg2/src/app/staff/acq/lineitem/lineitem-list.component.html
Open-ILS/src/eg2/src/app/staff/acq/lineitem/lineitem-list.component.ts
Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.html

index 6c70aa3..5adb6e3 100644 (file)
@@ -49,7 +49,7 @@ export class LineitemBatchCopiesComponent implements OnInit {
     batchApplyAttrs(copyTemplate: IdlObject) {
         BATCH_FIELDS.forEach(field => {
             const val = copyTemplate[field]();
-            if (val === undefined) { return; }
+            if (val === undefined || val === null) { return; }
             this.lineitem.lineitem_details().forEach(copy => {
                 copy[field](val);
                 copy.ischanged(true); // isnew() takes precedence
index 3335cb4..a29b178 100644 (file)
@@ -15,7 +15,7 @@
     <label class="ml-3" for='distrib-formula-cbox' i18n>Distribution Formulas</label>
     <span class="ml-3">
       <eg-combobox idlClass="acqdf" [idlQueryAnd]="formulaFilter" 
-        [asyncSupportsEmptyTermClick]="true"
+        [asyncSupportsEmptyTermClick]="true" [startsWith]="true"
         #distribFormCbox domId="distrib-formula-cbox">
       </eg-combobox>
     </span>
index 7f027f7..c471ade 100644 (file)
                 </span>
                 <div ngbDropdown>
                   <button class="btn btn-outline-dark btn-sm" ngbDropdownToggle 
-                    title="Order Identifier Type" i18n-title
+                    title="Order Identifier Type" i18n-title [disabled]="!canEditIdent(li)"
                     [ngClass]="{'btn-warning': !selectedIdent(li)}">
                     <ng-container *ngIf="orderIdentTypes[li.id()]=='isbn'" i18n>ISBN</ng-container>
                     <ng-container *ngIf="orderIdentTypes[li.id()]=='upc'" i18n>UPC</ng-container>
               </div>
               <eg-combobox [entries]="identOptions(li)" [smallFormControl]="true"
                 placeholder="Order Identifer..." i18n-placeholder
+                [disabled]="!canEditIdent(li)"
                 [allowFreeText]="true" [selectedId]="selectedIdent(li)"
                 (onChange)="orderIdentChanged(li, $event)">
               </eg-combobox>
index ce90fe9..941bc9f 100644 (file)
@@ -322,6 +322,10 @@ export class LineitemListComponent implements OnInit {
         ).subscribe(freshLi => this.ingestOneLi(freshLi, true));
     }
 
+    canEditIdent(li: IdlObject): boolean {
+        return DELETABLE_STATES.includes(li.state());
+    }
+
     addBriefRecord() {
     }
 
index 95bd00e..e89d43e 100644 (file)
   <hr class="p-0 m-0 mt-1"/>
   <div class="row mt-1">
     <div class="col-lg-12">
-      <a class="" href="javascript:;" (click)="showNotes=!showNotes" 
-        i18n>Notes ({{po().notes().length}})</a>
+      <a class="" href="javascript:;" class="label-with-material-icon"
+        (click)="showNotes=!showNotes">
+        <span class="material-icons small mr-1">event_note</span>
+        <span>Notes ({{po().notes().length}})</span>
+      </a>
       <span class="pl-2 pr-2" i18n> | </span>
-      <a [queryParams]="{f: 'acqpo:id', val1: poId}"
-        routerLink="/staff/acq/search/invoices" i18n>Invoices ({{invoiceCount}})</a>
+      <a [queryParams]="{f: 'acqpo:id', val1: poId}" class="label-with-material-icon"
+        routerLink="/staff/acq/search/invoices">
+          <span class="material-icons small mr-1">list</span>
+          <span i18n>Invoices ({{invoiceCount}})</span>
+      </a>
       <span class="pl-2 pr-2" i18n> | </span>
       <a href="/eg/staff/acq/legacy/invoice/view?create=1&attach_po={{poId}}"
-        i18n>Create Invoice</a>
+        class="label-with-material-icon">
+        <span class="material-icons small mr-1">receipt</span>
+        <span i18n>Create Invoice</span>
+      </a>
       <span class="pl-2 pr-2" i18n> | </span>
       <a routerLink="./edi" i18n>EDI Messages ({{ediMessageCount}})</a>
       <span class="pl-2 pr-2" i18n> | </span>
       <a routerLink="./history" i18n>History</a>
       <span class="pl-2 pr-2" i18n> | </span>
-      <a routerLink="./printer" i18n>Print</a>
+      <a routerLink="./printer" class="label-with-material-icon">
+        <span class="material-icons small mr-1">print</span>
+        <span i18n>Print</span>
+      </a>
       <ng-container *ngIf="po().state() == 'on-order' || po().state() == 'pending'">
         <span class="pl-2 pr-2" i18n> | </span>
-        <a (click)="cancelPo()" href="javascript:;" i18n>Cancel Order</a>
+        <a (click)="cancelPo()" href="javascript:;" class="label-with-material-icon">
+          <span class="material-icons small mr-1">cancel</span>
+          <span i18n>Cancel Order</span>
+        </a>
       </ng-container>
       <ng-container *ngIf="canActivate === true">
         <span class="pl-2 pr-2" i18n> | </span>
-        <a (click)="activatePo()" href="javascript:;" i18n>Activate Order</a>
+        <a (click)="activatePo(true)" href="javascript:;" i18n>
+          Activate Without Loading Items
+        </a>
       </ng-container>
       <ng-container *ngIf="canActivate === true">
         <span class="pl-2 pr-2" i18n> | </span>
-        <a (click)="activatePo(true)" href="javascript:;" i18n>
-          Activate Without Loading Items
+        <a (click)="activatePo()" href="javascript:;" class="label-with-material-icon">
+          <span class="material-icons small mr-1">launch</span>
+          <span i18n>Activate Order</span>
         </a>
       </ng-container>
     </div>