(onClick)="markUnReceived($event)" [disableOnRows]="noSelectedRows">
</eg-grid-toolbar-action>
<eg-grid-toolbar-action label="Create Invoice from Selected Line Items" i18n-label
- (onClick)="createInvoice($event)" [disableOnRows]="noSelectedRows">
+ (onClick)="createInvoiceFromSelected($event)" [disableOnRows]="noSelectedRows">
</eg-grid-toolbar-action>
<eg-grid-toolbar-action label="Link Selected Line Items to Invoice" i18n-label
(onClick)="linkToInvoice($event)" [disableOnRows]="noSelectedRows">
});
}
+ createInvoiceFromSelected(rows: IdlObject[]) {
+ // must be attached to PO
+ const lis = rows.filter(l => l.purchase_order());
+ if (lis.length === 0) {
+ this.noActionableLIs.open();
+ return;
+ }
+ const path = '/eg/staff/acq/legacy/invoice/view?create=1&' +
+ lis.map(x => 'attach_li=' + x.id()).join('&');
+ window.location.href = path;
+ }
+
createPurchaseOrder(rows: IdlObject[]) {
// must not be already attached to a PO
const lis = rows.filter(l => !l.purchase_order());