Skip to content

fix: precision issue causing reconciliation error#54043

Open
rtdany10 wants to merge 2 commits intofrappe:developfrom
rtdany10:payment-reco-issue
Open

fix: precision issue causing reconciliation error#54043
rtdany10 wants to merge 2 commits intofrappe:developfrom
rtdany10:payment-reco-issue

Conversation

@rtdany10
Copy link
Copy Markdown
Contributor

@rtdany10 rtdany10 commented Apr 6, 2026

@rtdany10 rtdany10 requested a review from ruthra-kumar as a code owner April 6, 2026 07:11
@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Apr 6, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: e9612951-0212-4dce-b9fd-67d03335f636

📥 Commits

Reviewing files that changed from the base of the PR and between ad48dfb and 460cad8.

📒 Files selected for processing (1)
  • erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py

📝 Walkthrough

Walkthrough

Modified the reconcile_dr_cr_note function in the payment reconciliation module to improve float comparison tolerance handling. The function now retrieves precision metadata from the Payment Reconciliation Allocation.allocated_amount field and applies this precision to the modified-allocation guard condition. The comparison logic changed from a raw subtraction-based check to a precision-rounded floating-point comparison using the extracted precision value. All downstream reconciliation and journal voucher creation flows remain unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: precision issue causing reconciliation error' clearly and directly describes the main change in the PR, which addresses a precision-related bug in the reconciliation logic.
Description check ✅ Passed The description references a support ticket related to the precision issue, which is topically related to the changeset addressing reconciliation precision problems.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py`:
- Around line 805-808: The conditional in payment_reconciliation.py inside the
Payment Reconciliation logic (the flt(...) < 0 check using frappe.db.get_value
on inv.voucher_type/inv.voucher_no and allocated_amount_precision) is not
ruff-formatted; run the project's formatter (ruff/black as configured) or
manually reformat that multi-line if expression so its parentheses and
indentation match the repository's formatter output (align function arguments
and closing paren correctly) and commit the change so CI passes.
🪄 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.yml

Review profile: CHILL

Plan: Pro

Run ID: 68e053ff-012a-4279-9f35-f4fe2950b63f

📥 Commits

Reviewing files that changed from the base of the PR and between b9ef061 and ad48dfb.

📒 Files selected for processing (1)
  • erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.07%. Comparing base (bb53cce) to head (460cad8).
⚠️ Report is 19 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #54043   +/-   ##
========================================
  Coverage    79.07%   79.07%           
========================================
  Files         1159     1159           
  Lines       124854   124878   +24     
========================================
+ Hits         98724    98748   +24     
  Misses       26130    26130           
Files with missing lines Coverage Δ
...e/payment_reconciliation/payment_reconciliation.py 91.85% <100.00%> (+0.02%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-tests This PR needs automated unit-tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant