/** * 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 { FormsModule } from '@angular/forms'; import { MatIconModule } from '@angular/material/icon'; import { CashierService } from '../cashier.service'; /** Cash transactions whose denomination total is at/above a threshold (default ₹50,000 — CTR). */ @Component({ selector: 'mifosx-excess-transaction-report', templateUrl: './excess-transaction-report.component.html', styleUrls: ['../cashier-shared.scss'], standalone: true, imports: [ CommonModule, FormsModule, MatIconModule ] }) export class ExcessTransactionReportComponent implements OnInit { private service = inject(CashierService); threshold = 50000; fromDate = ''; toDate = ''; rows: any[] = []; loading = false; loaded = false; ngOnInit(): void { this.load(); } load(): void { this.loading = true; this.service .excessTransactionReport(this.threshold, this.fromDate || undefined, this.toDate || undefined) .subscribe({ next: (list) => { this.rows = list || []; this.loading = false; this.loaded = true; }, error: () => { this.rows = []; this.loading = false; this.loaded = true; } }); } }