]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/eg2/src/app/staff/acq/lineitem/order-summary.component.ts
LP1929741 ACQ Selection List & PO Angluar Port
[Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / acq / lineitem / order-summary.component.ts
1 import {Component, OnInit, Input, Output} from '@angular/core';
2 import {IdlObject} from '@eg/core/idl.service';
3
4 @Component({
5   templateUrl: 'order-summary.component.html',
6   selector: 'eg-lineitem-order-summary'
7 })
8 export class LineitemOrderSummaryComponent {
9     @Input() li: IdlObject;
10
11     // True if at least one item has been invoiced and all items are either
12     // invoiced or canceled.
13     paidOff(): boolean {
14         const sum = this.li.order_summary();
15         return (
16             sum.invoice_count() > 0 && (
17                 sum.item_count() === (sum.invoice_count() + sum.cancel_count())
18             )
19         );
20     }
21 }
22