Cosmetic defects in PDF view when unit cost values are negative

Hello,

We’re having some refunding items in our invoices and we’re treating them as negative unit cost. Everything is fine until the PDF generation turns out unexpected inconsistent.

When the value is a 1-digit negative number, the display is numerically correct (only numerically - note that how the minus sign is awkwardly placed after the $ and I believe it’s not the way how negative values are expressed in professional accounting):
https://i.imgur.com/tstvoXR.png

When the value is a 2 (or more)-digit whole negative number, the .00 decimal part is stripped. The line total column still shows the value numerically correct:
https://i.imgur.com/WeHvg3J.png

To be continued below due to link/image restrictions…

Okay, new post. Hope that the restrictions are now lifted.

But when it’s not a whole number anymore, the decimal part returns:
https://i.imgur.com/eCheZ1D.png

Probably this inconsistence stems from snappdf as the values are still calculated properly. I haven’t tried to alter the HTML, maybe it can temporarily fix the issue but I do think it’s something worth addressing here. The placement of the minus sign is also inconsistent with how negative values are expressed elsewhere in the app:
https://i.imgur.com/89gUrWb.png

There is still an open issue #2667 in Github mentioning how minus sign should be placed. But professional finance documents almost universally put negative value in parentheses, or even in red. There should be at least an option for user to decide how the values should be shown.

Guys, what do you think?

Hi,

@david any thoughts?

We’ll get a fix in for this, thanks for reporting.

@david The line total seems good now but the unit cost is still showed incorrectly. I open a new issue here:
Negative figures still displayed in correctly in unit cost · Issue #8323 · invoiceninja/invoiceninja (github.com)

@NhanNTWPV

Thanks for reporting, i’ve checked in a fix

@david Just updated to the latest v5.5.82-C109 and the issue still remains

I have a fix for this in the next release.