LP#1929749: receiving from LI search results now checks LI alerts
authorGalen Charlton <gmc@equinoxOLI.org>
Sat, 5 Feb 2022 22:51:48 +0000 (17:51 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Sat, 5 Feb 2022 22:51:48 +0000 (17:51 -0500)
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.html
Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.ts

index bf9cd85..334d357 100644 (file)
@@ -8,6 +8,7 @@
 <eg-acq-add-to-po-dialog #addToPoDialog></eg-acq-add-to-po-dialog>
 <eg-acq-delete-lineitems-dialog #deleteLineitemsDialog></eg-acq-delete-lineitems-dialog>
 <eg-acq-link-invoice-dialog #linkInvoiceDialog></eg-acq-link-invoice-dialog>
+<eg-lineitem-alert-dialog #confirmAlertsDialog></eg-lineitem-alert-dialog>
 
 <eg-string #claimPolicyAppliedString i18n-text text="Claim Policy Applied to Selected Line Item(s)"></eg-string>
 <eg-string #lineItemsReceivedString i18n-text text="Line Item(s) Received"></eg-string>
index c170e50..6a30b78 100644 (file)
@@ -21,6 +21,7 @@ import {CancelDialogComponent} from '../lineitem/cancel-dialog.component';
 import {AddToPoDialogComponent} from '../lineitem/add-to-po-dialog.component';
 import {DeleteLineitemsDialogComponent} from '../lineitem/delete-lineitems-dialog.component';
 import {LinkInvoiceDialogComponent} from '../lineitem/link-invoice-dialog.component';
+import {LineitemAlertDialogComponent} from '../lineitem/lineitem-alert-dialog.component';
 
 @Component({
   selector: 'eg-lineitem-results',
@@ -49,6 +50,7 @@ export class LineitemResultsComponent implements OnInit {
     @ViewChild('noActionableLIs', { static: true }) private noActionableLIs: AlertDialogComponent;
     @ViewChild('selectorReadyConfirmDialog', { static: true }) selectorReadyConfirmDialog: ConfirmDialogComponent;
     @ViewChild('orderReadyConfirmDialog', { static: true }) orderReadyConfirmDialog: ConfirmDialogComponent;
+    @ViewChild('confirmAlertsDialog') confirmAlertsDialog: LineitemAlertDialogComponent;
 
     noSelectedRows: (rows: IdlObject[]) => boolean;
 
@@ -355,15 +357,18 @@ export class LineitemResultsComponent implements OnInit {
         }
 
         const ids = lis.map(x => Number(x.id()));
-        this.net.request(
-            'open-ils.acq',
-            'open-ils.acq.lineitem.receive.batch',
-            this.auth.token(), ids
-        ).toPromise().then(resp => {
-            this.lineItemsReceivedString.current()
-            .then(str => this.toast.success(str));
-            this.lineitemResultsGrid.reload();
-        });
+
+        this.liService.checkLiAlerts(lis, this.confirmAlertsDialog).then(ok => {
+            this.net.request(
+                'open-ils.acq',
+                'open-ils.acq.lineitem.receive.batch',
+                this.auth.token(), ids
+            ).toPromise().then(resp => {
+                this.lineItemsReceivedString.current()
+                .then(str => this.toast.success(str));
+                this.lineitemResultsGrid.reload();
+            });
+        }, err => {}); // avoid console errors
     }
 
     markUnReceived(rows: IdlObject[]) {