Files
cbsnexora/src/app/cashier/cash-history/cash-history.component.html
T
Jaanu423andClaude Sonnet 4.6 7ccaffa7f1 feat: cashier denomination-wise opening & closing balance panels in all deposit/withdrawal forms
OVERVIEW
--------
Added real-time cashier cash position display inside the denomination breakdown
panel of all 4 transaction entry screens: Savings, Current Account, Recurring
Deposit, and Fixed Deposit. Shows opening balance at the top and projected
closing balance at the bottom after factoring in the current transaction.

BACKEND INTEGRATION
-------------------
- New CashierService (src/app/cashier/cashier.service.ts)
  getCashierPositionForMe(asOfDate?) calls GET /cashreports/cashier-position/me
  Returns denomination-wise opening cash position for the logged-in cashier user.
  Non-cashier users receive empty denominations array; UI hides panels silently.

OPENING BALANCE CARD (top of denomination panel)
-------------------------------------------------
- Loaded on ngOnInit() via loadOpeningPosition() in all 4 component .ts files
- Notes and Coins displayed in separate labeled pill sections
- Each pill shows: Rs{value} x{count} format
- Card is hidden entirely if the logged-in user is not a cashier

CLOSING BALANCE CARD (below tally / Apply button)
--------------------------------------------------
- Computed getter closingDenoms() merges opening position with entered denominations
  deposit:    closingCount = openCount + enteredCount
  withdrawal: closingCount = openCount - enteredCount
- Notes and Coins in separate labeled pill sections (identical format to opening)
- Entered/changed denominations (delta != 0): full opacity + bold font weight
- Untouched denominations (delta = 0): 38% opacity, clearly dimmed, no borders
- closingTotal = openingTotal +/- denominationTotal shown in card header
- Card turns green for positive closing balance, red for negative

COMPONENTS UPDATED
------------------
- savings-account-transactions       (.ts / .html / .scss)
- current-account-transactions       (.ts / .html / .scss)
- deposit-recurring-deposits-account (.ts / .html / .scss)
- fixed-deposits-cash-transaction    (.ts / .html / .scss)

CASHIER MODULE (new - src/app/cashier/)
-----------------------------------------
Full cashier workspace module added to the app:
- cashier.service.ts          API calls (position, transfers, settlement, etc.)
- cashier.module.ts           Angular module declaration
- cashier-routing.module.ts   Lazy-loaded routes
- cashier-position/           Cashier cash position dashboard
- cash-exchange-entry/        Cash exchange denomination entry
- cash-history/               Transaction history per cashier
- cash-settlement/            End-of-day cash settlement
- cash-transfer/              Vault-to-cashier cash transfer
- inter-cashier-transfer/     Transfer between cashier drawers
- reconciliation/             Cash reconciliation with GL
- closing-cash-report/        Closing balance report
- currency-exchange-detail/   Currency exchange breakdown
- excess-transaction-report/  Excess/short transaction report
Module wired into app.module.ts and shell nav (shell.component.html).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 17:39:31 +05:30

107 lines
3.7 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">CASHIER · HISTORY</div>
<h1 class="pg-title">Cash Movement History</h1>
<p class="pg-sub">All transfers, settlements, and inter-cashier movements. Reverse any active transaction.</p>
</div>
<button type="button" class="pg-btn pg-btn--ghost" (click)="load()"><mat-icon>refresh</mat-icon> Refresh</button>
</header>
<!-- Reversal confirm panel -->
@if (reversingId !== null) {
<div class="reverse-panel">
<mat-icon class="reverse-icon">warning</mat-icon>
<span
>Reverse <strong>#{{ reversingId }}</strong
>? This cannot be undone.</span
>
<input class="reverse-reason" type="text" [(ngModel)]="reverseReason" placeholder="Reason (optional)" />
<button type="button" class="pg-btn pg-btn--danger" (click)="confirmReverse()">Confirm Reversal</button>
<button type="button" class="pg-btn pg-btn--ghost" (click)="cancelReverse()">Cancel</button>
</div>
}
@if (loading) {
<div class="pg-empty">Loading…</div>
}
<mat-tab-group animationDuration="150ms">
<mat-tab label="Cash Transfers ({{ transfers.length }})">
<div class="pg-tab-body">
<ng-container *ngTemplateOutlet="txnTable; context: { rows: transfers }"></ng-container>
</div>
</mat-tab>
<mat-tab label="Settlements ({{ settlements.length }})">
<div class="pg-tab-body">
<ng-container *ngTemplateOutlet="txnTable; context: { rows: settlements }"></ng-container>
</div>
</mat-tab>
<mat-tab label="Inter-Cashier ({{ interCashier.length }})">
<div class="pg-tab-body">
<ng-container *ngTemplateOutlet="txnTable; context: { rows: interCashier }"></ng-container>
</div>
</mat-tab>
</mat-tab-group>
</div>
<ng-template #txnTable let-rows="rows">
@if (rows.length === 0 && !loading) {
<div class="pg-empty">No records.</div>
}
@if (rows.length > 0) {
<div class="pg-card" style="margin-top: 16px">
<table class="pg-table">
<thead>
<tr>
<th>#</th>
<th>Date</th>
<th>From</th>
<th>To</th>
<th class="num">Amount</th>
<th>Note</th>
<th>By</th>
<th style="text-align: center">Status</th>
<th style="text-align: center">Action</th>
</tr>
</thead>
<tbody>
@for (r of rows; track r.id) {
<tr [class.row-reversed]="r.isReversed">
<td>{{ r.id }}</td>
<td>{{ r.date }}</td>
<td>{{ r.fromParty }}</td>
<td>{{ r.toParty }}</td>
<td class="num">₹{{ r.amount | number: '1.2-2' }}</td>
<td>{{ r.note || '—' }}</td>
<td>{{ r.performedByUsername || '—' }}</td>
<td style="text-align: center">
<span class="badge" [class.badge-active]="!r.isReversed" [class.badge-reversed]="r.isReversed">
{{ r.isReversed ? 'Reversed' : 'Active' }}
</span>
</td>
<td style="text-align: center">
@if (!r.isReversed) {
<button type="button" class="pg-btn pg-btn--ghost btn-sm" (click)="startReverse(r)">
<mat-icon>undo</mat-icon>
</button>
}
</td>
</tr>
}
</tbody>
</table>
</div>
}
</ng-template>