fix(chequebook,cashier): surface real hold/lien amount instead of fake placeholders
- 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:
co-authored by
Claude Sonnet 5
parent
24b1d7c087
commit
ed2a40a8bf
@@ -681,7 +681,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="te-balance-row">
|
<div class="te-balance-row">
|
||||||
<span class="te-bal-num">4.</span><span class="te-bal-label">Freeze Amount</span>
|
<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>
|
||||||
<div class="te-balance-row">
|
<div class="te-balance-row">
|
||||||
<span class="te-bal-num">5.</span><span class="te-bal-label">Withdrawable Amt.</span>
|
<span class="te-bal-num">5.</span><span class="te-bal-label">Withdrawable Amt.</span>
|
||||||
@@ -746,7 +746,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="te-bal-item">
|
<div class="te-bal-item">
|
||||||
<span class="te-bal-item__label">Transfer Hold</span>
|
<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>
|
||||||
<div class="te-bal-item">
|
<div class="te-bal-item">
|
||||||
<span class="te-bal-item__label">Clearing Hold</span>
|
<span class="te-bal-item__label">Clearing Hold</span>
|
||||||
@@ -862,7 +862,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="te-acs-b">
|
<div class="te-acs-b">
|
||||||
<span class="te-acs-b-l">Tr. Hold</span>
|
<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>
|
||||||
<div class="te-acs-b">
|
<div class="te-acs-b">
|
||||||
<span class="te-acs-b-l">Clr. Hold</span>
|
<span class="te-acs-b-l">Clr. Hold</span>
|
||||||
|
|||||||
@@ -1999,12 +1999,29 @@ export class TransactionEntryComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get freezeAmount(): number {
|
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 {
|
get withdrawableAmount(): number {
|
||||||
const avail = this.accountDetails?.summary?.availableBalance ?? this.currentBalance;
|
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 {
|
get currencySymbol(): string {
|
||||||
|
|||||||
@@ -350,6 +350,16 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</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) {
|
@if (savingsAccountData.withHoldTax) {
|
||||||
<div class="nx-row">
|
<div class="nx-row">
|
||||||
<span class="nx-row__label">{{ 'labels.inputs.Withhold Tax Group' | translate }}</span>
|
<span class="nx-row__label">{{ 'labels.inputs.Withhold Tax Group' | translate }}</span>
|
||||||
|
|||||||
@@ -2513,6 +2513,7 @@
|
|||||||
"Offices Loan Products": "Offices --> Loan Products",
|
"Offices Loan Products": "Offices --> Loan Products",
|
||||||
"Offices Savings Products": "Offices --> Savings Products",
|
"Offices Savings Products": "Offices --> Savings Products",
|
||||||
"On Arrears Aging": "On Arrears Aging",
|
"On Arrears Aging": "On Arrears Aging",
|
||||||
|
"On Hold Amount (Lien)": "On Hold Amount (Lien)",
|
||||||
"On Hold Funds": "On Hold Funds",
|
"On Hold Funds": "On Hold Funds",
|
||||||
"On Month Day": "On Month Day",
|
"On Month Day": "On Month Day",
|
||||||
"On arrears ageing": "On arrears ageing",
|
"On arrears ageing": "On arrears ageing",
|
||||||
|
|||||||
Reference in New Issue
Block a user