From: Galen Charlton Date: Tue, 14 Dec 2021 22:44:14 +0000 (-0500) Subject: LP#1942220: add LI search action to create PO from selected X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=62656fb5cbb7d22f6686c35513e4882672f78707;p=working%2FEvergreen.git LP#1942220: add LI search action to create PO from selected Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.html b/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.html index 93d4b336d6..8d6af1b0bf 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.html @@ -3,6 +3,9 @@ defaultSearchSetting="eg.acq.search.default.lineitems"> + + diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.ts index 9fcb40df8a..b0667f3cbd 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.ts @@ -12,6 +12,7 @@ import {AcqSearchService, AcqSearchTerm, AcqSearch} from './acq-search.service'; import {LineitemService} from '../lineitem/lineitem.service'; import {ExportAttributesDialogComponent} from '../lineitem/export-attributes-dialog.component'; import {AcqSearchFormComponent} from './acq-search-form.component'; +import {AlertDialogComponent} from '@eg/share/dialog/alert.component'; @Component({ selector: 'eg-lineitem-results', @@ -25,6 +26,7 @@ export class LineitemResultsComponent implements OnInit { @ViewChild('acqSearchForm', { static: true}) acqSearchForm: AcqSearchFormComponent; @ViewChild('acqSearchLineitemsGrid', { static: true }) lineitemResultsGrid: GridComponent; @ViewChild('exportAttributesDialog') exportAttributesDialog: ExportAttributesDialogComponent; + @ViewChild('noActionableLIs', { static: true }) private noActionableLIs: AlertDialogComponent; noSelectedRows: (rows: IdlObject[]) => boolean; @@ -79,6 +81,18 @@ export class LineitemResultsComponent implements OnInit { '/lineitem/' + row.id() + '/worksheet', '_blank'); } + createPurchaseOrder(rows: IdlObject[]) { + const lis = rows.filter(l => !l.purchase_order()); + if (lis.length === 0) { + this.noActionableLIs.open(); + return; + } + const ids = lis.map(x => Number(x.id())); + this.router.navigate(['/staff/acq/po/create'], { + queryParams: {li: ids} + }); + } + exportSingleAttributeList(rows: IdlObject[]) { const ids = rows.map(x => Number(x.id())); this.exportAttributesDialog.ids = ids;