86 lines
2.2 KiB
TypeScript
86 lines
2.2 KiB
TypeScript
/**
|
|
* Copyright since 2025 Mifos Initiative
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
/** Angular Imports */
|
|
import { Component, ViewChild, inject } from '@angular/core';
|
|
|
|
import { MatPaginator } from '@angular/material/paginator';
|
|
import {
|
|
MatTableDataSource,
|
|
MatTable,
|
|
MatColumnDef,
|
|
MatHeaderCellDef,
|
|
MatHeaderCell,
|
|
MatCellDef,
|
|
MatCell,
|
|
MatHeaderRowDef,
|
|
MatHeaderRow,
|
|
MatRowDef,
|
|
MatRow
|
|
} from '@angular/material/table';
|
|
|
|
import { ActivatedRoute } from '@angular/router';
|
|
import { DateFormatPipe } from '../../pipes/date-format.pipe';
|
|
import { YesnoPipe } from '../../pipes/yesno.pipe';
|
|
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
|
|
|
/**
|
|
* Recurring Deposits Standing Instructions Tab
|
|
*/
|
|
@Component({
|
|
selector: 'mifosx-list-transactions',
|
|
templateUrl: './list-transactions.component.html',
|
|
styleUrls: ['./list-transactions.component.scss'],
|
|
imports: [
|
|
...STANDALONE_SHARED_IMPORTS,
|
|
MatTable,
|
|
MatColumnDef,
|
|
MatHeaderCellDef,
|
|
MatHeaderCell,
|
|
MatCellDef,
|
|
MatCell,
|
|
MatHeaderRowDef,
|
|
MatHeaderRow,
|
|
MatRowDef,
|
|
MatRow,
|
|
MatPaginator,
|
|
DateFormatPipe,
|
|
YesnoPipe
|
|
]
|
|
})
|
|
export class ListTransactionsComponent {
|
|
private route = inject(ActivatedRoute);
|
|
|
|
/** List Transactions Data */
|
|
listTransactionData: any;
|
|
/** Data source for instructions table. */
|
|
dataSource = new MatTableDataSource();
|
|
/** Columns to be displayed in instructions table. */
|
|
displayedColumns: string[] = [
|
|
'transactionDate',
|
|
'amount',
|
|
'notes',
|
|
'reversed'
|
|
];
|
|
|
|
/** Paginator for centers table. */
|
|
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
|
|
|
/**
|
|
* Retrieves Recurring Deposits Account Data from `resolve`.
|
|
* @param {ActivatedRoute} route Activated Route.
|
|
*/
|
|
constructor() {
|
|
this.route.data.subscribe((data: { listTransactionData: any }) => {
|
|
this.listTransactionData = data.listTransactionData;
|
|
this.dataSource = new MatTableDataSource(this.listTransactionData.transactions.pageItems);
|
|
this.dataSource.paginator = this.paginator;
|
|
});
|
|
}
|
|
}
|