Files
cbsnexora/src/app/cfcfrms/i4c/i4c-holds/i4c-holds.component.html
T
niteshandClaude Opus 5.5 fca550f4c4 feat(cfcfrms): I4C Live screens for the I4C-MHA integration
New CFCFRMS > I4C Live section backed by /v1/i4c/admin and /v1/i4c/cases
(the demo mock interceptor does not match these paths):

- Dashboard, complaints from I4C, holds register, approvals, responses and
  API log, bank code master, intimation settings.
- Hold popup: overview, hold transactions, customer intimation (automatic and
  manual), maker request (full / partial release, freeze, unfreeze), GRM / MRM
  and documents, request history.
- GRM grievances, MRM restorations and MRM balance report pages; shared date
  range filter (today, yesterday, week, month, custom), server-side paging and
  filters on every list; document upload / download.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 11:43:30 +05:30

795 lines
35 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="i4c-page">
<!-- Modern Toolbar & Filter Chips -->
<div class="i4c-toolbar">
<div class="i4c-filter-chips">
@for (v of views; track v.value) {
<button class="filter-chip" [class.filter-chip--active]="view === v.value" (click)="setView(v.value)">
<span>{{ v.label }}</span>
</button>
}
</div>
<span class="i4c-toolbar__spacer"></span>
<mat-form-field appearance="outline" subscriptSizing="dynamic" class="search-input">
<mat-label>Account / acknowledgement / customer</mat-label>
<input matInput [(ngModel)]="search" (keyup.enter)="load(true)" placeholder="Type & hit enter..." />
</mat-form-field>
<button mat-flat-button color="primary" class="search-btn" (click)="load(true)">
<fa-icon icon="search"></fa-icon> Search
</button>
<span class="count-tag">{{ total }} holds</span>
</div>
<div class="i4c-filter-bar">
<mat-form-field appearance="outline" subscriptSizing="dynamic">
<mat-label>Account type</mat-label>
<mat-select [(ngModel)]="accountType" (selectionChange)="load(true)">
<mat-option value="">All accounts</mat-option>
<mat-option value="SAVINGS">Savings</mat-option>
<mat-option value="CURRENT">Current</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline" subscriptSizing="dynamic">
<mat-label>Customer intimation</mat-label>
<mat-select [(ngModel)]="intimationFilter" (selectionChange)="load(true)">
<mat-option value="">Any</mat-option>
<mat-option value="DONE">Customer told</mat-option>
<mat-option value="PENDING">Not yet told</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline" subscriptSizing="dynamic">
<mat-label>Layer</mat-label>
<mat-select [(ngModel)]="layer" (selectionChange)="load(true)">
<mat-option value="">All layers</mat-option>
<mat-option value="0">Layer 0</mat-option>
<mat-option value="1">Layer 1+</mat-option>
</mat-select>
</mat-form-field>
<mat-checkbox [(ngModel)]="frozenOnly" (change)="load(true)">Debits frozen only</mat-checkbox>
<mifosx-i4c-date-range label="Held on" [range]="dates" (rangeChange)="onDates($event)"></mifosx-i4c-date-range>
<button mat-stroked-button class="i4c-filter-bar__clear" (click)="clearFilters()" [disabled]="!hasFilters">
<fa-icon icon="times"></fa-icon> Clear filters
</button>
</div>
@if (loading || busy) {
<mat-progress-bar mode="indeterminate"></mat-progress-bar>
}
@if (error) {
<div class="i4c-error">
<fa-icon icon="exclamation-circle"></fa-icon>
<span>{{ error }}</span>
</div>
}
<!-- Holds Register Table -->
<div class="i4c-card">
<div class="i4c-card__head">
<fa-icon icon="lock"></fa-icon>
<span>I4C Account Holds Register</span>
<span class="head-hint">Only disputed amounts are restricted; remaining balance stays usable by customer.</span>
</div>
<div class="i4c-table-wrap">
<table class="i4c-table">
<thead>
<tr>
<th>Customer Account</th>
<th>Account Holder / Branch</th>
<th>Ack No.</th>
<th class="num">Layer</th>
<th class="num">Disputed (₹)</th>
<th class="num">Held (₹)</th>
<th class="num">Short (₹)</th>
<th>Hold Status</th>
<th>Customer Intimation</th>
<th>90-Day Review</th>
</tr>
</thead>
<tbody>
@for (h of rows; track h.id) {
<tr class="clickable" (click)="select(h.id)">
<td>
<div class="acc-cell">
<b>{{ h.account_no }}</b>
<span class="type-tag">{{ h.account_type }}</span>
</div>
</td>
<td>
<div class="client-name">{{ h.client_name || 'N/A' }}</div>
<div class="sub">{{ h.office_name }}</div>
</td>
<td>
<div class="ack-cell">
<span class="ack-no">{{ h.acknowledgement_no }}</span>
<button
class="copy-chip"
(click)="copyText(h.acknowledgement_no, 'ack-' + h.id, $event)"
title="Copy Ack No."
>
<fa-icon icon="copy"></fa-icon>
</button>
</div>
</td>
<td class="num font-semibold">{{ h.layer }}</td>
<td class="num">₹{{ h.disputed_amount | number: '1.2-2' }}</td>
<td class="num font-bold text-accent">₹{{ h.amount_held | number: '1.2-2' }}</td>
<td class="num">
@if (h.shortfall > 0) {
<span class="short-pill">₹{{ h.shortfall | number: '1.2-2' }}</span>
} @else {
<span class="text-muted">-</span>
}
</td>
<td>
<span class="i4c-badge" [class]="statusClass(h)">{{ h.status }}</span>
@if (h.debit_frozen) {
<span class="i4c-badge i4c-badge--red">DEBIT FROZEN</span>
}
@if (h.pending_actions) {
<span class="i4c-badge i4c-badge--purple">APPROVAL PENDING</span>
}
</td>
<td>
@if (h.customer_intimated_at) {
<span class="intimation-ok">
<fa-icon icon="check-circle"></fa-icon>
<span>{{ h.customer_intimated_at | date: 'dd MMM' }} ({{ h.intimation_mode }})</span>
</span>
} @else if (isOverdue(h)) {
<span class="i4c-badge i4c-badge--red">OVERDUE</span>
} @else if (h.amount_held > 0 && h.status === 'ACTIVE') {
<span class="i4c-badge i4c-badge--amber">INTIMATION DUE</span>
} @else {
<span class="text-muted">-</span>
}
</td>
<td>
<span [class.due-alert]="isReviewDue(h)" class="review-date">
@if (isReviewDue(h)) {
<fa-icon icon="exclamation-circle"></fa-icon>
}
{{ h.review_due_on }}
</span>
</td>
</tr>
} @empty {
<tr>
<td colspan="10" class="i4c-empty">
<div class="empty-icon"><fa-icon icon="lock"></fa-icon></div>
<div>No holds found in this view.</div>
</td>
</tr>
}
</tbody>
</table>
</div>
<mat-paginator
class="i4c-paginator"
[length]="total"
[pageIndex]="pageIndex"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizes"
(page)="onPage($event)"
showFirstLastButtons
aria-label="Holds pages"
></mat-paginator>
</div>
<!-- ========================================================
MODERN POPUP WINDOW: HOLD DETAILS & MAKER ACTIONS MODAL
======================================================== -->
@if (selected; as h) {
<div class="i4c-modal-backdrop" (click)="close()">
<div class="i4c-modal-window i4c-modal-window--wide" (click)="$event.stopPropagation()">
<!-- Modal Header -->
<div class="i4c-modal-header">
<div class="i4c-modal-header__title">
<fa-icon icon="lock"></fa-icon>
<div>
<div class="modal-title-row">
<span>Hold #{{ h.id }} on Account {{ h.account_no }}</span>
<span class="i4c-badge" [class]="statusClass(h)">{{ h.status }}</span>
@if (h.debit_frozen) {
<span class="i4c-badge i4c-badge--red">DEBIT FROZEN</span>
}
@if (hasPendingAction) {
<span class="i4c-badge i4c-badge--purple">APPROVAL PENDING</span>
}
</div>
<div class="i4c-modal-header__sub">
Customer: <b>{{ h.client_name || 'N/A' }}</b> ({{ h.office_name }}) • Ack: {{ h.acknowledgement_no }}
</div>
</div>
</div>
<div class="i4c-modal-header__actions">
<button class="modal-close-btn" (click)="close()" aria-label="Close">
<fa-icon icon="times"></fa-icon>
</button>
</div>
</div>
<!-- Navigation Tabs inside the Modal -->
<div class="i4c-modal-tabs">
<button class="modal-tab" [class.modal-tab--active]="modalTab === 'overview'" (click)="modalTab = 'overview'">
<fa-icon icon="info-circle"></fa-icon> Overview &amp; Compliance
</button>
<button class="modal-tab" [class.modal-tab--active]="modalTab === 'txns'" (click)="modalTab = 'txns'">
<fa-icon icon="table"></fa-icon> Hold Transactions ({{ h.transactions?.length || 0 }})
</button>
@if ((h.status === 'ACTIVE' && h.amount_held > 0) || h.intimationLog?.length) {
<button
class="modal-tab"
[class.modal-tab--active]="modalTab === 'intimation'"
(click)="modalTab = 'intimation'"
>
<fa-icon icon="bell"></fa-icon> Customer Intimation
@if (!h.customer_intimated_at && h.status === 'ACTIVE' && h.amount_held > 0) {
<span class="i4c-badge i4c-badge--amber">Pending</span>
}
</button>
}
@if (allowedActions.length > 0) {
<button class="modal-tab" [class.modal-tab--active]="modalTab === 'action'" (click)="modalTab = 'action'">
<fa-icon icon="hand-paper"></fa-icon> Request Action (Maker)
</button>
}
<button class="modal-tab" [class.modal-tab--active]="modalTab === 'cases'" (click)="modalTab = 'cases'">
<fa-icon icon="balance-scale"></fa-icon> GRM / MRM &amp; Documents
@if (openGrievance || openRestoration) {
<span class="i4c-badge i4c-badge--amber">Open</span>
}
</button>
@if (h.actions?.length) {
<button class="modal-tab" [class.modal-tab--active]="modalTab === 'history'" (click)="modalTab = 'history'">
<fa-icon icon="history"></fa-icon> Request Audit ({{ h.actions.length }})
</button>
}
</div>
<!-- Modal Body -->
<div class="i4c-modal-body">
<!-- TAB 1: OVERVIEW -->
@if (modalTab === 'overview') {
<div class="i4c-grid-2">
<div class="i4c-card">
<div class="i4c-card__head"><fa-icon icon="shield-alt"></fa-icon> Hold Balances &amp; Account</div>
<div class="i4c-card__body">
<dl class="i4c-kv">
<dt>Customer Name</dt>
<dd>{{ h.client_name || '-' }} ({{ h.office_name }})</dd>
<dt>Account Number</dt>
<dd>
<b>{{ h.account_no }}</b> ({{ h.account_type }})
</dd>
<dt>I4C Complaint Ack</dt>
<dd>
<a [routerLink]="['../requests', h.request_id]" (click)="close()">{{ h.acknowledgement_no }}</a>
(Layer {{ h.layer }})
</dd>
<dt>Disputed Amount</dt>
<dd>₹{{ h.disputed_amount | number: '1.2-2' }}</dd>
<dt>Amount Held</dt>
<dd>
<b class="amount-held-text">₹{{ h.amount_held | number: '1.2-2' }}</b>
</dd>
<dt>Shortfall</dt>
<dd>
@if (h.shortfall > 0) {
<span class="err-text">₹{{ h.shortfall | number: '1.2-2' }} (Prospective hold)</span>
} @else {
<span>Fully covered (₹0.00)</span>
}
</dd>
</dl>
</div>
</div>
<div class="i4c-card">
<div class="i4c-card__head"><fa-icon icon="calendar-check"></fa-icon> Compliance &amp; Directions</div>
<div class="i4c-card__body">
<dl class="i4c-kv">
<dt>Hold Placed On</dt>
<dd>{{ h.held_at | date: 'dd MMM yyyy, HH:mm:ss' }} (System automated)</dd>
<dt>90-Day Review Due</dt>
<dd>
<span [class.due-alert]="isReviewDue(h)">{{ h.review_due_on }}</span>
</dd>
<dt>Debit Freeze Status</dt>
<dd>
@if (h.debit_frozen) {
<span class="i4c-badge i4c-badge--red">FROZEN</span>
} @else {
<span>Active (Debit Not Frozen)</span>
}
</dd>
<dt>Customer Intimation</dt>
<dd>
@if (h.customer_intimated_at) {
<span class="intimation-ok">
{{ h.customer_intimated_at | date: 'dd MMM yyyy, HH:mm' }} by {{ h.intimated_by }} ({{
h.intimation_mode
}}{{ h.intimation_reference ? ', ' + h.intimation_reference : '' }})
</span>
} @else {
<span class="err-text">
Not told yet{{
h.intimation_due_by ? ' - due by ' + (h.intimation_due_by | date: 'dd MMM yyyy, HH:mm') : ''
}}
</span>
}
</dd>
@if (h.status === 'RELEASED') {
<dt>Released On</dt>
<dd>
{{ h.released_at | date: 'dd MMM yyyy, HH:mm' }} -
{{ reasonLabel(h.release_reason_type || '') }}
{{ h.release_reference }}
</dd>
}
</dl>
</div>
</div>
</div>
}
<!-- TAB 2: TRANSACTIONS -->
@if (modalTab === 'txns') {
<div class="i4c-card">
<div class="i4c-card__head"><fa-icon icon="table"></fa-icon> Account Hold Transactions</div>
<div class="i4c-card__body i4c-table-wrap">
<table class="i4c-table">
<thead>
<tr>
<th>Account Txn ID</th>
<th class="num">Held Amount (₹)</th>
<th>Placed Timestamp</th>
<th>Released Timestamp</th>
</tr>
</thead>
<tbody>
@for (t of h.transactions; track t.id) {
<tr>
<td>
<b>{{ t.account_txn_id }}</b>
</td>
<td class="num">₹{{ t.amount | number: '1.2-2' }}</td>
<td>{{ t.placed_at | date: 'dd MMM yyyy, HH:mm' }}</td>
<td>{{ t.released_at ? (t.released_at | date: 'dd MMM yyyy, HH:mm') : '-' }}</td>
</tr>
} @empty {
<tr>
<td colspan="4" class="i4c-empty">
No money held yet (prospective hold waiting for funds deposit).
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
}
<!-- TAB 3: CUSTOMER INTIMATION (automatic channels, manual record, history) -->
@if (modalTab === 'intimation') {
@if (h.customer_intimated_at) {
<div class="intim-status intim-status--done">
<fa-icon icon="check"></fa-icon>
<div>
<b>Customer told</b> on {{ h.customer_intimated_at | date: 'dd MMM yyyy, HH:mm' }} by
{{ channelLabel(h.intimation_mode || '')
}}{{ h.intimation_reference ? ' - ' + h.intimation_reference : '' }} ({{ h.intimated_by }})
</div>
</div>
} @else if (h.automaticChannels?.length) {
<div class="intim-status intim-status--auto">
<fa-icon icon="paper-plane"></fa-icon>
<div>
<b>Automatic intimation is on</b> ({{ autoChannelsText(h) }}).
@if (h.intimationLog?.length) {
The last automatic attempt did not reach the customer; the system retries up to 3 times. You can
send again now, or call the customer and record it below.
} @else {
The notice is sent as soon as the hold is placed. If it has not gone yet, send it now.
}
</div>
<button mat-flat-button color="primary" (click)="sendIntimationNow()" [disabled]="busy">
<fa-icon icon="paper-plane"></fa-icon> Send now
</button>
</div>
} @else {
<div class="intim-status intim-status--manual">
<fa-icon icon="phone"></fa-icon>
<div>
<b>No automatic channel is configured.</b> Call the customer (or send a letter / meet in person), then
record it below. Channels are switched on under Intimation Settings.
</div>
</div>
}
@if (!h.customer_intimated_at && h.status === 'ACTIVE' && h.amount_held > 0) {
<div class="i4c-card">
<div class="i4c-card__head"><fa-icon icon="bell"></fa-icon> Record Customer Intimation (manual)</div>
<div class="i4c-card__body">
<div class="i4c-note">
RBI draft directions mandate that the account holder be notified of an account hold by the end of
the next day, including reason, restoration options, and Grievance Officer contacts.
</div>
<div class="i4c-form">
<mat-form-field appearance="outline">
<mat-label>How the customer was told</mat-label>
<mat-select [(ngModel)]="intimation.mode">
@for (m of intimationModes; track m) {
<mat-option [value]="m">{{ channelLabel(m) }}</mat-option>
}
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Reference (call note, letter no.)</mat-label>
<input
matInput
[(ngModel)]="intimation.reference"
maxlength="200"
placeholder="e.g. Called 98xxxx1234, customer informed"
/>
</mat-form-field>
</div>
<button mat-flat-button color="primary" (click)="submitIntimation()" [disabled]="busy">
<fa-icon icon="bell"></fa-icon> Record Customer Intimation
</button>
</div>
</div>
}
<div class="i4c-card">
<div class="i4c-card__head">
<fa-icon icon="history"></fa-icon> Intimation History ({{ h.intimationLog?.length || 0 }})
</div>
<div class="i4c-card__body">
<table class="i4c-table">
<thead>
<tr>
<th>When</th>
<th>Channel</th>
<th>Type</th>
<th>Status</th>
<th>Sent to</th>
<th>Reference / Reason</th>
<th>By</th>
</tr>
</thead>
<tbody>
@for (l of h.intimationLog || []; track l.id) {
<tr>
<td>{{ l.created_at | date: 'dd MMM yyyy, HH:mm' }}</td>
<td>{{ channelLabel(l.channel) }}</td>
<td>
{{ l.mode === 'AUTO' ? 'Automatic' : l.mode === 'RESEND' ? 'Sent by officer' : 'Recorded' }}
</td>
<td>
<span
class="i4c-badge"
[class.i4c-badge--green]="
l.status === 'SENT' || l.status === 'DELIVERED' || l.status === 'RECORDED'
"
[class.i4c-badge--red]="l.status === 'FAILED'"
[class.i4c-badge--amber]="l.status === 'SKIPPED_NO_DESTINATION'"
>{{ l.status }}</span
>
</td>
<td>{{ l.destination_masked || '-' }}</td>
<td class="wrap">{{ l.failure_reason || l.provider_reference || '-' }}</td>
<td>{{ l.actor || '-' }}</td>
</tr>
} @empty {
<tr>
<td colspan="7" class="i4c-empty">No notice sent or recorded yet.</td>
</tr>
}
</tbody>
</table>
</div>
</div>
}
<!-- TAB 4: MAKER CHANGE REQUEST FORM -->
@if (modalTab === 'action') {
<div class="i4c-card">
<div class="i4c-card__head"><fa-icon icon="hand-paper"></fa-icon> Raise Request on Hold (Maker)</div>
<div class="i4c-card__body">
@if (hasPendingAction) {
<div class="i4c-note">
A request on this hold is already waiting for checker approval on the Approvals page.
</div>
} @else {
<div class="i4c-form">
<mat-form-field appearance="outline">
<mat-label>Requested Action</mat-label>
<mat-select [(ngModel)]="action.action">
@for (a of allowedActions; track a.value) {
<mat-option [value]="a.value">{{ a.label }}</mat-option>
}
</mat-select>
</mat-form-field>
@if (action.action === 'RELEASE') {
<mat-form-field appearance="outline">
<mat-label>Amount to release (₹, empty = all)</mat-label>
<input matInput type="number" min="0" [max]="h.amount_held" [(ngModel)]="action.amount" />
@if (remainingAfterRelease !== null) {
<mat-hint
>₹{{ remainingAfterRelease | number: '1.2-2' }} stays on hold (order names the amount to
keep)</mat-hint
>
}
</mat-form-field>
}
<mat-form-field appearance="outline">
<mat-label>Reason</mat-label>
<mat-select [(ngModel)]="action.reasonType">
@for (r of reasonTypes; track r.value) {
<mat-option [value]="r.value">{{ r.label }}</mat-option>
}
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Order / Reference No.{{ orderRequired ? ' *' : '' }}</mat-label>
<input
matInput
[(ngModel)]="action.orderReference"
maxlength="200"
placeholder="IO / Court reference..."
/>
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Order Date</mat-label>
<input matInput type="date" [(ngModel)]="action.orderDate" />
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Issuing Authority (IO, Court, DGRO...)</mat-label>
<input
matInput
[(ngModel)]="action.authority"
maxlength="200"
placeholder="e.g. Cyber Cell IO..."
/>
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Maker Remarks</mat-label>
<input
matInput
[(ngModel)]="action.remarks"
maxlength="1000"
placeholder="Notes for checker..."
/>
</mat-form-field>
</div>
<button mat-flat-button color="warn" (click)="submitAction()" [disabled]="busy">
<fa-icon icon="hand-paper"></fa-icon> Submit for Checker Approval
</button>
}
</div>
</div>
}
<!-- TAB: GRM grievance, MRM restoration, statement and documents of this hold -->
@if (modalTab === 'cases') {
<div class="cases-grid">
<div class="i4c-card">
<div class="i4c-card__head">
<fa-icon icon="balance-scale"></fa-icon> GRM grievance (customer contests the hold)
</div>
<div class="i4c-card__body">
@for (g of h.grievances || []; track g.id) {
<div
class="case-row"
(click)="goTo('grievances', g.id)"
(keyup.enter)="goTo('grievances', g.id)"
tabindex="0"
>
<b>{{ g.grievance_no || 'Draft #' + g.id }}</b>
<span class="i4c-badge">{{ g.stage }}</span>
<span
class="i4c-badge"
[class.i4c-badge--green]="g.status === 'ALLOWED'"
[class.i4c-badge--red]="g.status === 'REJECTED'"
>{{ g.status }}</span
>
<span class="sub">{{ g.created_at | date: 'dd MMM yyyy' }}</span>
</div>
}
@if (h.status === 'ACTIVE' && !openGrievance) {
<div class="i4c-form">
<mat-form-field appearance="outline">
<mat-label>Customer asks to</mat-label>
<mat-select [(ngModel)]="grievanceForm.customerRequest">
<mat-option value="REMOVE_HOLD">Remove the hold</mat-option>
<mat-option value="UNFREEZE">Unfreeze the account</mat-option>
<mat-option value="RESTORE_DIGITAL_SERVICES">Restore digital services</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Customer's reason</mat-label>
<input matInput [(ngModel)]="grievanceForm.customerReason" maxlength="2000" />
</mat-form-field>
</div>
<button mat-flat-button color="primary" (click)="raiseGrievance()" [disabled]="busy">
<fa-icon icon="plus"></fa-icon> Open grievance (EDD next)
</button>
} @else if (!h.grievances?.length) {
<div class="sub">No grievance on this hold.</div>
}
</div>
</div>
<div class="i4c-card">
<div class="i4c-card__head"><fa-icon icon="hand-holding-usd"></fa-icon> MRM money restoration</div>
<div class="i4c-card__body">
@for (r of h.restorations || []; track r.id) {
<div
class="case-row"
(click)="goTo('restorations', r.id)"
(keyup.enter)="goTo('restorations', r.id)"
tabindex="0"
>
<b>{{ r.mrm_request_no || 'Restoration #' + r.id }}</b>
<span class="i4c-badge">{{ r.status }}</span>
<span class="sub"
>{{ r.basis }}
{{ r.restorable_amount ? '₹' + (r.restorable_amount | number: '1.2-2') : '' }}</span
>
</div>
}
@if (h.status === 'ACTIVE' && !openRestoration) {
<div class="i4c-form">
<mat-form-field appearance="outline">
<mat-label>Restoration</mat-label>
<mat-select [(ngModel)]="assessForm.basis">
@for (b of mrmBases; track b.value) {
<mat-option [value]="b.value">{{ b.label }}</mat-option>
}
</mat-select>
</mat-form-field>
@if (assessForm.basis === 'ATTRIBUTION' || assessForm.basis === 'PRO_RATA') {
<mat-form-field appearance="outline">
<mat-label>Restorable amount (₹, at most {{ h.amount_held | number: '1.2-2' }})</mat-label>
<input matInput type="number" min="0" [(ngModel)]="assessForm.restorableAmount" />
</mat-form-field>
}
<mat-form-field appearance="outline">
<mat-label>Remarks</mat-label>
<input matInput [(ngModel)]="assessForm.remarks" maxlength="1000" />
</mat-form-field>
</div>
<button mat-flat-button color="primary" (click)="assessForMrm()" [disabled]="busy">
<fa-icon icon="check"></fa-icon> Assess for MRM
</button>
} @else if (!h.restorations?.length) {
<div class="sub">No restoration on this hold.</div>
}
</div>
</div>
</div>
<div class="i4c-card">
<div class="i4c-card__head">
<fa-icon icon="file-csv"></fa-icon> Bank statement (GRM / MRM ask for it)
</div>
<div class="i4c-card__body">
<div class="i4c-form">
<mat-form-field appearance="outline">
<mat-label>From (default 90 days back)</mat-label>
<input matInput type="date" [(ngModel)]="statement.fromDate" />
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>To (default today)</mat-label>
<input matInput type="date" [(ngModel)]="statement.toDate" />
</mat-form-field>
</div>
<button mat-stroked-button (click)="downloadStatement()">
<fa-icon icon="download"></fa-icon> Download statement (CSV)
</button>
</div>
</div>
<div class="i4c-card">
<div class="i4c-card__head">
<fa-icon icon="paperclip"></fa-icon> Documents on this hold (IO / court orders...)
</div>
<div class="i4c-card__body">
<mifosx-i4c-documents
ownerType="HOLD"
[ownerId]="h.id"
[suggested]="['IO_ORDER', 'COURT_ORDER', 'OTHER']"
[documents]="h.documents || null"
(changed)="select(h.id)"
></mifosx-i4c-documents>
</div>
</div>
}
<!-- TAB 5: REQUEST AUDIT HISTORY -->
@if (modalTab === 'history') {
<div class="i4c-card">
<div class="i4c-card__head"><fa-icon icon="history"></fa-icon> Requests Audit History on this Hold</div>
<div class="i4c-card__body i4c-table-wrap">
<table class="i4c-table">
<thead>
<tr>
<th>Action</th>
<th>Reason / Order</th>
<th>Status</th>
<th>Maker Details</th>
<th>Checker Details</th>
</tr>
</thead>
<tbody>
@for (a of h.actions; track a.id) {
<tr>
<td>
<b>{{ a.action }}</b>
</td>
<td>
{{ reasonLabel(a.reason_type) }}
<div class="sub">{{ a.order_reference }} {{ a.authority ? '- ' + a.authority : '' }}</div>
</td>
<td>
<span class="i4c-badge">{{ a.status }}</span>
@if (a.rejection_reason || a.failure_message) {
<div class="sub err-text">{{ a.rejection_reason || a.failure_message }}</div>
}
</td>
<td>
{{ a.maker_name }}
<div class="sub">{{ a.maker_at | date: 'dd MMM, HH:mm' }}</div>
</td>
<td>
{{ a.checker_name || '-' }}
@if (a.checker_at) {
<div class="sub">{{ a.checker_at | date: 'dd MMM, HH:mm' }}</div>
}
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
}
</div>
<!-- Modal Footer -->
<div class="i4c-modal-footer">
<button class="footer-btn-close" (click)="close()">Close</button>
</div>
</div>
</div>
}
</div>