When you try to delete voucher from order in Back-office, you get Prestashop Exception about total_discounts_tax_excl not valid.
I have 5% discount on whole order for all orders above 2000 CZK with tax, without shipping fee. I have 0 decimal places, 21% VAT, default rounding style and rounding of each line.
If you try to delete this voucher in back-office, you get the exception nearly everytime. Only sometimes, when the calculation is "lucky", it doesn't happen.
The problem happens in all OPC modules and in default cart. Happens in all payment modules.
All the information and an example order is shown in screenshots.
There is some weird rounding, sometimes the resulting tax_excl value is higher that tax_incl, sometimes it is negative etc.
$order_cart_rule->delete(); gets processed correctly and the voucher is gone
$order->update(); is not and throws the exception, due to wrong values, so there is a discount left in the order.