Identification



Welcome, Guest
Please Login or Register.    Lost Password?

SeparatorThousand=' not allowed? Howto enquote?
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: SeparatorThousand=' not allowed? Howto enquote?
#22368
SeparatorThousand=' not allowed? Howto enquote? 1 Year, 1 Month ago Karma: 2
[Dolibarr 3.3.1]

In the main.lang, I have set the SeparatorThousand=' (=Aphostrophe).

Dolibarr convert it to the Ampersand character. This looks very ugly on my invoices and creates prices like 1&234.56 instead of 1'234.56

Is there any possibility to enquote this ' sign?
Other special characters, like the similar ` (Grave accent) sign, would work, but are not a real solution.

How can I use the familiar Apostrophe as separator for numbers bigger then 999?
DolibarUser
Senior Boarder
Posts: 54
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2013/03/20 13:57 By DolibarUser.
The administrator has disabled public write access.
 
#22383
Re: SeparatorThousand=' not allowed? Howto enquote? 1 Year, 1 Month ago Karma: 0
try to escape it with \ or / or // or \\ maybe ? i'm really not sure of the result so backup your DB first
HubZ
Senior Boarder
Posts: 52
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#22393
Re: SeparatorThousand=' not allowed? Howto enquote? 1 Year, 1 Month ago Karma: 2
Thank you for all your help!

Unfortunately, none of this suggestions works.
You can easily check it:
a) Change this line in your main.lang to
Code:

SeparatorThousand='

b) Call
Code:

http://IP-of-your-Server/dolibarr/admin/system/dolibarr.php?mainmenu=home&leftmenu=admintools_info


You can see the results immediatly like this:
Code:

=> price2num(1233.56+1)      1
=> price2num('1//'234.56')         1/234.56
=> price2num('1 234.56')           1/234.56
=> price(1234.56)                  1/234.56



The expected result is:
1'234.56
and
1'234'567.89
DolibarUser
Senior Boarder
Posts: 54
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2013/03/21 22:13 By DolibarUser.
The administrator has disabled public write access.
 
#22397
Re: SeparatorThousand=' not allowed? Howto enquote? 1 Year, 1 Month ago Karma: 4
hello,
i dont understand why you use a quote as a thousand separator; i dont think many softwares handle this...
altatof
Senior Boarder
Posts: 53
graphgraph
User Offline Click here to see the profile of this user
Gender: Male altairis Location: Goncelin (38 - France) Birthday: 01/21
The administrator has disabled public write access.
 
#22398
Re: SeparatorThousand=' not allowed? Howto enquote? 1 Year, 1 Month ago Karma: 2
This is the official syntax for Switzerland

I don't know any other software that has a problem with an apostroph. EVERY sign should be possible using some similar command to the php htmlspecialchars internally
DolibarUser
Senior Boarder
Posts: 54
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#22400
Re: SeparatorThousand=' not allowed? Howto enquote? 1 Year, 1 Month ago Karma: 2
What I found so far:
I can calculate my single products correctly if I use the mentioned ` (Grave accent) sign as SeparatorThousand.

If I change the SeparatorThousand to the desired ' (Apostrophe) and then patch the function price in the function.lib.php with something like this around line 2972
Code:

if ($thousand === " & # 0 3 9 ; ") $output=number_format($amount, $nbdecimal, $dec, "'");
I get the numbers correctly, even in a new calculated PDF invoice.

BUT
As soon as I recalculate a single product, the calculation goes wrong...

There must be an error with this special character ' (Apostrophe, ASCII 39). The function price seems to get a html encoded entity & # 0 3 9 ; instead of the single character '
DolibarUser
Senior Boarder
Posts: 54
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#22422
Re: SeparatorThousand=' not allowed? Howto enquote? 1 Year, 1 Month ago Karma: 147
Support for ' will be available with 3.4
eldy
Administrateur
Posts: 1363
graph
User Offline Click here to see the profile of this user
Gender: Male Site web personnel Location: Rueil Malmaison
Laurent Destailleur (alias eldy, Dolibarr grade: Yoda).
- Dolibarr in the Cloud: DoliCloud, the OpenSource hosting solution for your Dolibar ERP & CRM.
- Android app for Dolibarr: DoliDroid
The administrator has disabled public write access.
 
#22435
Re: SeparatorThousand=' not allowed? Howto enquote? 1 Year ago Karma: 2
Thank you very much for this commit! It works great!
DolibarUser
Senior Boarder
Posts: 54
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1