Aman-Mittal opened a new issue, #742:
URL: https://github.com/apache/fineract-backoffice-ui/issues/742

   ## What happens
   
   On a client record (`/clients/view/{id}`), the **Loan Accounts** tab shows a 
principal of `$ 0.00` for every loan, whatever its real value.
   
   On the sandbox, client 1 has one active loan, `000000001`:
   
   | Where | Principal shown |
   |---|---|
   | Client record → Loan Accounts tab | **$ 0.00** |
   | Loan record `/loans/view/1` → Loan Terms | $ 88,888.00 |
   | `GET /loans/1` → `principal` | 88888 |
   
   This is a financial figure on the screen staff use to get an overview of a 
client's exposure, and it is wrong for every row.
   
   ## Cause
   
   `src/app/features/clients/client-view.component.ts:768`:
   
   ```html
   {{ account.originalPrincipal || 0 | number: '1.2-2' }}
   ```
   
   `GET /clients/{id}/accounts` does not return `originalPrincipal`. The loan 
entries look like this (from the live response):
   
   ```
   id, accountNo, productId, productName, shortProductName, status, currency,
   loanType, loanCycle, timeline, inArrears, originalLoan, loanBalance, 
amountPaid
   ```
   
   The principal is in `originalLoan` (88888 here). The `|| 0` fallback turns 
the missing field into a believable `0.00` instead of an obvious gap, which is 
why this went unnoticed.
   
   The template compiles because `let account` in the cdk cell is untyped. The 
generated `GetClientsLoanAccounts` model doesn't declare `originalLoan`, 
`loanBalance` or `amountPaid` either. Those fields are only modelled on 
`GetClientsWorkingCapitalLoanAccounts`.
   
   ## Fix
   
   - Bind `account.originalLoan`.
   - Add a regression test whose fixture uses the real response shape 
(`originalLoan: 88888`) and asserts on the rendered cell. The existing fixtures 
only carry `{ id, accountNo }`, so no test could have caught this.
   - Optionally, show `loanBalance` (outstanding) next to it. That's the figure 
an officer usually wants on this tab.
   
   ## Steps
   
   1. Sign in, then **Clients** → open any client that has a loan.
   2. Open the **Loan Accounts** tab: the principal reads `$ 0.00`.
   3. Open the loan itself: Loan Terms shows the real principal.
   
   ## Tested against
   
   Deployed build of `main` 
(https://aman-mittal.github.io/fineract-backoffice-ui), backend 
`sandbox.mifos.community`, Chrome 1440×900, 2026-10-16.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to