feat(cashier): denomination overdraft validation, exchange detail fix, cash exchange in reports

- Savings/Current/FD/RD withdrawal forms: card-style overdraft warning when
  requested denomination count exceeds cashier stock; submit blocked on overdraft
- Cash History detail view: show both RECEIVED and GIVEN denomination breakdowns
  for Cash Exchange (previously only RECEIVED side was displayed)
- Closing Cash Report: add Cash Exchanges section (denomination-wise received/given/net)
- Excess Transaction Report: include cash exchanges >= threshold with Type badge
  (Exchange/Txn) and ID Proof column for RBI/AML compliance
- cashier-shared.scss: etr-badge and closing-exchange-head styles
- Cash Exchange entry: overdraft warning redesigned to cx-overdraft-card BEM layout

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jaanu423
2026-06-01 10:10:17 +05:30
co-authored by Claude Sonnet 4.6
parent 51495f8eb8
commit f291e4da5b
24 changed files with 1339 additions and 25 deletions
@@ -52,6 +52,12 @@
<ng-container *ngTemplateOutlet="txnTable; context: { rows: interCashier }"></ng-container>
</div>
</mat-tab>
<mat-tab label="Cash Exchanges ({{ exchanges.length }})">
<div class="pg-tab-body">
<ng-container *ngTemplateOutlet="txnTable; context: { rows: exchanges }"></ng-container>
</div>
</mat-tab>
</mat-tab-group>
</div>
@@ -122,7 +128,13 @@
<!-- Header -->
<div class="detail-panel__head">
<div class="detail-panel__title">
<mat-icon>{{ detail.row.type === 'settlement' ? 'account_balance_wallet' : 'swap_horiz' }}</mat-icon>
<mat-icon>{{
detail.row.type === 'settlement'
? 'account_balance_wallet'
: detail.row.type === 'exchange'
? 'currency_exchange'
: 'swap_horiz'
}}</mat-icon>
<div>
<span class="detail-panel__type">{{ typeLabel(detail.row.type) }}</span>
<span class="detail-panel__id">#{{ detail.row.id }}</span>
@@ -241,8 +253,163 @@
@if (detail.loading) {
<div class="pg-empty" style="padding: 20px 0">Loading denomination details…</div>
} @else if (detail.denominations.length === 0) {
} @else if (
detail.row.type === 'exchange' &&
detail.receivedDenominations.length === 0 &&
detail.givenDenominations.length === 0
) {
<div class="pg-empty" style="padding: 20px 0">No denomination data recorded.</div>
} @else if (detail.row.type !== 'exchange' && detail.denominations.length === 0) {
<div class="pg-empty" style="padding: 20px 0">No denomination data recorded.</div>
} @else if (detail.row.type === 'exchange') {
<!-- RECEIVED from customer -->
<div class="cx-dir-label cx-dir-label--received"><mat-icon>south</mat-icon> Received from Customer</div>
@if (notes(detail.receivedDenominations).length > 0) {
<div class="detail-denom-kind-label">Notes</div>
<table class="pg-table detail-denom-table">
<thead>
<tr>
<th>Denomination</th>
<th style="text-align: center">Count</th>
<th class="num">Total</th>
</tr>
</thead>
<tbody>
@for (d of notes(detail.receivedDenominations); track d.denominationValue) {
<tr>
<td>
<span class="pg-chip">₹{{ d.denominationValue }}</span>
</td>
<td style="text-align: center; font-weight: 600">{{ d.count }}</td>
<td class="num">₹{{ d.totalAmount | number: '1.2-2' }}</td>
</tr>
}
</tbody>
<tfoot>
<tr class="detail-denom-total">
<td><strong>Subtotal</strong></td>
<td style="text-align: center">
<strong>{{ totalCount(notes(detail.receivedDenominations)) }}</strong>
</td>
<td class="num">
<strong>₹{{ subtotal(notes(detail.receivedDenominations)) | number: '1.2-2' }}</strong>
</td>
</tr>
</tfoot>
</table>
}
@if (coins(detail.receivedDenominations).length > 0) {
<div class="detail-denom-kind-label">Coins</div>
<table class="pg-table detail-denom-table">
<thead>
<tr>
<th>Denomination</th>
<th style="text-align: center">Count</th>
<th class="num">Total</th>
</tr>
</thead>
<tbody>
@for (d of coins(detail.receivedDenominations); track d.denominationValue) {
<tr>
<td>
<span class="pg-chip pg-chip--coin">₹{{ d.denominationValue }}</span>
</td>
<td style="text-align: center; font-weight: 600">{{ d.count }}</td>
<td class="num">₹{{ d.totalAmount | number: '1.2-2' }}</td>
</tr>
}
</tbody>
<tfoot>
<tr class="detail-denom-total">
<td><strong>Subtotal</strong></td>
<td style="text-align: center">
<strong>{{ totalCount(coins(detail.receivedDenominations)) }}</strong>
</td>
<td class="num">
<strong>₹{{ subtotal(coins(detail.receivedDenominations)) | number: '1.2-2' }}</strong>
</td>
</tr>
</tfoot>
</table>
}
<!-- GIVEN to customer -->
<div class="cx-dir-label cx-dir-label--given"><mat-icon>north</mat-icon> Given to Customer</div>
@if (notes(detail.givenDenominations).length > 0) {
<div class="detail-denom-kind-label">Notes</div>
<table class="pg-table detail-denom-table">
<thead>
<tr>
<th>Denomination</th>
<th style="text-align: center">Count</th>
<th class="num">Total</th>
</tr>
</thead>
<tbody>
@for (d of notes(detail.givenDenominations); track d.denominationValue) {
<tr>
<td>
<span class="pg-chip">₹{{ d.denominationValue }}</span>
</td>
<td style="text-align: center; font-weight: 600">{{ d.count }}</td>
<td class="num">₹{{ d.totalAmount | number: '1.2-2' }}</td>
</tr>
}
</tbody>
<tfoot>
<tr class="detail-denom-total">
<td><strong>Subtotal</strong></td>
<td style="text-align: center">
<strong>{{ totalCount(notes(detail.givenDenominations)) }}</strong>
</td>
<td class="num">
<strong>₹{{ subtotal(notes(detail.givenDenominations)) | number: '1.2-2' }}</strong>
</td>
</tr>
</tfoot>
</table>
}
@if (coins(detail.givenDenominations).length > 0) {
<div class="detail-denom-kind-label">Coins</div>
<table class="pg-table detail-denom-table">
<thead>
<tr>
<th>Denomination</th>
<th style="text-align: center">Count</th>
<th class="num">Total</th>
</tr>
</thead>
<tbody>
@for (d of coins(detail.givenDenominations); track d.denominationValue) {
<tr>
<td>
<span class="pg-chip pg-chip--coin">₹{{ d.denominationValue }}</span>
</td>
<td style="text-align: center; font-weight: 600">{{ d.count }}</td>
<td class="num">₹{{ d.totalAmount | number: '1.2-2' }}</td>
</tr>
}
</tbody>
<tfoot>
<tr class="detail-denom-total">
<td><strong>Subtotal</strong></td>
<td style="text-align: center">
<strong>{{ totalCount(coins(detail.givenDenominations)) }}</strong>
</td>
<td class="num">
<strong>₹{{ subtotal(coins(detail.givenDenominations)) | number: '1.2-2' }}</strong>
</td>
</tr>
</tfoot>
</table>
}
<!-- Grand total -->
<div class="detail-denom-grand-total">
<span>Grand Total</span>
<span>{{ totalCount(detail.receivedDenominations) }} notes/coins</span>
<span>₹{{ detail.row.amount | number: '1.2-2' }}</span>
</div>
} @else {
<!-- Notes -->
@if (notes(detail.denominations).length > 0) {