Files
cbsnexora/src/app/investment/investment-dashboard/investment-dashboard.component.html
T

214 lines
8.3 KiB
HTML

<!--
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/.
-->
<div class="pg">
<header class="pg-head">
<div>
<div class="pg-eyebrow">TREASURY · INVESTMENT</div>
<h1 class="pg-title">Investment Portfolio Dashboard</h1>
<p class="pg-sub">
What the bank holds today across Govt Securities, FDs with banks, Non-SLR, Bonds, Mutual Funds and Shares, as on
{{ asOnDate }}.
</p>
</div>
<div class="pg-toolbar">
<button type="button" class="pg-btn pg-btn--ghost" [disabled]="loading" (click)="load()">
{{ loading ? 'Loading…' : 'Refresh' }}
</button>
<button type="button" class="pg-btn pg-btn--ghost" [disabled]="generating || loading" (click)="exportExcel()">
{{ generating ? 'Exporting…' : 'Export to Excel' }}
</button>
</div>
</header>
@if (error) {
<div class="pg-card">
<p class="inv-hint inv-hint--bad">{{ error }}</p>
</div>
}
<div class="inv-kpis">
<div class="inv-kpi">
<span class="inv-kpi__label">Holdings</span>
<span class="inv-kpi__value">{{ totalHoldings }}</span>
<span class="inv-kpi__sub"
>{{ maturingSoon.length }} due within 90 days{{ overdueCount ? ' (' + overdueCount + ' overdue)' : '' }}</span
>
</div>
<div class="inv-kpi">
<span class="inv-kpi__label">Total Invested (Book Value)</span>
<span class="inv-kpi__value">₹{{ totalBookValue | number: '1.2-2' }}</span>
<span class="inv-kpi__sub">Face value ₹{{ totalFaceValue | number: '1.2-2' }}</span>
</div>
<div class="inv-kpi">
<span class="inv-kpi__label">Interest Receivable</span>
<span class="inv-kpi__value col-in">₹{{ totalAccruedInterest | number: '1.2-2' }}</span>
<span class="inv-kpi__sub"
>Earned till today, not received · ₹{{ totalProvisioned | number: '1.2-2' }} provisioned</span
>
</div>
<div class="inv-kpi">
<span class="inv-kpi__label">Value at Maturity</span>
<span class="inv-kpi__value">₹{{ totalMaturityValue | number: '1.2-2' }}</span>
<span class="inv-kpi__sub">Securities at face value, FDs with interest</span>
</div>
</div>
<div class="pg-card">
<div class="pos-section-label">Instrument-wise Break-up</div>
<table class="pg-table">
<thead>
<tr>
<th>Instrument Type</th>
<th class="num">Holdings</th>
<th class="num">Face Value</th>
<th class="num">Book Value</th>
<th class="num">Share</th>
<th class="num col-in">Interest Receivable</th>
<th class="num col-net">Maturity Value</th>
<th></th>
</tr>
</thead>
<tbody>
@for (s of summaries; track s.type) {
<tr>
<td>{{ s.label }}</td>
<td class="num">{{ s.count }}</td>
<td class="num">₹{{ s.faceValue | number: '1.2-2' }}</td>
<td class="num">₹{{ s.bookValue | number: '1.2-2' }}</td>
<td class="num">{{ s.sharePct | number: '1.1-1' }}%</td>
<td class="num col-in">₹{{ s.accruedInterest | number: '1.2-2' }}</td>
<td class="num col-net">₹{{ s.maturityValue | number: '1.2-2' }}</td>
<td>
<a class="pg-btn pg-btn--ghost" [routerLink]="s.route">Open</a>
</td>
</tr>
}
</tbody>
<tfoot>
<tr class="cctr-total-row">
<td>Total</td>
<td class="num">{{ totalHoldings }}</td>
<td class="num">₹{{ totalFaceValue | number: '1.2-2' }}</td>
<td class="num">₹{{ totalBookValue | number: '1.2-2' }}</td>
<td class="num">{{ totalBookValue > 0 ? '100%' : '—' }}</td>
<td class="num">₹{{ totalAccruedInterest | number: '1.2-2' }}</td>
<td class="num">₹{{ totalMaturityValue | number: '1.2-2' }}</td>
<td></td>
</tr>
</tfoot>
</table>
</div>
<div class="pg-card">
<div class="pos-section-label">RBI Limits</div>
@if (limitNote) {
<p class="inv-hint inv-hint--bad">{{ limitNote }}</p>
}
@if (limits.length) {
<table class="pg-table">
<thead>
<tr>
<th>Limit</th>
<th>Basis</th>
<th class="num">Allowed</th>
<th class="num">Used</th>
<th class="num">Used %</th>
<th>Status</th>
</tr>
</thead>
<tbody>
@for (l of limits; track l.label) {
<tr>
<td>{{ l.label }}</td>
<td>{{ l.basis }}</td>
<td class="num">₹{{ l.limit | number: '1.2-2' }}</td>
<td class="num">₹{{ l.used | number: '1.2-2' }}</td>
<td class="num">{{ l.usedPct === null ? '—' : (l.usedPct | number: '1.1-1') + '%' }}</td>
<td>
<span class="inv-badge" [class.inv-badge--active]="l.within" [class.inv-badge--written_off]="!l.within">
{{ l.within ? 'Within' : 'Above limit' }}
</span>
</td>
</tr>
}
</tbody>
</table>
}
</div>
<div class="pg-card">
<div class="pos-section-label">Maturing Within 90 Days</div>
@if (maturingSoon.length === 0) {
<div class="pg-empty">No holdings maturing in the next 90 days.</div>
} @else {
<div>
@for (m of maturingSoon; track m.dealNo) {
<div class="inv-maturity-row">
<span>
<span class="pg-chip">{{ m.dealNo }}</span>
{{ m.particulars }} ({{ m.instrument }})
</span>
<span>
Matures {{ m.maturityDate }} · ₹{{ m.amount | number: '1.2-2' }} ·
<span
class="inv-maturity-days"
[class.inv-maturity-days--soon]="m.days <= 30"
[class.inv-maturity-days--ok]="m.days > 30"
>
{{ m.days < 0 ? 'Overdue ' + -m.days + ' days' : m.days + ' days' }}
</span>
</span>
</div>
}
</div>
<div class="inv-form-actions" style="padding: 8px 16px">
<a class="pg-btn pg-btn--ghost" routerLink="/investment/diary">Open Due Date Diary</a>
</div>
}
</div>
<div class="pg-card">
<div class="pos-section-label">Quick Entry</div>
<div class="inv-nav-grid" style="padding: 16px">
<a class="inv-nav-card" routerLink="/investment/fd">
<span class="inv-nav-card__label">Fixed Deposit</span>
<span class="inv-nav-card__count">{{ countOf('FD') }}</span>
<span class="inv-nav-card__value">Purchase / Interest / Maturity / Renewal</span>
</a>
<a class="inv-nav-card" routerLink="/investment/bonds">
<span class="inv-nav-card__label">Govt Security / Non-SLR / Bonds / MF</span>
<span class="inv-nav-card__count">{{ countOf('GOVT_SECURITY', 'NON_SLR', 'BOND', 'MUTUAL_FUND') }}</span>
<span class="inv-nav-card__value">Purchase / Interest / Sell / Amortize</span>
</a>
<a class="inv-nav-card" routerLink="/investment/share">
<span class="inv-nav-card__label">Share Entry</span>
<span class="inv-nav-card__count">{{ countOf('SHARE') }}</span>
<span class="inv-nav-card__value">Purchase / Dividend / Sell / Write-off</span>
</a>
<a class="inv-nav-card" routerLink="/investment/interest">
<span class="inv-nav-card__label">Interest</span>
<span class="inv-nav-card__count">5</span>
<span class="inv-nav-card__value">FD / Bond Calculation &amp; Registers</span>
</a>
<a class="inv-nav-card" routerLink="/investment/masters">
<span class="inv-nav-card__label">Masters</span>
<span class="inv-nav-card__count">10</span>
<span class="inv-nav-card__value">Script / Broker / Party / Control Params</span>
</a>
<a class="inv-nav-card" routerLink="/investment/reports">
<span class="inv-nav-card__label">Reports</span>
<span class="inv-nav-card__count">20+</span>
<span class="inv-nav-card__value">Balance / Ledger / Maturity / Portfolio</span>
</a>
</div>
</div>
</div>
<div class="inv-toast" [class.show]="toastVisible">{{ toastMsg }}</div>