Price format on ODT template

Hi everybody,
i have a problem formatting prices on odt template.

for the variable {line_up} i get the value formatted as “0000,00”

for the variable {line_price_ht} i get the value formatted as “0000” if there are no decimals. Instead if there are some decimals in the total it’s formatted as “0000.00”

I want that all the values are formatted as “0000,00” (italian decimals) how i can get it?

Thank you in advance guys

Hi there, quick update.
I changed language from italian to english and i get all the price formatted as “0000.00”.
i still getting for {line_price_ht} the format “0000” if the sum of prices has no decimals (EX: if the sum of prices is 5432,00 i get “5432”; if the sum is 5432,10 i get “5432,10”. Instead i always want the format “0000.00”

It seems that when i change language, it change format just for the variable {line_up} and not for the others, but just into the ODT variables, cause into the facture module i see all the prices formatted correctly.

Please, someone can explain me? Thank you in advance

Hum, looks like a bug. I think this will be fixed with 3.5 version.

eldy wrote:

Is there any news when 3.5 version will be released?

Cheers!

Hmmm,
I’ve just come to the forum in search of the same topic…

I had version 3.1.0. installed and I was using ODT template to create invoices. The prices looked like this:
3.564,00
67,75
870,90

I’ve installed the version 3.4.0. and now the prices look like this:
3564
67.75
870.9

When I generate a “crabe” PDF everything is OK (like I want it in version 3.1.0.)

Is this also a BUG? How can I fix this?

Hi,

For invoice see here Version 3.4.0 Problem with Invoice Template .odt

Jeeeees,
I’m an programmer… hahahaha

It works!
Thanks!
I’m so happy…

Hi, this problem persists in the version 3.7.0. I solved it changing some lines in the file [ROOTDOLIBARR]/core/class/commondocgenerator.class.php

Replace the function “price2num” to “price” from line 356 to 361 and from 513 to 515.
Here an example:
[…]
$array_key.’_total_ht’=>price($object->total_ht),
$array_key.’_total_vat’=>price($object->total_tva),
$array_key.’_total_localtax1’=>price($object->total_localtax1),
$array_key.’_total_localtax2’=>price($object->total_localtax2),
$array_key.’_total_ttc’=>price($object->total_ttc),
$array_key.’_total_discount_ht’ => price($object->getTotalDiscount()),
[…]

In general you need to replace the function near the tags “_ht”, “_ttc”, “tva”.

Use this instead of modify code

{object_total_ht_locale}
object_total_vat_locale}
{object_total_ttc_locale}
{line_up_locale}
{line_price_ht_locale}

http://wiki.dolibarr.org/index.php/Create_an_ODT_document_template#Object_information_.28invoice.2C_commercial_proposal.2C_order.2C_....29
See “Amounts (in output language format):”