feat(clerk): add collection flow — multi-DR savings to CR GL with maker-checker

- Transaction entry: detect collection mode (N DR savings → 1 CR GL) and disbursement mode (1 DR GL → N CR savings); build dbCr-tagged payload for backend
- Disbursement review: show 'GL Credit (Target)' / 'Debit Entries' labels for collection; fix double-count by summing only DR entries for collection totals; dynamic approve button text
- My disbursement requests: add DR/CR badge column in expanded credit-entries preview
- My requests / withdrawal-requests: minor consistency updates

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jaanu423
2026-06-16 15:28:27 +05:30
co-authored by Claude Sonnet 4.6
parent efb01d5441
commit 6cccb58c04
11 changed files with 345 additions and 102 deletions
@@ -45,6 +45,7 @@ export class MyDisbursementRequestsComponent implements OnInit {
requests: any[] = [];
totalRecords = 0;
expandedIds = new Set<number>();
pageSize = 20;
pageIndex = 0;
pageSizeOptions = [
@@ -164,15 +165,27 @@ export class MyDisbursementRequestsComponent implements OnInit {
this.router.navigate(['/clerk/dashboard']);
}
creditCount(req: any): number {
toggleExpand(id: number): void {
if (this.expandedIds.has(id)) {
this.expandedIds.delete(id);
} else {
this.expandedIds.add(id);
}
}
getCreditEntries(req: any): any[] {
try {
const arr = typeof req.credit_entries === 'string' ? JSON.parse(req.credit_entries) : req.credit_entries;
return Array.isArray(arr) ? arr.length : 0;
return Array.isArray(arr) ? arr.map((e: any) => ({ ...e, amount: parseFloat(e.amount) || 0 })) : [];
} catch {
return 0;
return [];
}
}
creditCount(req: any): number {
return this.getCreditEntries(req).length;
}
statusClass(status: string): string {
const map: Record<string, string> = {
PENDING: 'mdr-status--pending',