fix(chequebook,cashier): surface real hold/lien amount instead of fake placeholders
build-run / Run Lint, Build and Deploy (push) Canceled after 0s
Publish Image in Docker Hub / build (push) Canceled after 0s
Playwright E2E Tests / Run Playwright Tests (push) Canceled after 0s
Tests / testRigor (push) Canceled after 0s

- Savings account general tab now shows the real lien/user hold
  (savingsAmountOnHold) alongside the existing guarantor hold (onHoldFunds).
- Cashier transaction-entry "Transfer Hold" / "Tr. Hold" now bind to the real
  freezeAmount instead of a hardcoded 0.00 placeholder; "Freeze Amount" itself
  reverted to 0.00 per request. withdrawableAmount no longer double-subtracts
  the hold for savings accounts (whose availableBalance is already
  hold-adjusted server-side), while current accounts (whose availableBalance
  is not) still get the client-side subtraction they need.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Jaanu423
2026-07-16 15:06:58 +05:30
co-authored by Claude Sonnet 5
parent 24b1d7c087
commit ed2a40a8bf
4 changed files with 33 additions and 5 deletions
@@ -681,7 +681,7 @@
</div>
<div class="te-balance-row">
<span class="te-bal-num">4.</span><span class="te-bal-label">Freeze Amount</span>
<span class="te-bal-value">{{ currencySymbol }}{{ freezeAmount | number: '1.2-2' }}</span>
<span class="te-bal-value">{{ currencySymbol }}0.00</span>
</div>
<div class="te-balance-row">
<span class="te-bal-num">5.</span><span class="te-bal-label">Withdrawable Amt.</span>
@@ -746,7 +746,7 @@
</div>
<div class="te-bal-item">
<span class="te-bal-item__label">Transfer Hold</span>
<span class="te-bal-item__val">0.00</span>
<span class="te-bal-item__val">{{ freezeAmount | number: '1.2-2' }}</span>
</div>
<div class="te-bal-item">
<span class="te-bal-item__label">Clearing Hold</span>
@@ -862,7 +862,7 @@
</div>
<div class="te-acs-b">
<span class="te-acs-b-l">Tr. Hold</span>
<span class="te-acs-b-v">0.00</span>
<span class="te-acs-b-v">{{ freezeAmount | number: '1.2-2' }}</span>
</div>
<div class="te-acs-b">
<span class="te-acs-b-l">Clr. Hold</span>
@@ -1999,12 +1999,29 @@ export class TransactionEntryComponent implements OnInit, OnDestroy {
}
get freezeAmount(): number {
return this.accountDetails?.summary?.holdAmountBalance ?? 0;
// Savings exposes the lien/user hold as root-level `savingsAmountOnHold`; Current exposes its
// own (differently-sourced) hold as `onHoldFunds`. `summary.holdAmountBalance` never existed in
// either API response, so this always read 0 before.
const acTyp = this.selectedRow?.acTyp;
const isCurrent = acTyp === 'CA' || acTyp === 'CB';
if (isCurrent) {
return this.accountDetails?.onHoldFunds ?? this.accountDetails?.summary?.onHoldFunds ?? 0;
}
return this.accountDetails?.savingsAmountOnHold ?? 0;
}
get withdrawableAmount(): number {
const avail = this.accountDetails?.summary?.availableBalance ?? this.currentBalance;
return Math.max(0, avail - this.freezeAmount);
const acTyp = this.selectedRow?.acTyp;
const isCurrent = acTyp === 'CA' || acTyp === 'CB';
// Savings' availableBalance is already computed hold-adjusted on the backend (subtracts both
// guarantor and lien holds) — subtracting freezeAmount again here would double-count it.
// Current's availableBalance is just the raw balance and does NOT subtract its hold, so it
// still needs freezeAmount subtracted client-side.
if (isCurrent) {
return Math.max(0, avail - this.freezeAmount);
}
return Math.max(0, avail);
}
get currencySymbol(): string {
@@ -350,6 +350,16 @@
</span>
</div>
}
@if (savingsAccountData.savingsAmountOnHold) {
<div class="nx-row">
<span class="nx-row__label">{{ 'labels.inputs.On Hold Amount (Lien)' | translate }}</span>
<span class="nx-row__value nx-row__value--amount">
<a *mifosxHasPermission="'READ_SAVINGSACCOUNT'">
{{ savingsAccountData.savingsAmountOnHold | currency: currency.code : 'symbol-narrow' : '1.2-2' }}
</a>
</span>
</div>
}
@if (savingsAccountData.withHoldTax) {
<div class="nx-row">
<span class="nx-row__label">{{ 'labels.inputs.Withhold Tax Group' | translate }}</span>
+1
View File
@@ -2513,6 +2513,7 @@
"Offices Loan Products": "Offices --> Loan Products",
"Offices Savings Products": "Offices --> Savings Products",
"On Arrears Aging": "On Arrears Aging",
"On Hold Amount (Lien)": "On Hold Amount (Lien)",
"On Hold Funds": "On Hold Funds",
"On Month Day": "On Month Day",
"On arrears ageing": "On arrears ageing",