[sortable]="true" persistKey="acq.funding_source.credit"
[filterable]="true" [stickyHeader]="true">
- <eg-grid-toolbar-button label="Apply Credits" i18n-label (onClick)="createCredit(creditsGrid)">
+ <eg-grid-toolbar-button label="Apply Credits" i18n-label
+ [disabled]="fundingSource?.active() !== 't'" (onClick)="createCredit(creditsGrid)">
</eg-grid-toolbar-button>
<eg-grid-column path="amount"></eg-grid-column>
<eg-grid-column path="effective_date" [datePlusTime]="true"></eg-grid-column>
[sortable]="true" persistKey="acq.funding_source.fund_allocation"
[filterable]="true" [stickyHeader]="true" [cellTextGenerator]="cellTextGenerator">
- <eg-grid-toolbar-button label="Allocate to Fund" i18n-label (onClick)="allocateToFund(allocationsGrid)">
+ <eg-grid-toolbar-button label="Allocate to Fund" i18n-label
+ [disabled]="fundingSource?.active() !== 't'" (onClick)="allocateToFund(allocationsGrid)">
</eg-grid-toolbar-button>
<ng-template #fundTmpl let-row="row">
<a href="/eg2/staff/admin/acq/funds/fund/{{row.fund().id()}}" target="_blank">
group="Selected" i18n-group [disableOnRows]="notOneSelectedRow">
</eg-grid-toolbar-action>
<eg-grid-toolbar-action label="Apply Credit" i18n-label (onClick)="createCredit($event)"
- group="Credits" i18n-group [disableOnRows]="notOneSelectedRow">
+ group="Credits" i18n-group [disableOnRows]="notOneSelectedActiveRow">
</eg-grid-toolbar-action>
<eg-grid-toolbar-action label="Allocate to Fund" i18n-label (onClick)="allocateToFund($event)"
- group="Allocations" i18n-group [disableOnRows]="notOneSelectedRow">
+ group="Allocations" i18n-group [disableOnRows]="notOneSelectedActiveRow">
</eg-grid-toolbar-action>
<eg-grid-toolbar-action label="View Credits" i18n-label (onClick)="openTransactionsDialog($event, 'credits')"
group="Credits" i18n-groups [disableOnRows]="notOneSelectedRow">
cellTextGenerator: GridCellTextGenerator;
notOneSelectedRow: (rows: IdlObject[]) => boolean;
+ notOneSelectedActiveRow: (rows: IdlObject[]) => boolean;
constructor(
route: ActivatedRoute,
name: row => row.name()
};
this.notOneSelectedRow = (rows: IdlObject[]) => (rows.length !== 1);
+ this.notOneSelectedActiveRow = (rows: IdlObject[]) => (rows.length !== 1 || rows[0].active() !== 't');
this.fieldOrder = 'name,code,year,org,active,currency_type,balance_stop_percentage,balance_warning_percentage,propagate,rollover';
this.defaultNewRecord = this.idl.create('acqfs');
+ this.defaultNewRecord.active(true);
this.defaultNewRecord.owner(this.auth.user().ws_ou());
this.dataSource.getRows = (pager: Pager, sort: any[]) => {