feat(cashier,organization): denomination-aware vault UI, Bank/Branch Profile screens, popup disbursement review
Branch Day open/close now captures a denomination-wise count (carried forward automatically to the next day), and shows an auto-fetched EOD summary at close time -- vault + every cashier's position, a branch-total reconciliation against the book figure, and each cashier's reconciliation/settlement status and transaction count -- so closing the day no longer means separately checking Vault Position and every cashier's own screen by hand. New Vault Position screen (branch-ops menu) mirrors Cashier Position for the teller/vault. Cash Transfer now shows the vault's live per-denomination availability while counting a handout, with a client-side warning before it can be over-counted. New Organization screens for Bank Profile, Branch Profile and Clearing GL Configuration, wired into the Organization landing page and the previously-dead "Bank Profile" admin menu button. Cashier Transaction Entry: TYPE is now Receipt/Payment only (cash-only TXN TP.) on the cashier side, with no change to the clerk dashboard's own Withdrawal Slip/Cheque/Disbursement/Enter Bank Transfer/DD flow beyond adding a new Fund Transfer type alongside Disbursement for a GL credit that isn't a loan payout. Neither TYPE nor TXN TP. offers a blank placeholder option anymore -- a new row starts on a real default instead. Footer no longer polls the business-date config for cashier/clerk roles, who never have permission to read it. Disbursement & Transfer Requests: "Review" now opens the review screen as a popup instead of navigating to a separate route, refreshing the list on close; the review screen recognises the new Fund Transfer request type too, and its non-functional "+ Disbursement Review" tab-styled label is now a plain heading. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import { FormsModule } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
@@ -33,7 +34,8 @@ interface CreditEntry {
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
MatSnackBarModule,
|
||||
MatIconModule
|
||||
MatIconModule,
|
||||
MatDialogModule
|
||||
],
|
||||
templateUrl: './disbursement-review.component.html',
|
||||
styleUrl: './disbursement-review.component.scss'
|
||||
@@ -43,6 +45,11 @@ export class DisbursementReviewComponent implements OnInit {
|
||||
private router = inject(Router);
|
||||
private service = inject(ClerkDisbursementService);
|
||||
private snackBar = inject(MatSnackBar);
|
||||
/** Present only when opened as a popup from the requests list; absent when reached by direct
|
||||
* route (e.g. a bookmarked/shared link). Both entry points stay supported — this only changes
|
||||
* how "done" is signalled: closing the dialog vs. navigating back to the inbox route. */
|
||||
private dialogRef = inject(MatDialogRef<DisbursementReviewComponent>, { optional: true });
|
||||
private dialogData = inject<{ requestId: number } | null>(MAT_DIALOG_DATA, { optional: true });
|
||||
|
||||
requestId: number | null = null;
|
||||
request: any = null;
|
||||
@@ -53,9 +60,17 @@ export class DisbursementReviewComponent implements OnInit {
|
||||
showRejectForm = false;
|
||||
rejectionReason = '';
|
||||
|
||||
get isDialog(): boolean {
|
||||
return !!this.dialogRef;
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
const id = this.route.snapshot.params['id'];
|
||||
this.requestId = id != null ? Number(id) : null;
|
||||
if (this.dialogData?.requestId) {
|
||||
this.requestId = this.dialogData.requestId;
|
||||
} else {
|
||||
const id = this.route.snapshot.params['id'];
|
||||
this.requestId = id != null ? Number(id) : null;
|
||||
}
|
||||
if (this.requestId) this.loadRequest();
|
||||
}
|
||||
|
||||
@@ -93,9 +108,11 @@ export class DisbursementReviewComponent implements OnInit {
|
||||
} else {
|
||||
const msg = this.isBankTransferMode
|
||||
? 'Bank transfer approved successfully.'
|
||||
: 'Disbursement approved successfully.';
|
||||
: this.isFundTransferMode
|
||||
? 'Fund transfer approved successfully.'
|
||||
: 'Disbursement approved successfully.';
|
||||
this.snackBar.open(msg, 'Close', { duration: 3000 });
|
||||
this.router.navigate(['/checker-inbox-and-tasks/disbursement-requests']);
|
||||
this.finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -112,15 +129,31 @@ export class DisbursementReviewComponent implements OnInit {
|
||||
this.snackBar.open(res.error, 'Close', { duration: 5000 });
|
||||
} else {
|
||||
this.snackBar.open('Request rejected.', 'Close', { duration: 3000 });
|
||||
this.router.navigate(['/checker-inbox-and-tasks/disbursement-requests']);
|
||||
this.finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** "Done" for this screen — closes the popup (telling the list to refresh) when opened as a
|
||||
* dialog, or returns to the inbox route otherwise. */
|
||||
private finish(): void {
|
||||
if (this.dialogRef) {
|
||||
this.dialogRef.close({ refreshed: true });
|
||||
} else {
|
||||
this.router.navigate(['/checker-inbox-and-tasks/disbursement-requests']);
|
||||
}
|
||||
}
|
||||
|
||||
get isBankTransferMode(): boolean {
|
||||
return this.request?.request_type === 'BANK_TRANSFER';
|
||||
}
|
||||
|
||||
/** Mechanically identical to a Disbursement (same 1 GL debit -> N account credits flow) — only
|
||||
* the label differs, so a checker doesn't read this as a loan payout. */
|
||||
get isFundTransferMode(): boolean {
|
||||
return this.request?.request_type === 'FUND_TRANSFER';
|
||||
}
|
||||
|
||||
get isCollectionMode(): boolean {
|
||||
if (this.isBankTransferMode) return false;
|
||||
return this.creditEntries.some((e) => e.dbCr === 'Dr');
|
||||
@@ -189,6 +222,10 @@ export class DisbursementReviewComponent implements OnInit {
|
||||
}
|
||||
|
||||
backToInbox(): void {
|
||||
this.router.navigate(['/checker-inbox-and-tasks/disbursement-requests']);
|
||||
if (this.dialogRef) {
|
||||
this.dialogRef.close();
|
||||
} else {
|
||||
this.router.navigate(['/checker-inbox-and-tasks/disbursement-requests']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user