Skip to content
Snippets Groups Projects
Commit c3f4c739 authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] account: monetaryIsZero

An issue arises in the following use case:
- Company rounding policy in "round globally"
- Tax excluded of 20 %
- Create a statement of 3.80 EUR
- Reconcile the statement thanks to the reconciliation widget
- Click on "Choose counterpart" in order to manually create a line to
  reconcile with the 3.80 EUR statement
- Add an amount of 3.17 EUR, and choose the 20 % tax

The widget creates an extra line of 0.00EUR . This is because the
remaining amount is 0.004.

The reason lies in the `monetaryIsZero` function. There is a hardcoded
decimal precision of 4, while it should be 2 for EUR.

We add an extra parameter to the function so it is possible to adjust
the decimal precision required. Only the problematic calls are modified
to avoid unnecessary intrusive modification.

Closes #13452
opw-688399
parent 143ec373
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment