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?
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
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”.