fund: IdlObject;
idlDef: any;
fieldOrder: any;
- acqfaDataSource: GridDataSource
- acqftrDataSource: GridDataSource
- acqfdebDataSource: GridDataSource
+ acqfaDataSource: GridDataSource;
+ acqftrDataSource: GridDataSource;
+ acqfdebDataSource: GridDataSource;
@ViewChild('editDialog', { static: true }) editDialog: FmRecordEditorComponent;
@ViewChild('transferDialog', { static: false }) transferDialog: FundTransferDialogComponent;
activeTab = 'summary';
defaultTabType = 'summary';
cellTextGenerator: GridCellTextGenerator;
-
+
constructor(
private idl: IdlService,
private evt: EventService,
) {
super(modal);
}
-
+
ngOnInit() {
this.defaultTabType =
this.fund = null;
this.onOpen$.subscribe(() => this._initRecord());
- this.idlDef = this.idl.classes['acqf']
+ this.idlDef = this.idl.classes['acqf'];
this.fieldOrder = 'name,code,year,org,active,currency_type,balance_stop_percentage,balance_warning_percentage,propagate,rollover';
this.cellTextGenerator = {
if (idlClass === 'acqfa') {
search.push({ fund: this.fundId });
} else if (idlClass === 'acqftr') {
- search.push({
+ search.push({
'-or': [
{ src_fund: this.fundId },
{ dest_fund: this.fundId }
searchOps['flesh_fields'] = {
'acqftr': ['funding_source_credit'],
'acqfscred': ['funding_source']
- }
+ };
} else if (idlClass === 'acqfdeb') {
search.push({ fund: this.fundId });
searchOps['flesh'] = 2;
searchOps['flesh_fields'] = {
'acqfdeb': ['invoice_entry'],
- 'acqie': ['invoice','purchase_order','lineitem']
- }
+ 'acqie': ['invoice', 'purchase_order', 'lineitem']
+ };
}
Object.keys(gridSource.filters).forEach(key => {
if (row.invoice_entry().lineitem()) {
row['li_id'] = row.invoice_entry().lineitem().id();
}
- }
+ }
}
return of(row);
}
}
openEditDialog() {
- this.editDialog.recordId = this.fundId
+ this.editDialog.recordId = this.fundId;
this.editDialog.mode = 'update';
this.editDialog.open({size: 'lg'}).subscribe(
result => {
this.transferDialog.sourceFund = this.fund;
this.transferDialog.open().subscribe(
ok => this._initRecord()
- )
+ );
}
setDefaultTab() {
export class FundRolloverDialogComponent
extends DialogComponent implements OnInit {
- doneLoading: boolean = false;
+ doneLoading = false;
@Input() contextOrgId: number;
@ViewChild('rolloverProgress', { static: true })
private rolloverProgress: ProgressInlineComponent;
- includeDescendants: boolean = false;
- propagateFunds: boolean = false;
- doCloseout: boolean = false;
- limitToEncumbrances: boolean = false;
- dryRun: boolean = true;
+ includeDescendants = false;
+ propagateFunds = false;
+ doCloseout = false;
+ limitToEncumbrances = false;
+ dryRun = true;
contextOrg: IdlObject;
- isProcessing: boolean = false;
- showResults: boolean = false;
+ isProcessing = false;
+ showResults = false;
years: ComboboxEntry[];
year: number;
) {
super(modal);
}
-
+
ngOnInit() {
this.onOpen$.subscribe(() => this._initDialog());
this.doneLoading = true;
});
this.year = maxYear;
}
- )
+ );
}
rollover() {
// note that we're intentionally not closing the dialog
// so that user can view the results
}
- )
+ );
}
}
tagMaps: IdlObject[];
newTag: ComboboxEntry = null;
- tagSelectorDataSource: (term: string) => Observable<ComboboxEntry>
+ tagSelectorDataSource: (term: string) => Observable<ComboboxEntry>;
constructor(
private idl: IdlService,
const args = {};
const extra_args = { order_by : {} };
args[field] = {'ilike': `%${term}%`}; // could -or search on label
- args['owner'] = this.org.ancestors(this.fundOwner, true)
+ args['owner'] = this.org.ancestors(this.fundOwner, true);
extra_args['order_by']['acqft'] = field;
extra_args['limit'] = 100;
extra_args['flesh'] = 2;
res => this.tagMaps.push(res),
err => {},
() => this.tagMaps.sort((a, b) => {
- return a.tag().name() < b.tag().name() ? -1 : 1
+ return a.tag().name() < b.tag().name() ? -1 : 1;
})
);
}
.then(str => this.toast.danger(str));
},
() => this._loadTagMaps()
- )
+ );
}
}
extends DialogComponent implements OnInit {
@Input() sourceFund: IdlObject;
- doneLoading: boolean = false;
+ doneLoading = false;
@ViewChild('successString', { static: true }) successString: StringComponent;
@ViewChild('updateFailedString', { static: false }) updateFailedString: StringComponent;
fundDataSource: (term: string) => Observable<ComboboxEntry>;
destFund: ComboboxEntry = null;
- sourceAmount: number = 0.0;
+ sourceAmount = 0.0;
note = null;
-
+
constructor(
private idl: IdlService,
private evt: EventService,
) {
super(modal);
}
-
+
ngOnInit() {
this.destFund = null;
this.onOpen$.subscribe(() => this._initRecord());
.then(str => this.toast.danger(str));
this.close(false);
}
- )
+ );
}
}
fundingSource: IdlObject;
idlDef: any;
fieldOrder: any;
- acqfaDataSource: GridDataSource
- acqfscredDataSource: GridDataSource
+ acqfaDataSource: GridDataSource;
+ acqfscredDataSource: GridDataSource;
cellTextGenerator: GridCellTextGenerator;
@ViewChild('applyCreditDialog', { static: true }) applyCreditDialog: FmRecordEditorComponent;
@ViewChild('allocateToFundDialog', { static: true }) allocateToFundDialog: FmRecordEditorComponent;
@ViewChild('successString', { static: true }) successString: StringComponent;
@ViewChild('updateFailedString', { static: false }) updateFailedString: StringComponent;
-
+
constructor(
private idl: IdlService,
private evt: EventService,
) {
super(modal);
}
-
+
ngOnInit() {
this.cellTextGenerator = {
fund: row => {
};
this.fundingSource = null;
this.onOpen$.subscribe(() => this._initRecord());
- this.idlDef = this.idl.classes['acqfs']
+ this.idlDef = this.idl.classes['acqfs'];
this.fieldOrder = 'name,code,year,org,active,currency_type,balance_stop_percentage,balance_warning_percentage,propagate,rollover';
}
@Input() startId: number;
@ViewChild('grid', { static: true }) grid: GridComponent;
- @ViewChild('fundingSourceTransactionsDialog', { static: false }) fundingSourceTransactionsDialog: FundingSourceTransactionsDialogComponent;
+ @ViewChild('fundingSourceTransactionsDialog', { static: false })
+ fundingSourceTransactionsDialog: FundingSourceTransactionsDialogComponent;
@ViewChild('applyCreditDialog', { static: true }) applyCreditDialog: FmRecordEditorComponent;
@ViewChild('allocateToFundDialog', { static: true }) allocateToFundDialog: FmRecordEditorComponent;
@ViewChild('alertDialog', {static: false}) private alertDialog: AlertDialogComponent;
order_by: orderBy,
flesh: 1,
flesh_fields: {
- acqfs: ['credits','allocations']
+ acqfs: ['credits', 'allocations']
}
};
const reqOps = {
deleteSelected(rows: IdlObject[]) {
if (rows.length > 0) {
const id = rows[0].id();
- let can: boolean = true;
+ let can = true;
forkJoin([
this.pcrud.search('acqfa', { funding_source: id }, { limit: 1 }, { atomic: true }),
this.pcrud.search('acqfscred', { funding_source: id }, { limit: 1 }, { atomic: true }),
@ViewChild('grid', { static: true }) grid: GridComponent;
cellTextGenerator: GridCellTextGenerator;
- canRollover: boolean = false;
+ canRollover = false;
constructor(
route: ActivatedRoute,
const tab = params.get('tab');
const id = +params.get('id');
if (!id || !tab) { return; }
- if (tab === 'fund' || tab === 'funding_source') {
+ if (tab === 'fund' || tab === 'funding_source') {
this.activeTab = tab;
if (tab === 'fund') {
this.fundId = id;