Total amounts of several invoices are not the same in Invoice Ninja v5 after migration from v4

Hello,

I’ve performed the migration from Invoice Ninja v4 (latest update) to Invoice Ninja v5 (latest update) and the total amounts of several invoices are not the same in v5 than in v4.

There is absolutely no difference in line total amounts. The issue seems to appear in Subtotal and is thus also in the Total. It looks like a rounding issue, because the difference is about 1 or 2 cents as far as I’ve checked…

If I sum the line totals manually, I have the same subtotal as Invoice Ninja v4… Except one or two times, I always had the same total amounts in generated HTML and PDF with v4. With v5, I have the same difference (rounding issue) in HTML and PDF.

The only possible cause I can think about is that I often have products and services with prices having 3 to 4 decimals… So if Invoice Ninja v5 does not sum the line totals, it could be the root cause…

This is really weird, because for paid invoices, the payment is greater or smaller than the new calculated total…

What could be done to get the same subtotals and totals as Invoice Ninja v4 in Invoice Ninja v5?

Thank you in advance for your help.

Best Regards,
tcedi

Hi,

Are you able to provide an example showing an invoice in v4 and v5?

Feel free to email it to contact@invoiceninja.com rather than post it publicly.

cc @david

Hi,

Sure, I’ve sent the e-Mail with the details.

It seems that Invoice Ninja v4 sums the line totals.
Invoice Ninja v5 seems to calculate the line price by multiplying the unit price per the quantity while keeping all the decimals, make the sum of all the lines and round only once. But it also rounds unit prices to 2 decimals in the generated PDF, which can look even weirder from a customer point of view…