feat(cashier): morning opening balance panel across settlement, reconciliation, position & history
- Cash Settlement form: morning panel (denomination pills) + Morning column in denomination table - Reconciliation form: morning panel (denomination pills) + Morning column in denomination table - Cashier Position Report: Morning vs Current comparison bar + Morning column (single-cashier mode) - Cash History – Settlement detail panel: Morning Received vs Settled comparison bar + Morning column - Cash History – denomination Notes/Coins separation in detail panel for all transaction types - CashierService: added getCashierMorningBalance() calling GET /cashreports/cashier-morning - All morning data loaded via forkJoin alongside existing API calls (no extra loading states) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
6433ae068d
commit
51495f8eb8
@@ -25,6 +25,7 @@ interface SettleDenomRow {
|
||||
denominationId: number;
|
||||
denominationValue: number;
|
||||
kind: 'note' | 'coin';
|
||||
morningCount: number;
|
||||
expectedCount: number;
|
||||
physicalCount: number;
|
||||
}
|
||||
@@ -77,6 +78,7 @@ export class CashSettlementComponent implements OnInit {
|
||||
supervisorChecking = false;
|
||||
|
||||
rows: SettleDenomRow[] = [];
|
||||
morningTotal = 0;
|
||||
|
||||
settlementDate = '';
|
||||
// Vault teller to deposit TO
|
||||
@@ -128,8 +130,9 @@ export class CashSettlementComponent implements OnInit {
|
||||
.pipe(catchError(() => of({ alreadySettled: false }))),
|
||||
recon: this.service
|
||||
.checkReconciliation(cashierId, this.settlementDate)
|
||||
.pipe(catchError(() => of({ reconciled: false })))
|
||||
}).subscribe(({ expected, check, recon }) => {
|
||||
.pipe(catchError(() => of({ reconciled: false }))),
|
||||
morning: this.service.getCashierMorningBalance(cashierId, this.settlementDate).pipe(catchError(() => of(null)))
|
||||
}).subscribe(({ expected, check, recon, morning }) => {
|
||||
this.supervisorChecking = false;
|
||||
if (check?.alreadySettled) {
|
||||
this.pageState = 'already-settled';
|
||||
@@ -139,6 +142,13 @@ export class CashSettlementComponent implements OnInit {
|
||||
this.pageState = 'needs-reconciliation';
|
||||
return;
|
||||
}
|
||||
// Build denomination → morningCount map
|
||||
const morningMap = new Map<number, number>();
|
||||
((morning?.denominations || []) as any[]).forEach((d: any) =>
|
||||
morningMap.set(d.denominationId, d.morningCount ?? 0)
|
||||
);
|
||||
this.morningTotal = Number(morning?.totalMorning ?? 0);
|
||||
|
||||
this.rows = ((expected?.denominations as any[]) || [])
|
||||
.filter((d: any) => (d.expectedCount ?? 0) > 0)
|
||||
.sort((a: any, b: any) => b.denominationValue - a.denominationValue)
|
||||
@@ -146,6 +156,7 @@ export class CashSettlementComponent implements OnInit {
|
||||
denominationId: d.denominationId,
|
||||
denominationValue: d.denominationValue,
|
||||
kind: (d.kind ?? 'note') as 'note' | 'coin',
|
||||
morningCount: morningMap.get(d.denominationId) ?? 0,
|
||||
expectedCount: d.expectedCount,
|
||||
physicalCount: d.expectedCount
|
||||
}));
|
||||
@@ -187,6 +198,12 @@ export class CashSettlementComponent implements OnInit {
|
||||
get coinRows(): SettleDenomRow[] {
|
||||
return this.rows.filter((r) => r.kind === 'coin');
|
||||
}
|
||||
get morningNoteTotal(): number {
|
||||
return this.noteRows.reduce((s, r) => s + r.morningCount * r.denominationValue, 0);
|
||||
}
|
||||
get morningCoinTotal(): number {
|
||||
return this.coinRows.reduce((s, r) => s + r.morningCount * r.denominationValue, 0);
|
||||
}
|
||||
|
||||
varianceFor(row: SettleDenomRow): number {
|
||||
return row.physicalCount - row.expectedCount;
|
||||
|
||||
Reference in New Issue
Block a user