fix(cashier): post closure interest for real when the checkbox is ticked
Ticking "Close this account" on the Transaction Entry Action popup called
GET /clerk/closure-requests/preview/{id} -- a dry run that computed the
payout and immediately rolled it back, so the account's own balance stayed
unchanged until a manager later approved the closure.
Wired to the new POST /clerk/closure-requests/post-interest/{id} instead
(see the matching backend commit), which posts the interest for real and
returns the account's actual resulting balance. Renamed
ClerkClosureRequestService#preview to #postClosureInterest to match, and
reworded the popup copy and loading state so it no longer implies posting
happens later at Save ("posted to the account as of ..." instead of
"calculated to ... and posted the moment you press Save").
Also corrected a stale comment on the balance-check bypass for a pending
closure: it used to justify the bypass by saying interest was NOT YET
posted, which stopped being true the moment the checkbox itself started
posting it for real.
This commit is contained in:
@@ -1804,7 +1804,7 @@
|
||||
|
||||
@if (closeAccountChecked) {
|
||||
@if (closurePreviewLoading) {
|
||||
<div class="te-aa-calc te-aa-calc--loading">Calculating interest to date…</div>
|
||||
<div class="te-aa-calc te-aa-calc--loading">Posting interest to the account…</div>
|
||||
} @else if (closurePreviewError) {
|
||||
<div class="te-aa-calc te-aa-calc--error">{{ closurePreviewError }}</div>
|
||||
} @else if (closurePreview) {
|
||||
@@ -1813,10 +1813,20 @@
|
||||
<span>Current Balance</span>
|
||||
<span>₹{{ closurePreview.balance | number: '1.2-2' }}</span>
|
||||
</div>
|
||||
<div class="te-aa-calc__row">
|
||||
<span>Interest to date</span>
|
||||
<span>+ ₹{{ closurePreview.interest | number: '1.2-2' }}</span>
|
||||
</div>
|
||||
@if (closurePreview.interest < 0) {
|
||||
<!-- Negative only when this run corrects interest that was over-posted earlier: the
|
||||
delta is against the stored balance, so calling it "interest" would read as the
|
||||
member being charged. The Payable figure below is the authoritative one either way. -->
|
||||
<div class="te-aa-calc__row">
|
||||
<span>Interest correction</span>
|
||||
<span>− ₹{{ -closurePreview.interest | number: '1.2-2' }}</span>
|
||||
</div>
|
||||
} @else {
|
||||
<div class="te-aa-calc__row">
|
||||
<span>Interest to date</span>
|
||||
<span>+ ₹{{ closurePreview.interest | number: '1.2-2' }}</span>
|
||||
</div>
|
||||
}
|
||||
<div class="te-aa-calc__row te-aa-calc__row--total">
|
||||
<span>Payable on Closure</span>
|
||||
<span>₹{{ closurePreview.total | number: '1.2-2' }}</span>
|
||||
@@ -1828,8 +1838,8 @@
|
||||
</div>
|
||||
}
|
||||
<div class="te-aa-calc__note">
|
||||
Interest calculated to {{ closurePreview.asOfDate }} using the same calculation the closure itself
|
||||
performs. Cash is handed over rounded to whole rupees.
|
||||
Interest has been posted to the account as of {{ closurePreview.asOfDate }} — this is the account's real
|
||||
balance now, not an estimate. Cash is handed over rounded to whole rupees.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user