Steps to reproduce the bug:
- Create a product P with price=100€
- Configure payment aquier Paypal with fees_int_fixed = 1€ and fees_int_var = 1%
- Set Paypal to be available in the website
- Go to the web shop and add P in the cart
- Choose to pay with Paypal
Bug:
The amout to pay was 102.02€ instead of 102.01€
Before the fix, the fees was computed as followed:
fees = (percentage / 100.0 * amount + fixed) / (1 - percentage / 100.0)
Where fees_dom_fixed = fixed and fees_int_var = percentage
With this computation, the percentage was applied twice.
If for example, we had fixed = 0 then
fees = (percentage / 100.0 * amount) / (1 - percentage / 100.0)
In this case, it's easy to see that the percentage is applied twice.
opw:1981784
closesodoo/odoo#33830
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>