Invoice currency display on PDFs do not match admin panel currency display (v5.2.11-C53)

Hello,

Recently, my invoices started displaying monetary values differently from my currency settings are (custom CA_Fr CAD). In the admin panel, everything displays fine as per my settings, for instance:

image

→ space thousand separator, OK
→ comma decimal separator, OK
→ space before $ sign on the right, OK

Well, here is how my PDFs now render the monetary values:
image

→ comma thousand separator, not OK
→ period decimal separator, not OK
→ space before $ sign on the right, OK - that’s what makes it weird: it’s a mix and match of different settings. In default (EN) CAD, the dollar sign is on the left with no space before the numbers.

What is even weirder is that the PDF renders the currencies without a problem in the design preview, as shown here with random data:

I thus seems that something happens with my actual invoices, whereas the seeded data from the html designer works fine…

Any ideas about what might be happening under the hood?

Thanks

EDIT:

Two new invoices created minutes apart differ in the way they render the currencies:

Invoice 1, wrong:

Invoice 2, as intended:

I have no idea what is going on!

@david @ben do you any thoughts?

UPDATE:

I tried purging all my IN files (besides the database) and then I did a clean install. I also flushed my browser cache. My PDFs still don’t match my currency settings, whereas the admin UI does. :pensive:

Hello @hillel @david and @ben,

I could reproduce the issue on demo.invoiceninja.com.

Since my edited fr_CAD is not available there I created a new client for which I selected at random the Polish currency. Then I created an invoice with random data.

Here is the currency display in the admin panel for that invoice:

image

And here it is in the generated PDF:

image

In the PDF:
“,” → “.”
“zł” → " zł"
sign on the left → sign on the right

Now if I switch the main company currency to the Polish Zloty, it’s not even the same in the admin panel as the invoice in that currency:

image

This time, the zł sign is on the right with a space before… with a comma and not a period, which is the correct value BTW according to the default currencies tab in my database.

So basically for a single currency we have three different displays, only one of which is right according to my database (v5.2.11-C53).

Thanks in advance for looking into that :slight_smile:

Hello,

This issue appears fixed in v5.2.13-C56, at least for new invoices, thank you.

However, my invoices created prior to v5.2.13-C56 still show the wrong currency format. Is there anything I can do to update them? I tried opening and saving them (without making other changes, as those invoices are sent), but it didn’t fix the PDFs. It’s not a big deal since further invoices look like they will be displaying monetary values correctly and that’s what matters, but if possible my archives would match the proper format, too.

Thanks!

Hi @hillel and @david,

Actually the issue is still there in v5.2.14-C56: currency formats do not always match between admin panel and PDFs.

As evidence, here is the admin panel invoice summary (from the public demo - once again tried with the Polish currency) :

Generated PDF (from public demo):

Notice how the currency sign is on the left in the admin panel and on the right on the PDF.

Now here is my own data:

Admin panel:

And the PDF (space is now a comma and comma is now a period):

image

The issue does not always happen though (some invoices print perfectly fine), and I can’t figure what triggers it.

Any help would be appreciated please!

Thank you for the screenshots, they’re very helpful!

cc @david @ben

Hi @hillel, @david and @ben,

I think I found the source of the problem (on my system) - thanks to the new live PDF preview that helped me see changes when swapping clients.

So here it goes: whenever I set a client billing country to Canada, it overrules my default currency settings for numbers (the dollar sign on the right is OK):

image

If I erase the country in the billing address, now the PDF displays the currency numbers fine (as per my database settings and also on par with the currency display in the admin panel):

image

I tested this with several clients and it fixed (well, it got around) the issue every time.

Is there a way for the client billing country to not overrule the currency settings? I know that I’m not running the default CAD settings, but I must do that dirty db fix while waiting for an official introduction of the FR CAD currency, as discussed here Forcing reloading “currencies” tab in db (after editing CAD for CA_FR).

I guess that anyone else also running IN with custom currency settings might run into the same problem, too when setting a country in the client billing address.

Thanks!

@charles

We haven’t forgotten about this. It is on the backlog to implement. We’ve just been snowed under with some other pressing tasks.

1 Like

Thanks for the update! :slight_smile: :pray:

Hello @david,

The issue seems to still be there as of v5.4.4.

I could use the workaround previously of not inputting the country name, but now it seems that I can’t leave the Country field blank in client details: well I can, but it will get autofilled to the default upon saving (Canada, in my case).

So here is an example of what I get with new clients:

Admin - comma used as decimal separator:

PDF - period used as decimal separator:
image

Do you still plan on correcting this bug? And if that’s deep in the backlog, could it still be possible to leave a country field blank in client details and not autofill it please?

Thanks in advance.

Hello again @david,

Actually please don’t mind my previous inquiry, I managed to fix the issue myself! I found out that whereas the admin UI only uses seems to use the “currencies” table in the database to display monetary values, the PDF uses a mix of “currencies” and “countries”, the latter of which having columns that overlaps the settings set in “currencies”, such as “thousand separator” and “decimal separator”. I just modified these in the countries tab along the “Canada” line in the db to match the currencies tab and now my invoices do show the intended separators.

Cheers!

@charles

Thanks for following up!

1 Like