feat: KYC document update, FIU & AML recurring alerts integration, Sponsor DD revoke workflow, and TDS reports
This commit is contained in:
@@ -15,7 +15,8 @@ import * as ExcelJS from 'exceljs';
|
||||
import { BranchScopeService } from '../core/branch-scope.service';
|
||||
import { GL_BRANCHES, glBranchName } from '../gl-reports/gl-reports-data';
|
||||
import { FY_TAX_CONFIG, Quarter, QUARTER_LABEL } from '../letter-mgmt/certificates/form-15gh/tds-15gh.compute';
|
||||
import { TDS_FYS } from './tds-reports-data';
|
||||
import { setTdsDeductees, TDS_FYS } from './tds-reports-data';
|
||||
import { TdsReportsService } from './tds-reports.service';
|
||||
import {
|
||||
NEAR_THRESHOLD_BAND,
|
||||
TdsInterestRow,
|
||||
@@ -37,6 +38,7 @@ import {
|
||||
})
|
||||
export class TdsInterestReportComponent implements OnInit {
|
||||
private scope = inject(BranchScopeService);
|
||||
private tdsService = inject(TdsReportsService);
|
||||
|
||||
readonly branches = GL_BRANCHES.filter((b) => b.code !== 'HO');
|
||||
readonly financialYears = TDS_FYS;
|
||||
@@ -87,12 +89,54 @@ export class TdsInterestReportComponent implements OnInit {
|
||||
private summaryCacheKey = '';
|
||||
private cachedSummary: TdsInterestSummary | null = null;
|
||||
|
||||
loading = false;
|
||||
loadError = '';
|
||||
|
||||
ngOnInit(): void {
|
||||
// A branch login sees only its own book and cannot widen the scope.
|
||||
const own = this.scope.ownBranchCode;
|
||||
if (own) {
|
||||
this.filter.branchCode = own;
|
||||
}
|
||||
this.loadDeductees();
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the interest the bank actually credited for the selected year.
|
||||
*
|
||||
* Everything below computes on whatever `setTdsDeductees` holds, so the load is the only place
|
||||
* that knows where the figures come from.
|
||||
*/
|
||||
loadDeductees(): void {
|
||||
this.loading = true;
|
||||
this.loadError = '';
|
||||
// 'FY 2026-27' → 2026, the opening calendar year the platform filters on.
|
||||
const openingYear = Number((this.filter.fy.match(/(\d{4})/) || [])[1]) || undefined;
|
||||
this.tdsService.getDepositInterest(openingYear).subscribe({
|
||||
next: (deductees) => {
|
||||
this.loading = false;
|
||||
setTdsDeductees(deductees);
|
||||
this.summaryCacheKey = '';
|
||||
this.cachedSummary = null;
|
||||
},
|
||||
error: (err: any) => {
|
||||
this.loading = false;
|
||||
setTdsDeductees([]);
|
||||
this.summaryCacheKey = '';
|
||||
this.cachedSummary = null;
|
||||
this.loadError =
|
||||
err?.error?.defaultUserMessage || 'Could not load deposit interest. The figures below cannot be shown.';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* A different year needs a different set of interest credits, so the year re-reads from the
|
||||
* platform rather than re-filtering the set already in hand.
|
||||
*/
|
||||
onYearChanged(): void {
|
||||
this.onFilterChanged();
|
||||
this.loadDeductees();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user