Aman-Mittal opened a new issue, #791: URL: https://github.com/apache/fineract-backoffice-ui/issues/791
#### Summary The **Create Loan** form submits an application without ever showing the officer the instalments those terms produce. The first time anyone sees the schedule is after the record exists, on the loan's **Repayment Schedule** tab. Fineract can calculate the schedule for unsaved terms, but the form doesn't use it. #### Current behavior - `/loans/create?clientId=…` is a single form: product, principal, term, repayments, rate, interest and amortization types, grace, and dates. **Save** posts straight to `POST /loans`. - The form has no preview step, no "calculate schedule" action, and no summary of the instalment amount, total interest or the first and last repayment dates. - `src/app/features/loans/loan-form.component.ts` on `main` @ `8da1086f` contains no `calculateLoanSchedule` call. #### Expected behavior Before submitting, the officer can calculate and review the schedule for the terms on screen: - each instalment's date, principal, interest, fees and total; - totals for principal, interest and amount repayable. The officer can change a term and recalculate, then submit once satisfied. #### Steps to reproduce 1. Open a client and choose **New Account → Loan Account**. 2. Select a loan product. The terms are pre-filled, for example 10,000 over 6 monthly repayments at 12%. 3. Look for any way to see the resulting instalments before pressing **Save**. There is none. #### User impact - Officers commit to terms blind and only find out the instalment amount after the application exists. This matters for affordability conversations, where a client needs to know their monthly payment before agreeing. - A wrong term means withdrawing or rejecting the application and creating a new one, which leaves clutter in the loan list and the audit trail. - Approvers lose nothing, since pending loans already show a schedule; the gap is only at the point of capture. #### Evidence The form as an officer sees it after choosing a product: all terms are filled in, and the only actions are Cancel and Save.  For the same product and terms, `POST /loans?command=calculateLoanSchedule` on the demo backend returns six instalments (31 days, 1,725.48 each; the last is 1,725.51) and total interest of 352.91. These match what the Repayment Schedule tab shows once the loan is created, so the preview would be exact. #### Proposed improvement - Add a **Preview schedule** step or button. It sends the current form payload to `POST /loans?command=calculateLoanSchedule` and renders the result with the same schedule table component the loan view already uses. - Show a compact summary above the table: instalment amount, number of instalments, total interest, total repayable, and first and last due dates. - Mark the preview as stale when any term changes after calculation, and offer **Recalculate**. - Show calculation errors (for example, a term outside the product's limits) next to the field concerned, without losing the entered values. #### Acceptance criteria - [ ] With valid terms, the officer can view the calculated schedule and totals before saving, and the values match what the created loan shows. - [ ] Changing a term after previewing marks the preview stale until it is recalculated. - [ ] Validation errors from the calculation keep the form's values and point at the offending field. - [ ] Previewing doesn't create a loan. Only **Save** does, and **Save** still requires `CREATE_LOAN`. - [ ] Unit tests cover the preview request payload, the stale-state handling and the error mapping. #### Verification status Reproduced on the deployed `main` (2026-10-16), superuser, tenant `default`. The calculation endpoint was confirmed with the same terms on the demo backend. #### Related API capabilities - `POST /v1/loans?command=calculateLoanSchedule` takes the same body as `POST /v1/loans` and returns the schedule periods and totals without persisting anything (`LoansApiResource.calculateLoanScheduleOrSubmitLoanApplication`). - `POST /v1/loans` (existing). Related: #781 (tranche schedule at application), whose `disbursementData` should also feed the preview. -- 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]
