2 <h4 i18n>Direct Charges, Taxes, Fees, etc.
3 <button class="btn btn-info btn-sm" (click)="newCharge()" *ngIf="canModify">New Charge</button>
6 <eg-acq-disencumber-charge-dialog #disencumberChargeDialog></eg-acq-disencumber-charge-dialog>
8 <ng-container *ngIf="showBody">
9 <div class="row d-flex">
10 <div class="flex-2 p-2 fw-bold">Charge Type</div>
11 <div class="flex-2 p-2 fw-bold">Fund</div>
12 <div class="flex-2 p-2 fw-bold">Title/Description</div>
13 <div class="flex-2 p-2 fw-bold">Author</div>
14 <div class="flex-2 p-2 fw-bold">Note</div>
15 <div class="flex-2 p-2 fw-bold">Estimated Cost</div>
16 <div class="flex-2 p-2"> </div>
18 <div class="row mt-2 pt-2 d-flex border-top form-validated"
19 *ngFor="let charge of po().po_items()">
20 <div class="flex-2 p-2">
21 <eg-combobox idlClass="aiit" [selectedId]="charge.inv_item_type()"
22 [asyncSupportsEmptyTermClick]="true"
23 (onChange)="charge.inv_item_type($event ? $event.id : null)"
24 i18n-placeholder placeholder="Charge Type..."
25 [required]="true" [readOnly]="!charge.isnew() && !charge.ischanged()"></eg-combobox>
27 <div class="flex-2 p-2">
28 <!-- the IDL does not require a fund, but the Perl code assumes
30 <eg-combobox idlClass="acqf" [selectedId]="charge.fund()"
31 (onChange)="charge.fund($event ? $event.id : null)"
32 i18n-placeholder placeholder="Fund..."
33 [asyncSupportsEmptyTermClick]="true"
34 [required]="true" [readOnly]="!charge.isnew() && !charge.ischanged()"
35 [idlQuerySort]="{acqf: 'year DESC, code'}"
36 [idlQueryAnd]="{org: owners, active: 't'}">
38 <span *ngIf="charge.fund_debit() && charge.fund_debit().fund() !== charge.fund()">
40 <i>Fund actually debited is
41 <eg-combobox idlClass="acqf" [selectedId]="charge.fund_debit().fund()"
42 [readOnly]="true"></eg-combobox></i>
45 <div class="flex-2 p-2">
46 <span *ngIf="!charge.isnew() && !charge.ischanged()">{{charge.title()}}</span>
47 <input *ngIf="charge.isnew() || charge.ischanged()" type="text" class="form-control"
48 i18n-placeholder placeholder="Title..."
49 [ngModel]="charge.title()" (ngModelChange)="charge.title($event)"/>
51 <div class="flex-2 p-2">
52 <span *ngIf="!charge.isnew() && !charge.ischanged()">{{charge.author()}}</span>
53 <input *ngIf="charge.isnew() || charge.ischanged()" type="text" class="form-control"
54 i18n-placeholder placeholder="Author..."
55 [ngModel]="charge.author()" (ngModelChange)="charge.author($event)"/>
57 <div class="flex-2 p-2">
58 <span *ngIf="!charge.isnew() && !charge.ischanged()">{{charge.note()}}</span>
59 <input *ngIf="charge.isnew() || charge.ischanged()" type="text" class="form-control"
60 i18n-placeholder placeholder="Note..."
61 [ngModel]="charge.note()" (ngModelChange)="charge.note($event)"/>
63 <div class="flex-2 p-2">
64 <span *ngIf="!charge.isnew() && !charge.ischanged()">{{charge.estimated_cost() | currency}}</span>
65 <input *ngIf="charge.isnew() || charge.ischanged()" type="number" min="0" class="form-control"
66 i18n-placeholder placeholder="Estimated Cost..." [required]="true"
67 [ngModel]="charge.estimated_cost()" (ngModelChange)="charge.estimated_cost($event)"/>
68 <span *ngIf="charge.fund_debit()">
70 <span *ngIf="charge.fund_debit().encumbrance() === 't'" i18n>
71 <i>Amount encumbered is {{charge.fund_debit().amount() | currency}}</i>
73 <span *ngIf="charge.fund_debit().encumbrance() === 'f'" i18n>
74 <i>Amount expended is {{charge.fund_debit().amount() | currency}}</i>
78 <div class="flex-2 p-1">
79 <button *ngIf="canModify" [disabled]="!(charge.isnew() || charge.ischanged())" class="btn btn-success btn-sm"
80 (click)="saveCharge(charge)" i18n>Save</button>
81 <button *ngIf="canModify" [disabled]="charge.isnew()" class="btn btn-outline-dark btn-sm ms-1"
82 (click)="charge.ischanged(true)" i18n>Edit</button>
83 <button class="btn btn-warning btn-sm ms-1"
84 (click)="disencumberCharge(charge)" *ngIf="canDisencumber(charge)" i18n>Disencumber</button>
85 <button class="btn btn-danger btn-sm ms-1"
86 (click)="removeCharge(charge)" *ngIf="canDelete(charge)" i18n>Remove</button>