feat(cashier): integrate expected balance, settlement verification, and reconciliation checks

This commit is contained in:
Jaanu423
2026-05-28 22:30:08 +05:30
parent 7ccaffa7f1
commit 6433ae068d
10 changed files with 1362 additions and 201 deletions
@@ -73,6 +73,7 @@ export class ReconciliationComponent implements OnInit {
cashierName = '';
reconDate = '';
note = '';
varianceReason = '';
rows: DenomRow[] = [];
loadingExpected = false;
saving = false;
@@ -162,7 +163,11 @@ export class ReconciliationComponent implements OnInit {
return v === 0 ? 'OK' : v > 0 ? 'EXCESS' : 'SHORT';
}
get valid(): boolean {
return !!this.selectedCashierId && this.rows.length > 0;
return (
!!this.selectedCashierId &&
this.rows.length > 0 &&
(this.totalVariance === 0 || this.varianceReason.trim().length > 0)
);
}
submit(): void {
@@ -173,7 +178,13 @@ export class ReconciliationComponent implements OnInit {
tellerId: this.selectedTellerId,
cashierName: this.cashierName,
reconDate: this.reconDate,
note: this.note || null,
note:
[
this.note,
this.totalVariance !== 0 ? `Variance reason: ${this.varianceReason}` : null
]
.filter(Boolean)
.join(' | ') || null,
denominations: this.rows.map((r) => ({
denominationId: r.denominationId,
denominationValue: r.denominationValue,
@@ -190,6 +201,7 @@ export class ReconciliationComponent implements OnInit {
});
this.rows = [];
this.note = '';
this.varianceReason = '';
this.saving = false;
this.loadHistory();
},