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:
→ 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:
→ 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 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.
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:
And here it is in the generated PDF:
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:
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.
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.
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):
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):
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.
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:
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?
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.