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>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
555d9fb4b7
commit
7ccaffa7f1
@@ -0,0 +1,116 @@
|
||||
/**
|
||||
* 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/.
|
||||
*/
|
||||
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/** HTTP service for the Cashier menu features. */
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class CashierService {
|
||||
private http = inject(HttpClient);
|
||||
|
||||
// ── Active denominations ──
|
||||
getActiveDenominations(): Observable<any[]> {
|
||||
return this.http.get<any[]>('/denominationmaster/active');
|
||||
}
|
||||
|
||||
// ── Cash Exchange ──
|
||||
createCashExchange(data: any): Observable<any> {
|
||||
return this.http.post('/cashexchange', data);
|
||||
}
|
||||
getCashExchanges(): Observable<any[]> {
|
||||
return this.http.get<any[]>('/cashexchange');
|
||||
}
|
||||
getCashExchange(id: number): Observable<any> {
|
||||
return this.http.get(`/cashexchange/${id}`);
|
||||
}
|
||||
|
||||
// ── Tellers / Cashiers ──
|
||||
getTellers(): Observable<any[]> {
|
||||
return this.http.get<any[]>('/tellers');
|
||||
}
|
||||
getAllCashiers(): Observable<any[]> {
|
||||
return this.http.get<any[]>('/cashiers');
|
||||
}
|
||||
getCashiersForTeller(tellerId: number): Observable<any> {
|
||||
return this.http.get(`/tellers/${tellerId}/cashiers`);
|
||||
}
|
||||
|
||||
// ── Cash Transfer ──
|
||||
createCashTransfer(data: any): Observable<any> {
|
||||
return this.http.post('/cashtransfer', data);
|
||||
}
|
||||
getCashTransfers(): Observable<any[]> {
|
||||
return this.http.get<any[]>('/cashtransfer');
|
||||
}
|
||||
reverseCashTransfer(id: number, reason: string): Observable<any> {
|
||||
return this.http.post(`/cashtransfer/${id}/reverse`, { reason });
|
||||
}
|
||||
|
||||
// ── Cash Settlement ──
|
||||
createCashSettlement(data: any): Observable<any> {
|
||||
return this.http.post('/cashsettlement', data);
|
||||
}
|
||||
getCashSettlements(): Observable<any[]> {
|
||||
return this.http.get<any[]>('/cashsettlement');
|
||||
}
|
||||
reverseCashSettlement(id: number, reason: string): Observable<any> {
|
||||
return this.http.post(`/cashsettlement/${id}/reverse`, { reason });
|
||||
}
|
||||
|
||||
// ── Inter-cashier Transfer ──
|
||||
createInterCashierTransfer(data: any): Observable<any> {
|
||||
return this.http.post('/cashintercashier', data);
|
||||
}
|
||||
getInterCashierTransfers(): Observable<any[]> {
|
||||
return this.http.get<any[]>('/cashintercashier');
|
||||
}
|
||||
reverseInterCashierTransfer(id: number, reason: string): Observable<any> {
|
||||
return this.http.post(`/cashintercashier/${id}/reverse`, { reason });
|
||||
}
|
||||
|
||||
// ── Reconciliation ──
|
||||
createReconciliation(data: any): Observable<any> {
|
||||
return this.http.post('/cashreconciliation', data);
|
||||
}
|
||||
getReconciliations(): Observable<any[]> {
|
||||
return this.http.get<any[]>('/cashreconciliation');
|
||||
}
|
||||
getReconciliationById(id: number): Observable<any> {
|
||||
return this.http.get(`/cashreconciliation/${id}`);
|
||||
}
|
||||
getExpectedBalance(cashierId: number, asOfDate?: string): Observable<any> {
|
||||
let params = new HttpParams().set('cashierId', String(cashierId));
|
||||
if (asOfDate) params = params.set('asOfDate', asOfDate);
|
||||
return this.http.get('/cashreconciliation/expected', { params });
|
||||
}
|
||||
|
||||
// ── Reports ──
|
||||
closingCashReport(date: string): Observable<any> {
|
||||
const params = new HttpParams().set('date', date);
|
||||
return this.http.get('/cashreports/closing', { params });
|
||||
}
|
||||
excessTransactionReport(threshold: number, fromDate?: string, toDate?: string): Observable<any[]> {
|
||||
let params = new HttpParams().set('threshold', String(threshold));
|
||||
if (fromDate) params = params.set('fromDate', fromDate);
|
||||
if (toDate) params = params.set('toDate', toDate);
|
||||
return this.http.get<any[]>('/cashreports/excess', { params });
|
||||
}
|
||||
cashierPositionReport(cashierId?: number, asOfDate?: string): Observable<any> {
|
||||
let params = new HttpParams();
|
||||
if (cashierId) params = params.set('cashierId', String(cashierId));
|
||||
if (asOfDate) params = params.set('asOfDate', asOfDate);
|
||||
return this.http.get('/cashreports/cashier-position', { params });
|
||||
}
|
||||
getCashierPositionForMe(asOfDate?: string): Observable<any> {
|
||||
let params = new HttpParams();
|
||||
if (asOfDate) params = params.set('asOfDate', asOfDate);
|
||||
return this.http.get('/cashreports/cashier-position/me', { params });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user