From 6442562df01732ff98f19229f5854909e8e34850 Mon Sep 17 00:00:00 2001 From: Nitesh Yadav Date: Thu, 3 Sep 2026 10:47:07 +0530 Subject: [PATCH] feat(tasks): show payout amount on the Closure Review popup while PENDING The manager's Closure Review dialog only showed the amount once the request reached APPROVED or later -- closing_amount/rounding_amount/cashier_disbursed_amount were null on a PENDING record, since the backend only filled them in at approve() time. A manager reviewing a still-pending closure saw client name, payout mode and token, but no figure to actually approve. The backend now populates those columns at submission (interest is posted for real at that point, so the figure is already known -- see the matching backend commit), so this just stops gating the amount card on closing_amount != null and moves it to the top of the dialog as "Payout Amount", shown for every status. Also added: Closure Date ("Interest Posted As On"), Transaction Id once close() has run, and a "Handed Over By Cashier" section once disbursed -- so the full lifecycle of a closure is visible from one dialog instead of needing to cross-reference the account's own transaction history. --- .../closure-review-dialog.component.html | 77 +++++++++++++------ .../closure-review-dialog.component.ts | 10 +++ 2 files changed, 64 insertions(+), 23 deletions(-) diff --git a/src/app/tasks/checker-inbox-and-tasks-tabs/closure-requests/closure-review-dialog/closure-review-dialog.component.html b/src/app/tasks/checker-inbox-and-tasks-tabs/closure-requests/closure-review-dialog/closure-review-dialog.component.html index a330b0317..d337a8b36 100644 --- a/src/app/tasks/checker-inbox-and-tasks-tabs/closure-requests/closure-review-dialog/closure-review-dialog.component.html +++ b/src/app/tasks/checker-inbox-and-tasks-tabs/closure-requests/closure-review-dialog/closure-review-dialog.component.html @@ -58,6 +58,41 @@ + +
+
+ payments + Payout Amount +
+
+
+ Exact Closing Amount + ₹{{ request.closing_amount | number: '1.2-2' }} +
+ @if (request.rounding_amount && request.rounding_amount !== 0) { +
+ Rounding ({{ request.rounding_amount > 0 ? 'up' : 'down' }}) + {{ request.rounding_amount > 0 ? '+' : '' }}₹{{ request.rounding_amount | number: '1.2-2' }} +
+ } +
+ Cash to Hand Over + ₹{{ request.cashier_disbursed_amount | number: '1.2-2' }} +
+ @if (request.voucher_no) { +
+ Voucher No + {{ request.voucher_no }} +
+ } +
+
+
@@ -77,6 +112,16 @@ Token No {{ request.tok_no || '—' }}
+
+ Interest Posted As On + {{ formatDate(request.closure_date) }} +
+ @if (request.txn_id) { +
+ Transaction Id + {{ request.txn_id }} +
+ } @if (request.description) {
Reason / Narration @@ -86,36 +131,22 @@
- - @if (request.closing_amount != null) { -
+ + @if (request.status === 'CLOSED' && request.disbursed_at) { +
- calculate - Computed at Approval + storefront + Handed Over By Cashier
- Exact Closing Amount - ₹{{ request.closing_amount | number: '1.2-2' }} + Cashier + {{ request.disbursed_by || '—' }}
- @if (request.rounding_amount && request.rounding_amount !== 0) { -
- Rounding ({{ request.rounding_amount > 0 ? 'up' : 'down' }}) - {{ request.rounding_amount > 0 ? '+' : '' }}₹{{ request.rounding_amount | number: '1.2-2' }} -
- }
- Cash to Hand Over - ₹{{ request.cashier_disbursed_amount | number: '1.2-2' }} + Disbursed At + {{ formatDateTime(request.disbursed_at) }}
- @if (request.voucher_no) { -
- Voucher No - {{ request.voucher_no }} -
- }
} diff --git a/src/app/tasks/checker-inbox-and-tasks-tabs/closure-requests/closure-review-dialog/closure-review-dialog.component.ts b/src/app/tasks/checker-inbox-and-tasks-tabs/closure-requests/closure-review-dialog/closure-review-dialog.component.ts index 432ea649e..a42277df7 100644 --- a/src/app/tasks/checker-inbox-and-tasks-tabs/closure-requests/closure-review-dialog/closure-review-dialog.component.ts +++ b/src/app/tasks/checker-inbox-and-tasks-tabs/closure-requests/closure-review-dialog/closure-review-dialog.component.ts @@ -128,6 +128,16 @@ export class ClosureReviewDialogComponent implements OnInit { return n.toLocaleString('en-IN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }); } + formatDate(val: any): string { + if (!val) return '—'; + try { + const d = new Date(val); + return d.toLocaleDateString('en-IN', { day: '2-digit', month: 'short', year: 'numeric' }); + } catch { + return String(val); + } + } + formatDateTime(val: any): string { if (!val) return '—'; try {