feat(npa): add Cash Credit (CC) Recovery Management tab

New tab under NPA > Reports > Recovery Management, dedicated to Cash
Credit accounts: Drawing Power vs outstanding, interest due/paid this
cycle, lifetime recovery, and a Days-Overdrawn/Status view (Regular /
Overdrawn / NPA) in place of the generic EMI-style SMA labels, matching
how a CC/OD book is actually monitored in real banks.

Status now checks NPA history first so an account doesn't show
"Regular" just because it's briefly back within DP (RBI upgrade norms
require full clearance, not a one-off snapshot).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 15:38:03 +05:30
co-authored by Claude Sonnet 5
parent 1b70fb4534
commit 1bf441114e
5 changed files with 460 additions and 2 deletions
+1
View File
@@ -967,6 +967,7 @@ export const REPORT_META: ReportMeta[] = [
{ id: 'probable', group: 'classification', label: 'Probable NPA' },
{ id: 'sma', group: 'classification', label: 'SMA Report' },
{ id: 'recovery-dashboard', group: 'recovery-mgmt', label: 'Recovery Management Dashboard' },
{ id: 'cc-recovery', group: 'recovery-mgmt', label: 'Cash Credit (CC) Recovery Management' },
{ id: 'daywise-overdue', group: 'recovery-mgmt', label: 'Day-wise Overdue Report' },
{ id: 'daywise-overdrawn', group: 'recovery-mgmt', label: 'Day-wise Overdrawn Report' },
{ id: 'agri-gold-value', group: 'recovery-mgmt', label: 'Agriculture / Gold Market Value Report' },
@@ -1400,6 +1400,184 @@
</div>
}
<!-- ===================== CASH CREDIT (CC) RECOVERY MANAGEMENT ===================== -->
@if (activeReport === 'cc-recovery') {
<div class="pg-card">
<div class="pos-section-label">
Cash Credit (CC) Recovery Management — Drawing Power &amp; Overdrawn-Day Tracking
</div>
<p class="pg-sub npa-report-note">
Cash Credit is a revolving working-capital facility secured against stock / receivables. Unlike a Term Loan, it
isn't checked against a fixed instalment — it is checked against its <strong>Drawing Power (DP)</strong>, and
tracked by how many continuous <strong>Days Overdrawn</strong> ("Out of Order") it has run — crossing 90 days
turns it <strong>NPA</strong>.
</p>
<div class="npa-glossary">
<div class="npa-glossary-card npa-glossary-card--dp">
<span class="npa-glossary-card__icon"><fa-icon icon="wallet"></fa-icon></span>
<div class="npa-glossary-card__term">Drawing Power (DP)</div>
<p class="npa-glossary-card__desc">
The maximum amount the borrower may actually draw against the sanctioned CC limit — fixed from the value of
stock / book-debts declared in the latest stock statement. Can be lower than the sanctioned limit.
</p>
</div>
<div class="npa-glossary-card npa-glossary-card--ooo">
<span class="npa-glossary-card__icon"><fa-icon icon="hourglass-half"></fa-icon></span>
<div class="npa-glossary-card__term">Out of Order</div>
<p class="npa-glossary-card__desc">
A CC account turns "Out of Order" once its outstanding continuously stays above the limit/DP, or adequate
credits stop coming in, for 90 days — the CC-specific overdue trigger, in place of a missed EMI.
</p>
</div>
<div class="npa-glossary-card npa-glossary-card--sma">
<span class="npa-glossary-card__icon"><fa-icon icon="flag"></fa-icon></span>
<div class="npa-glossary-card__term">Days Overdrawn</div>
<p class="npa-glossary-card__desc">
The running count of continuous days an account has stayed Out of Order — the number a recovery desk
actually watches day to day, instead of a classification label. A rising count is the early-warning sign.
</p>
</div>
<div class="npa-glossary-card npa-glossary-card--npa">
<span class="npa-glossary-card__icon"><fa-icon icon="ban"></fa-icon></span>
<div class="npa-glossary-card__term">NPA (Non-Performing Asset)</div>
<p class="npa-glossary-card__desc">
Once Out of Order crosses 90 days, the CC account slips to NPA — Sub-Standard, then Doubtful-1/2/3, then
Loss Asset as it ages further.
</p>
</div>
</div>
</div>
<div class="pg-card">
<div class="inv-kpis npa-kpis--ratio npa-kpis--compact">
<div class="inv-kpi npa-kpi--accent npa-kpi--accent--neutral">
<span class="npa-kpi__icon"><fa-icon icon="wallet"></fa-icon></span>
<span class="inv-kpi__label">Total CC Accounts</span>
<span class="inv-kpi__value">{{ ccAccounts.length }}</span>
<span class="inv-kpi__sub">₹{{ ccTotalSanctioned | number: '1.0-0' }} sanctioned</span>
</div>
<div class="inv-kpi npa-kpi--accent npa-kpi--accent--warn">
<span class="npa-kpi__icon"><fa-icon icon="hourglass-half"></fa-icon></span>
<span class="inv-kpi__label">Overdrawn (1–90 Days)</span>
<span class="inv-kpi__value" [class.npa-warn]="ccOverdrawnCount > 0">{{ ccOverdrawnCount }}</span>
<span class="inv-kpi__sub">Out of Order, not yet NPA</span>
</div>
<div class="inv-kpi npa-kpi--accent npa-kpi--accent--npa">
<span class="npa-kpi__icon"><fa-icon icon="ban"></fa-icon></span>
<span class="inv-kpi__label">NPA (90+ Days Overdrawn)</span>
<span class="inv-kpi__value npa-warn">{{ ccNpaCount }}</span>
<span class="inv-kpi__sub">₹{{ ccTotalOutstanding | number: '1.0-0' }} total outstanding</span>
</div>
<div class="inv-kpi npa-kpi--accent npa-kpi--accent--info">
<span class="npa-kpi__icon"><fa-icon icon="money-bill-wave"></fa-icon></span>
<span class="inv-kpi__label">Interest Paid (This Cycle)</span>
<span class="inv-kpi__value">₹{{ ccInterestPaidThisCycle | number: '1.0-0' }}</span>
<span class="inv-kpi__sub">of ₹{{ ccInterestDueThisCycle | number: '1.0-0' }} due</span>
</div>
<div class="inv-kpi npa-kpi--accent npa-kpi--accent--positive">
<span class="npa-kpi__icon"><fa-icon icon="hand-holding-usd"></fa-icon></span>
<span class="inv-kpi__label">Total Recovered</span>
<span class="inv-kpi__value">₹{{ ccTotalRecovered | number: '1.0-0' }}</span>
<span class="inv-kpi__sub"
>{{ ccRecoveryPct | number: '1.1-1' }}% of ₹{{ ccTotalSanctioned | number: '1.0-0' }} sanctioned</span
>
</div>
</div>
</div>
<div class="pg-card">
<div class="pos-section-label">
Cash Credit Accounts — Limit, DP &amp; Classification ({{ ccOutOfOrderCount }} of {{ ccAccounts.length }} Out of
Order)
</div>
<div class="pg-table-scroll">
<table class="pg-table">
<thead>
<tr>
<th>Account No</th>
<th>Customer</th>
<th>Branch</th>
<th class="num">Sanctioned Limit</th>
<th class="num">Drawing Power (DP)</th>
<th class="num">Outstanding</th>
<th class="num col-out">Pending to Recover</th>
<th class="num col-out">Excess Over DP</th>
<th class="num">Interest Due (This Cycle)</th>
<th class="num col-in">Interest Paid (This Cycle)</th>
<th class="num col-in">Total Recovered</th>
<th class="num">Days Overdrawn</th>
<th>Status</th>
<th>Recovery Officer</th>
</tr>
</thead>
<tbody>
@for (a of paged(ccAccounts); track a.accountNo) {
<tr>
<td>
<span class="pg-chip">{{ a.accountNo }}</span>
</td>
<td>{{ a.customerName }}</td>
<td>{{ a.branchName }}</td>
<td class="num">₹{{ a.sanctionedAmount | number: '1.0-0' }}</td>
<td class="num">₹{{ a.drawingPower | number: '1.0-0' }}</td>
<td class="num">₹{{ a.outstandingBalance | number: '1.0-0' }}</td>
<td class="num col-out">₹{{ a.overdueAmount | number: '1.0-0' }}</td>
<td class="num col-out">₹{{ excessOverDp(a) | number: '1.0-0' }}</td>
<td class="num">₹{{ expectedThisMonth(a) | number: '1.0-0' }}</td>
<td class="num" [class.col-in]="actualThisMonth(a) > 0" [class.col-out]="actualThisMonth(a) === 0">
₹{{ actualThisMonth(a) | number: '1.0-0' }}
</td>
<td class="num col-in">₹{{ recovered(a) | number: '1.0-0' }}</td>
<td class="num">{{ isNpaStageOf(a) || overdrawnBreachOf(a) ? a.overdueDays : 0 }}</td>
<td>
<span
class="npa-badge"
[class.npa-badge--standard]="!isNpaStageOf(a) && !overdrawnBreachOf(a)"
[class.npa-badge--sma1]="!isNpaStageOf(a) && overdrawnBreachOf(a)"
[class.npa-badge--substandard]="isNpaStageOf(a)"
>
{{ isNpaStageOf(a) ? 'NPA' : overdrawnBreachOf(a) ? 'Overdrawn' : 'Regular' }}
</span>
</td>
<td>{{ a.recoveryOfficer }}</td>
</tr>
} @empty {
<tr>
<td colspan="14" class="pg-empty">No Cash Credit accounts in this branch.</td>
</tr>
}
</tbody>
</table>
</div>
@if (ccAccounts.length > pageSize) {
<div class="pg-pagination">
<span class="pg-pagination__info"
>Showing {{ rangeStart(ccAccounts) }}–{{ rangeEnd(ccAccounts) }} of {{ ccAccounts.length }}</span
>
<div class="pg-pagination__controls">
<button
type="button"
class="pg-btn pg-btn--ghost"
[disabled]="currentPage === 1"
(click)="goToPage(currentPage - 1, ccAccounts)"
>
‹ Prev
</button>
<span class="pg-pagination__page">Page {{ currentPage }} of {{ pageCount(ccAccounts) }}</span>
<button
type="button"
class="pg-btn pg-btn--ghost"
[disabled]="currentPage === pageCount(ccAccounts)"
(click)="goToPage(currentPage + 1, ccAccounts)"
>
Next ›
</button>
</div>
</div>
}
</div>
}
<!-- ===================== 14 AGRICULTURE / GOLD MARKET VALUE REPORT ===================== -->
@if (activeReport === 'agri-gold-value') {
<div class="pg-card">
@@ -660,6 +660,69 @@ export class NpaReportsComponent implements OnInit, OnDestroy {
return this.overdrawnAccounts.filter((a) => this.overdrawnBreachOf(a)).length;
}
// -------------------- Cash Credit (CC) Recovery Management --------------------
/** Pure Cash Credit (MSME) accounts only — product code '01' — kept separate from the combined
* Overdrawn (CC/OD/KCC) bucket so CC's own Drawing Power / Out-of-Order / SMA-NPA position can
* be reviewed on its own, the way a recovery desk actually works a CC book. */
get ccAccounts(): LoanAccount[] {
return this.allAccounts
.filter((a) => a.productCode === '01')
.sort((a, b) => this.excessOverDp(b) - this.excessOverDp(a));
}
/** Any CC account that's irregular — either drawn beyond its Drawing Power right now, or already
* NPA-staged from its overdrawn history (an NPA account doesn't "go Regular" just because it's
* briefly back within DP — RBI upgrade norms require full clearance first). Covers the same
* population the 1–90-day Overdrawn and 90+-day NPA buckets below split in two. */
get ccOutOfOrderCount(): number {
return this.ccAccounts.filter((a) => this.overdrawnBreachOf(a) || this.isNpaStageOf(a)).length;
}
/** Out of Order for 1–90 continuous days — the pre-NPA monitoring window a recovery desk tracks
* by plain day-count, not by an SMA-0/1/2 label (that split only matters for regulatory
* reporting, not the day-to-day collection screen). */
get ccOverdrawnCount(): number {
return this.ccAccounts.filter((a) => this.overdrawnBreachOf(a) && !this.isNpaStageOf(a)).length;
}
/** Out of Order for more than 90 continuous days — the point RBI norms classify a CC/OD account
* as NPA. */
get ccNpaCount(): number {
return this.ccAccounts.filter((a) => this.isNpaStageOf(a)).length;
}
get ccTotalSanctioned(): number {
return this.ccAccounts.reduce((s, a) => s + a.sanctionedAmount, 0);
}
get ccTotalOutstanding(): number {
return this.ccAccounts.reduce((s, a) => s + a.outstandingBalance, 0);
}
/** A Cash Credit account has no fixed EMI — each cycle's "due" amount is interest servicing on
* the drawn balance, so this total doubles as "how much interest was CC customers due to pay
* this cycle". */
get ccInterestDueThisCycle(): number {
return this.ccAccounts.reduce((s, a) => s + this.expectedThisMonth(a), 0);
}
/** How much of that interest the CC book has actually paid this cycle — the answer to "which
* customers have paid how much interest", summed across the Cash Credit book. */
get ccInterestPaidThisCycle(): number {
return this.ccAccounts.reduce((s, a) => s + this.actualThisMonth(a), 0);
}
/** Lifetime cash recovered against the CC book (recorded recovery transactions — cash deposits,
* cheques, NEFT/RTGS, auction/SARFAESI, OTS) — the answer to "loan diya kitna, recover kitna
* hua", measured against what was actually sanctioned. */
get ccTotalRecovered(): number {
return this.ccAccounts.reduce((s, a) => s + this.recovered(a), 0);
}
get ccRecoveryPct(): number {
return this.ccTotalSanctioned ? (this.ccTotalRecovered / this.ccTotalSanctioned) * 100 : 0;
}
// -------------------- Agriculture / Gold Market Value Report --------------------
get agriGoldAccounts(): LoanAccount[] {
return this.allAccounts
@@ -1617,6 +1680,63 @@ export class NpaReportsComponent implements OnInit, OnDestroy {
}
];
case 'cc-recovery':
return [
{
sheetName: 'Cash Credit Recovery',
title: 'Cash Credit (CC) Recovery Management — Drawing Power & Overdrawn-Day Tracking',
subtitle,
headers: [
'Account No',
'Customer',
'Branch',
'Sanctioned Limit',
'Drawing Power',
'Outstanding',
'Pending to Recover',
'Excess Over DP',
'Interest Due (This Cycle)',
'Interest Paid (This Cycle)',
'Total Recovered',
'Days Overdrawn',
'Status',
'Recovery Officer'
],
widths: [
16,
22,
16,
16,
16,
16,
16,
16,
18,
18,
18,
14,
14,
20
],
rows: this.ccAccounts.map((a) => [
a.accountNo,
a.customerName,
a.branchName,
a.sanctionedAmount,
a.drawingPower,
a.outstandingBalance,
a.overdueAmount,
this.excessOverDp(a),
this.expectedThisMonth(a),
this.actualThisMonth(a),
this.recovered(a),
this.isNpaStageOf(a) || this.overdrawnBreachOf(a) ? a.overdueDays : 0,
this.isNpaStageOf(a) ? 'NPA' : this.overdrawnBreachOf(a) ? 'Overdrawn' : 'Regular',
a.recoveryOfficer
])
}
];
case 'daywise-overdrawn':
return [
{
+159
View File
@@ -94,6 +94,165 @@
grid-template-columns: repeat(3, 1fr);
}
// -----------------------------------------------------------------------
// Cash Credit Recovery Management — a glossary strip explaining DP / Out of
// Order / SMA / NPA to a reader meeting the terms for the first time (e.g. a
// stakeholder demo), plus tone-coloured accents for that screen's KPI row.
// -----------------------------------------------------------------------
.npa-glossary {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
gap: 14px;
margin-top: 18px;
}
.npa-glossary-card {
padding: 16px 16px 16px 18px;
border-radius: 12px;
background: #fff;
border: 1px solid #e2e8f0;
border-left: 4px solid #64748b;
transition: box-shadow 0.15s ease;
&:hover {
box-shadow: 0 4px 14px rgb(15 23 42 / 8%);
}
&__icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 34px;
height: 34px;
border-radius: 999px;
background: #f1f5f9;
color: #475569;
font-size: 14px;
margin-bottom: 10px;
}
&__term {
font-size: 12px;
font-weight: 800;
text-transform: uppercase;
letter-spacing: 0.05em;
color: #0f172a;
margin-bottom: 6px;
}
&__desc {
font-size: 12.5px;
line-height: 1.55;
color: #475569;
margin: 0;
}
&--dp {
border-left-color: #2563eb;
.npa-glossary-card__icon {
background: #dbeafe;
color: #2563eb;
}
}
&--ooo {
border-left-color: #d97706;
.npa-glossary-card__icon {
background: #fef3c7;
color: #b45309;
}
}
&--sma {
border-left-color: #ca8a04;
.npa-glossary-card__icon {
background: #fef9c3;
color: #854d0e;
}
}
&--npa {
border-left-color: #dc2626;
.npa-glossary-card__icon {
background: #fee2e2;
color: #dc2626;
}
}
}
// Compact gap variant for a KPI row that otherwise uses npa-kpis--ratio's 4-wide grid — used by
// the CC Recovery Management summary row, which packs more (smaller) tiles than the main header.
.npa-kpis--compact {
gap: 8px;
}
// Tone-coloured KPI tile for the CC summary row — same .inv-kpi tile, with a left accent + icon
// chip so "Out of Order"/"SMA"/"NPA" read as a severity strip rather than four identical boxes.
// Sized smaller than the default .inv-kpi tile since this row packs 6 of them.
.npa-kpi--accent {
padding: 10px 12px 10px 14px;
border-left: 4px solid var(--npa-kpi-accent, #64748b);
.inv-kpi__label {
font-size: 9px;
}
.inv-kpi__value {
font-size: 16px;
}
.inv-kpi__sub {
font-size: 10px;
}
.npa-kpi__icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
border-radius: 999px;
background: var(--npa-kpi-accent-soft, #f1f5f9);
color: var(--npa-kpi-accent, #475569);
font-size: 10px;
margin-bottom: 4px;
}
&--neutral {
--npa-kpi-accent: #0f4f3c;
--npa-kpi-accent-soft: #dcfce7;
}
&--warn {
--npa-kpi-accent: #d97706;
--npa-kpi-accent-soft: #fef3c7;
}
&--sma {
--npa-kpi-accent: #ca8a04;
--npa-kpi-accent-soft: #fef9c3;
}
&--npa {
--npa-kpi-accent: #dc2626;
--npa-kpi-accent-soft: #fee2e2;
}
&--info {
--npa-kpi-accent: #2563eb;
--npa-kpi-accent-soft: #dbeafe;
}
&--positive {
--npa-kpi-accent: #15803d;
--npa-kpi-accent-soft: #dcfce7;
}
}
// Account Detail header — title/badge on the left, the Recovery Journey trigger pinned right.
.npa-detail-header {
display: flex;
+2 -2
View File
@@ -9,8 +9,8 @@
/* tslint:disable */
export default {
'mifos_x': {
'version': '261012',
'hash': '6b0f218b'
'version': '261019',
'hash': '1b70fb453'
},
'allow_switching_backend_instance': true
};