Skip to content

WEB-657: Working Capital Loan charge adjustment#3728

Open
alberto-art3ch wants to merge 1 commit into
openMF:devfrom
alberto-art3ch:WEB-657/working-capital-loan-charge-adjustment-full-paid
Open

WEB-657: Working Capital Loan charge adjustment#3728
alberto-art3ch wants to merge 1 commit into
openMF:devfrom
alberto-art3ch:WEB-657/working-capital-loan-charge-adjustment-full-paid

Conversation

@alberto-art3ch

@alberto-art3ch alberto-art3ch commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

We are adding the functionality to allow the user will be able to do charge adjustment transaction on active loan accounts, even if the Loan Charge is fully paid

Related issues and discussion

WEB-657

Screenshots, if any

Screen.Recording.2026-07-17.at.8.14.01.AM.mov

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • If you have multiple commits please combine them into one commit by squashing them.

  • Read and understood the contribution guidelines at web-app/.github/CONTRIBUTING.md.

Summary by CodeRabbit

  • Bug Fixes
    • Prevented template errors when overdue charge data is missing.
  • Behavior Changes
    • Updated the Charges tab “Actions” area to show only for loan statuses Active and Submitted and pending approval.
    • Refined charge action visibility for active loans so Edit/Pay/Waive only appears when an outstanding amount exists, while Adjustment remains available.
  • Navigation Improvements
    • Preserved loan product context when navigating between loan and charge screens by adding query parameters.

@alberto-art3ch
alberto-art3ch requested a review from a team July 17, 2026 13:16
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key: "pre_merge_checks"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f4b92ae0-ee87-4290-b9d4-c7c78756ea9a

📥 Commits

Reviewing files that changed from the base of the PR and between 929b1ee and b43ca51.

📒 Files selected for processing (3)
  • src/app/loans/loans-view/charges-tab/charges-tab.component.html
  • src/app/loans/loans-view/loans-view.component.html
  • src/app/loans/loans-view/view-charge/view-charge.component.html
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/app/loans/loans-view/view-charge/view-charge.component.html
  • src/app/loans/loans-view/loans-view.component.html
  • src/app/loans/loans-view/charges-tab/charges-tab.component.html

Walkthrough

Loan charge templates restrict actions by loan status and outstanding balance, preserve product type during charge navigation, and safely handle missing overdue-charge data.

Changes

Loan charge UI updates

Layer / File(s) Summary
Charge action visibility
src/app/loans/loans-view/charges-tab/charges-tab.component.html, src/app/loans/loans-view/view-charge/view-charge.component.html, src/app/loans/loans-view/loans-view.component.html
Actions are conditionally rendered for applicable loan statuses and balances, and the overdue-charges tab uses a null-safe length check.
Charge navigation context
src/app/loans/loans-view/charges-tab/charges-tab.component.html, src/app/loans/loans-view/view-charge/view-charge.component.html
Charge-row and back-button navigation now pass the current product type as a query parameter.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is specific and matches the main change: working capital loan charge adjustment support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/app/loans/loans-view/view-charge/view-charge.component.html (1)

18-18: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use an appropriate icon for the Edit action.

The editCharge() button currently uses the flag icon, which is identical to the icon used for waiveCharge() below. Consider updating it to a more intuitive icon for editing.

🎨 Proposed fix
-        <fa-icon icon="flag" class="m-r-10"></fa-icon>
+        <fa-icon icon="pencil" class="m-r-10"></fa-icon>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/app/loans/loans-view/view-charge/view-charge.component.html` at line 18,
Update the icon used by the editCharge() button from "flag" to an appropriate
edit/pencil icon, while leaving the waiveCharge() button's flag icon unchanged.
src/app/loans/loans-view/charges-tab/charges-tab.component.html (1)

284-311: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Add permission guards to charge actions.

The action buttons in this menu lack *mifosxHasPermission directives. For consistency with other components (like view-charge) and to prevent unauthorized users from seeing restricted actions, consider adding the appropriate permission checks (e.g., 'UPDATE_LOANCHARGE', 'DELETE_LOANCHARGE', 'PAY_LOANCHARGE', 'WAIVE_LOANCHARGE').

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/app/loans/loans-view/charges-tab/charges-tab.component.html` around lines
284 - 311, Add mifosxHasPermission guards to the charge action buttons in the
menu: use UPDATE_LOANCHARGE for adjust/edit, DELETE_LOANCHARGE for delete,
PAY_LOANCHARGE for pay, and WAIVE_LOANCHARGE for waive. Preserve the existing
status and charge-state conditions while preventing unauthorized users from
seeing these actions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/app/loans/loans-view/view-charge/view-charge.component.html`:
- Around line 12-46: Update the permission directives in the view-charge
template for all charge actions to use the corresponding loan-charge permissions
instead of savings-account permissions. Change the Edit action to use the loan
charge update permission rather than waive, and update the Pay, Waive, and
pending-approval Edit/Delete actions consistently while preserving their
existing click handlers and visibility conditions.

---

Nitpick comments:
In `@src/app/loans/loans-view/charges-tab/charges-tab.component.html`:
- Around line 284-311: Add mifosxHasPermission guards to the charge action
buttons in the menu: use UPDATE_LOANCHARGE for adjust/edit, DELETE_LOANCHARGE
for delete, PAY_LOANCHARGE for pay, and WAIVE_LOANCHARGE for waive. Preserve the
existing status and charge-state conditions while preventing unauthorized users
from seeing these actions.

In `@src/app/loans/loans-view/view-charge/view-charge.component.html`:
- Line 18: Update the icon used by the editCharge() button from "flag" to an
appropriate edit/pencil icon, while leaving the waiveCharge() button's flag icon
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 502a0d08-0bac-4651-9b34-83b43192fa0b

📥 Commits

Reviewing files that changed from the base of the PR and between e3cb18e and 4170860.

📒 Files selected for processing (4)
  • src/app/home/reporting-dashboard/reporting-dashboard.component.ts
  • src/app/loans/loans-view/charges-tab/charges-tab.component.html
  • src/app/loans/loans-view/loans-view.component.html
  • src/app/loans/loans-view/view-charge/view-charge.component.html
💤 Files with no reviewable changes (1)
  • src/app/home/reporting-dashboard/reporting-dashboard.component.ts

Comment thread src/app/loans/loans-view/view-charge/view-charge.component.html
@alberto-art3ch
alberto-art3ch force-pushed the WEB-657/working-capital-loan-charge-adjustment-full-paid branch from 4170860 to 7c016d3 Compare July 19, 2026 16:31

@adamsaghy adamsaghy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adamsaghy
adamsaghy force-pushed the WEB-657/working-capital-loan-charge-adjustment-full-paid branch from 7c016d3 to 929b1ee Compare July 20, 2026 19:18
@alberto-art3ch
alberto-art3ch force-pushed the WEB-657/working-capital-loan-charge-adjustment-full-paid branch from 929b1ee to b43ca51 Compare July 20, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants