You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "Aman-Mittal (via GitHub)" <gi...@apache.org> on 2026/10/16 07:57:09 UTC
[I] Working Capital loan: add charge-off, write-off, their undo actions, and recovery payment [fineract-backoffice-ui]
Aman-Mittal opened a new issue, #772:
URL: https://github.com/apache/fineract-backoffice-ui/issues/772
## Summary
The UI cannot record a loss on a Working Capital loan, and cannot record recoveries on such a loan once it is written off. Fineract supports the whole charge-off / write-off / recovery cycle for these loans.
## Evidence (`main` @ `8da1086f`)
- `wc-loan-action-form.component.ts` has no `chargeOff`, `undoChargeOff`, `writeOff`, `undoWriteOff` or `recoveryPayment` branch.
- `wc-loan-view.component.ts` offers no such menu items.
## Platform support
`POST /v1/working-capital-loans/{loanId}/transactions?command=…`, with `GET …/transactions/template?command=…` for defaults and reason codes:
| Command | Notes |
|---|---|
| `chargeOff` | takes a charge-off reason (code value); posts to the product's charge-off GL mapping |
| `undoChargeOff` | reverses the latest charge-off |
| `writeOff` | takes a write-off reason; closes the loan as written off |
| `undoWriteOff` | allowed only while no recovery has been posted |
| `recoveryPayment` | records money recovered after a write-off |
## Proposed implementation
- Add the five actions to the loan's action menu, routed to `wc-loan-action-form` with reason pickers sourced from the template.
- Show each action only in the status where it is valid:
- **Charge-off:** active, not yet charged off.
- **Undo charge-off:** charged off.
- **Write-off:** active.
- **Undo write-off:** written off with no recoveries.
- **Recovery payment:** written off.
- Use a destructive-styled `DialogService.confirm` before write-off and both undo actions.
## RBAC
| Action | Permission code | Typically granted to |
|---|---|---|
| Charge-off | `CHARGEOFF_WORKINGCAPITALLOAN` | credit-risk manager, head of collections |
| Undo charge-off | `UNDOCHARGEOFF_WORKINGCAPITALLOAN` | credit-risk manager (not the maker) |
| Write-off | `WRITEOFF_WORKINGCAPITALLOAN` | credit committee / senior manager |
| Undo write-off | `UNDOWRITEOFF_WORKINGCAPITALLOAN` | senior manager / finance |
| Recovery payment | `RECOVERYPAYMENT_WORKINGCAPITALLOAN` | collections officer, teller |
These are loss-recognition events. Institutions commonly put them under maker-checker, so the UI must handle the "submitted for approval" response and must never show these actions to a role that only holds `REPAYMENT_WORKINGCAPITALLOAN` or `UPDATE_WORKINGCAPITALLOAN`.
### How Fineract evaluates these permissions
- A write passes with the exact code **or** `ALL_FUNCTIONS`. Reads pass with `ALL_FUNCTIONS_READ`.
- Maker-checker queues the command for a `<CODE>_CHECKER` holder.
- All codes above are in `scripts/permission-codes.json`.
### UI expectations
- Use a per-command permission map, as `LOAN_COMMAND_PERMISSIONS` does for regular loans.
- Guard the route per command.
- Gate each menu item with `[appRequiresPermission]`.
- Read-only roles see no enabled actions.
## Acceptance criteria
- [ ] Each action posts the right command with its reason, and the loan's status and transactions update.
- [ ] Actions appear only in valid states. Undo write-off is blocked once a recovery exists.
- [ ] Gating is per code, a direct URL without the code redirects to `/forbidden`, and maker-checker responses are surfaced.
- [ ] Unit tests cover state visibility, payloads and permission gating.
--
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: issues-unsubscribe@fineract.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Working Capital loan: add charge-off, write-off, their undo actions, and recovery payment [fineract-backoffice-ui]
Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal commented on issue #772:
URL: https://github.com/apache/fineract-backoffice-ui/issues/772#issuecomment-6211139038
## Business process flow (loss recognition and recovery)
```mermaid
stateDiagram-v2
[*] --> Active
Active --> ChargedOff: chargeOff + reason\n(CHARGEOFF_WORKINGCAPITALLOAN)
ChargedOff --> Active: undoChargeOff\n(UNDOCHARGEOFF_WORKINGCAPITALLOAN)
Active --> WrittenOff: writeOff + reason\n(WRITEOFF_WORKINGCAPITALLOAN)
ChargedOff --> WrittenOff: writeOff\n(WRITEOFF_WORKINGCAPITALLOAN)
WrittenOff --> Active: undoWriteOff, only if no recoveries\n(UNDOWRITEOFF_WORKINGCAPITALLOAN)
WrittenOff --> WrittenOff: recoveryPayment\n(RECOVERYPAYMENT_WORKINGCAPITALLOAN)
```
```mermaid
sequenceDiagram
actor Maker as Collections officer (maker)
participant UI as Backoffice UI
participant F as Fineract
actor Checker as Credit-risk manager (checker)
Maker->>UI: Write-off loan, choose reason
UI->>UI: hasPermission(WRITEOFF_WORKINGCAPITALLOAN)?
UI->>F: POST /working-capital-loans/{id}/transactions?command=writeOff
F-->>UI: queued (maker-checker on)
UI-->>Maker: "Submitted for approval"
Checker->>F: Approve in Checker Inbox (WRITEOFF_WORKINGCAPITALLOAN_CHECKER)
F-->>F: Post write-off journal entries via product GL mapping
```
## UI mockup
```text
┌ Working Capital Loan #000123 · Active · 95 days past due ────────────────┐
│ [⋮ More actions] │
│ ├ Charge-off … ← CHARGEOFF_WORKINGCAPITALLOAN │
│ ├ Write-off … ← WRITEOFF_WORKINGCAPITALLOAN │
│ └ (Undo charge-off / Undo write-off / Recovery payment appear only │
│ in the states shown in the diagram above) │
└──────────────────────────────────────────────────────────────────────────┘
┌ Write-off loan ──────────────────────────────────── ⚠ destructive ───────┐
│ Outstanding to write off 32,410.00 │
│ Write-off date * [ 2026-10-16 📅 ] │
│ Reason * [ Borrower insolvent ▾ ] (code values) │
│ Note [ ] │
│ This closes the loan as written off. Undo is blocked once a recovery │
│ payment is posted. │
│ [Cancel] [Write off loan] │
└──────────────────────────────────────────────────────────────────────────┘
```
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Working Capital loan: add charge-off, write-off, their undo actions, and recovery payment [fineract-backoffice-ui]
Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal closed issue #772: Working Capital loan: add charge-off, write-off, their undo actions, and recovery payment
URL: https://github.com/apache/fineract-backoffice-ui/issues/772
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Working Capital loan: add charge-off, write-off, their undo actions, and recovery payment [fineract-backoffice-ui]
Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal commented on issue #772:
URL: https://github.com/apache/fineract-backoffice-ui/issues/772#issuecomment-6211157047
**Correction to the state diagram above:** its line breaks rendered as a literal `\n`. Corrected diagram:
```mermaid
stateDiagram-v2
[*] --> Active
Active --> ChargedOff: chargeOff + reason<br/>CHARGEOFF_WORKINGCAPITALLOAN
ChargedOff --> Active: undoChargeOff<br/>UNDOCHARGEOFF_WORKINGCAPITALLOAN
Active --> WrittenOff: writeOff + reason<br/>WRITEOFF_WORKINGCAPITALLOAN
ChargedOff --> WrittenOff: writeOff<br/>WRITEOFF_WORKINGCAPITALLOAN
WrittenOff --> Active: undoWriteOff, only if no recoveries<br/>UNDOWRITEOFF_WORKINGCAPITALLOAN
WrittenOff --> WrittenOff: recoveryPayment<br/>RECOVERYPAYMENT_WORKINGCAPITALLOAN
```
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org