Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5
erp5
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Merge Requests 114
    • Merge Requests 114
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Jobs
  • Commits
  • nexedi
  • erp5erp5
  • Merge Requests
  • !1272

Merged
Opened Sep 23, 2020 by Jérome Perrin@jerome
  • Report abuse
Report abuse

accounting: fix validation of accounting transactions with too precise amounts

Round the amounts line by line when validating transactions balances and showing the totals on an accounting transaction.

Even though float field configurations do not allow users to input transactions where amounts uses more digits that what makes sense for the selected currency, we had cases where some transactions generated by custom scripts were "too precise" and passed the validation because unlike in all reports where we display sum of rounded values, the check was only rounding the sum, which cause some transactions with 1.00 on one side and 0.333333 0.333333 and 0.333333 on the other side to be valid.

The scripts used to display sums on an accounting transaction had the same problem, they were also showing the rounded sum and not the sum of rounded values.

Edited Sep 23, 2020 by Jérome Perrin
  • Discussion 5
  • Commits 1
  • Pipelines 3
  • Changes 11
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: nexedi/erp5!1272

Revert this commit

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this commit

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备14008524号