invoice: payment: refactor rounding logic

Respect the correct amount of decimal places for each currency.

Note that upgrading an existing system with that patch can yield to
non-deterministic results as the pro-ration code has been changed to
support 9 decimal places: this will lead to different pro-ration amounts
due to rounding.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>