- Add Transaction Entry screen with full account details panel (personal info, joint holders, nominees, KYC, balances) - Role-based layout: CASHIER role hides nav/sidebar/ticker, redirects to /cashier/transaction-entry on login - Denomination entry with opening/closing position preview (notes first then coins, stepper +/- round button inputs) - Auto-fetch savings/current/FD/RD accounts with associations, client KYC, nominees, addresses, family members (S/D/W/H/O) - Submit deposit/withdrawal via POST /transactions with denominationBreakdown - Cashier position auto-loads for CASHIER role (no filter dropdowns) - Pagination added to cash-history tabs and currency-exchange-detail - Cashier menu simplified for cashier role permissions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
70 lines
1.8 KiB
TypeScript
70 lines
1.8 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/.
|
|
*/
|
|
|
|
import { Component, OnInit, inject } from '@angular/core';
|
|
import { CommonModule } from '@angular/common';
|
|
import { RouterLink } from '@angular/router';
|
|
import { MatIconModule } from '@angular/material/icon';
|
|
import { MatPaginatorModule, PageEvent } from '@angular/material/paginator';
|
|
import { CashierService } from '../cashier.service';
|
|
|
|
/** Lists recorded cash exchanges (Currency Exchange Detail). */
|
|
@Component({
|
|
selector: 'mifosx-currency-exchange-detail',
|
|
templateUrl: './currency-exchange-detail.component.html',
|
|
styleUrls: ['../cashier-shared.scss'],
|
|
standalone: true,
|
|
imports: [
|
|
CommonModule,
|
|
RouterLink,
|
|
MatIconModule,
|
|
MatPaginatorModule
|
|
]
|
|
})
|
|
export class CurrencyExchangeDetailComponent implements OnInit {
|
|
private service = inject(CashierService);
|
|
|
|
exchanges: any[] = [];
|
|
totalRecords = 0;
|
|
pageSize = 20;
|
|
pageIndex = 0;
|
|
pageSizeOptions = [
|
|
10,
|
|
20,
|
|
50,
|
|
100
|
|
];
|
|
loading = true;
|
|
|
|
ngOnInit(): void {
|
|
this.load();
|
|
}
|
|
|
|
load(): void {
|
|
this.loading = true;
|
|
this.service.getCashExchanges(this.pageIndex * this.pageSize, this.pageSize).subscribe({
|
|
next: (res: any) => {
|
|
this.exchanges = res.pageItems ?? [];
|
|
this.totalRecords = res.totalFilteredRecords ?? 0;
|
|
this.loading = false;
|
|
},
|
|
error: () => {
|
|
this.exchanges = [];
|
|
this.totalRecords = 0;
|
|
this.loading = false;
|
|
}
|
|
});
|
|
}
|
|
|
|
onPageChange(event: PageEvent): void {
|
|
this.pageIndex = event.pageIndex;
|
|
this.pageSize = event.pageSize;
|
|
this.load();
|
|
}
|
|
}
|