| Author |
Message |
|
rulola
|
Post subject: Currency symbols Posted: Fri Aug 28, 2009 9:50 am |
|
Joined: Fri Aug 28, 2009 8:50 am Posts: 186 Location: Miami, FL
|
|
The currency symbol defined in the Symbol left and Symbol right fields of the edit Currency window is printed out correctly with the output forms for the default currency.
The field will accept symbols like $, €, ¢ (dollar, euro and cent, respectively) but not the following ones:
₡ (CRC colon, Unicode code point U+20A1, decimal representation is 8353. In HTML ₡ ₵ cedi sign, which has a code point U+20B5 in Unicode (or 8373 in decimal).
When you copy paste the symbol into the field it is displayed correctly in the Currency window but when you save it, it changes to a question mark and that's what gets printed.
Editing currency symbols is disabled on the demo site so I was not able to try it there.
What setting do I need to change to make it work?
Ruben
|
|
 |
|
 |
|
dave
|
Post subject: Re: Currency symbols Posted: Thu Sep 10, 2009 4:31 pm |
|
Joined: Fri Oct 26, 2007 3:55 pm Posts: 3499 Location: Colorado, US
|
This is a multi-part problem, first the only fonts that are distributed with PhreeBooks are core fonts which means no higher coded characters will be displayed. Second, the reports, as distributed with PhreeBooks were originally designed for FPDF which did not support UTF-8. Now the solution: I have uploaded an extended UTF-8 font to the demo site. These came directly from the TCPDF download fonts directory. The font is called freeserif and three files are required to create a report (freeserif.ctg.z, freeserif.z and freeserif.php). They need to be placed in the /includes/addons/tcpdf/fonts directory. I then needed to add a line to the language file /modules/reportwriter/language/en_us/language.php line 32: Code: if (PDF_APP == 'TCPDF') $Fonts['freeserif'] = 'Serif';
This adds the font to the pull down menu to select for the report fields. Lastly, I copied the Sales Order report to Sales Order UTF-8 and changed the font to Serif for many of the fields. I didn't do them all because I wanted to see if this fixed the problem but I changed all the lines that I thought would need utf-8 support to print out a Sales Order. Viola, we have a utf-8 pdf file. I will add this font to the trunk and the fix to the language file. Some work will be necessary to modify the reports and forms to use the serif font. Hopefully someone will come to my rescue and change the files so I can post them on the website for download. I added your currency example to the demo so you can test it out. You can go to the demo site and generate a sales order and test out what I have done. Dave
|
|
 |
|
 |
|
rulola
|
Post subject: Re: Currency symbols Posted: Thu Sep 17, 2009 10:51 pm |
|
Joined: Fri Aug 28, 2009 8:50 am Posts: 186 Location: Miami, FL
|
|
Thanks for working it out. On the demo website it all works perfectly.
I followed your instructions to modify my setup and am able to print the reports with the freeserif fonts. Nevertheless, I can't print the currency symbol on the reports if I can't save it as symbol left in the currency window. Could you give me some guidance to the solution for the first part of the problem as your state, so I can also modify the core fonts?
_________________ Ruben.
|
|
 |
|
 |
|
julius
|
Post subject: Re: Currency symbols Posted: Fri Sep 18, 2009 8:32 am |
|
Joined: Sun Feb 03, 2008 5:25 pm Posts: 57
|
|
Please find attached all standard reports from 1.8. Changes made, 2 versions: 1) file: reports_18_sans.zip (looks like Helvetica) Helvetica => freesans helvetica => freesans File name: .rpt.txt => -utf-8.rpt.txt Report name: added " utf-8" at end.
2) file: reports_18_serif.zip (looks like Times Roman) Helvetica => freeserif helvetica => freeserif File name: .rpt.txt => -utf-8.rpt.txt Report name: added " utf-8" at end.
I hope I made the conversion right. A simple Search and Replace. ----------
Out of curiosity tried the procedure which is working on the demo site but there must be something wrong with my setting: I got only partial success. Some text did not print out at all. And the special currency symbol did print out as ?. - I hope the procedure works for you.
|
|
 |
|
 |
|
rulola
|
Post subject: Re: Currency symbols Posted: Mon Sep 28, 2009 8:36 am |
|
Joined: Fri Aug 28, 2009 8:50 am Posts: 186 Location: Miami, FL
|
|
Thanks a lot for conveting all standard reports to uf-8 for those two fonts. Let's hope we can put them to work soon.
The demo site must have a different version of the PB or some specific setting for the server. I still haven't been able to make it work on my server.
Ruben.
_________________ Ruben.
|
|
 |
|
 |
|
dave
|
Post subject: Re: Currency symbols Posted: Mon Sep 28, 2009 9:44 am |
|
Joined: Fri Oct 26, 2007 3:55 pm Posts: 3499 Location: Colorado, US
|
|
What error are your receiving? the UTF-8 fonts are not included with the standard release, you can download them with TCPDF in the fonts directory.
Dave
|
|
 |
|
 |
|
rulola
|
Post subject: Re: Currency symbols Posted: Mon Sep 28, 2009 10:14 am |
|
Joined: Fri Aug 28, 2009 8:50 am Posts: 186 Location: Miami, FL
|
|
I am not getting any error message. The fonts were downloaded, put in the correct folder and the language.php file modified as required and are working fine.
The problem is that I can't get PB to save the currency character. I copy-paste the special currency character into the currency window and it displays fine but you hit the save button, and the currency character is substituted by a question mark "?" character. The "?" is what PB saves and is what gets printed out.
If the demo site is not a modified version of 1.8, then it must be a server setting.
Ruben.
_________________ Ruben.
|
|
 |
|
 |
|
rulola
|
Post subject: Re: Currency symbols Posted: Mon Sep 28, 2009 10:35 am |
|
Joined: Fri Aug 28, 2009 8:50 am Posts: 186 Location: Miami, FL
|
|
On the demo site, I am able to save the special currency "₡" in any text field, like for example in the short_description field.
On my site, I try doing it and the same thing happens: It displays correctly until the time you hit the save button at which time it changes to the "?" character and that's what gets saved.
I am running out of the package Centos 5.3.
Ruben.
_________________ Ruben.
|
|
 |
|
 |
|
dave
|
Post subject: Re: Currency symbols Posted: Mon Sep 28, 2009 10:38 am |
|
Joined: Fri Oct 26, 2007 3:55 pm Posts: 3499 Location: Colorado, US
|
|
Are you running 1.8? Can you look into the currencies table in the database and see if the value is stored properly there?
Dave
|
|
 |
|
 |
|
rulola
|
Post subject: Re: Currency symbols Posted: Mon Sep 28, 2009 11:22 am |
|
Joined: Fri Aug 28, 2009 8:50 am Posts: 186 Location: Miami, FL
|
|
I am running 1.8 In the currencies database the currency symbol appears as a ¨?¨
In a text file, I saved the character ₡ and it saved correctly on my server, so it must be mysql.
On the server, the my.cnf for mysql did not have any reference to uf8, so I tried adding some lines I picked up on internet. I restarted both mysqld and httpd but no change.
Would I need to get the character set also for mysql?
How does this code compare to the file on your server?
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1
#Begin code added 20090928---------------- init_connect='SET collation_connection = utf8_unicode_ci' init_connect='SET NAMES utf8' default-character-set=utf8 collation_server=utf8_unicode_ci character_set_server=utf8 skip-character-set-client-handshake
[client] default-character-set=utf8
[mysql] default-character-set=utf8 #end of code added 20090928----------------
[mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
_________________ Ruben.
|
|
 |
|
 |
|
dave
|
Post subject: Re: Currency symbols Posted: Mon Sep 28, 2009 3:53 pm |
|
Joined: Fri Oct 26, 2007 3:55 pm Posts: 3499 Location: Colorado, US
|
|
Your a little beyond my scope here. It appears that your mysql install possibly wasn't set p with UTF8 character set. I don't think setting it now will help. I would install phpMyAdmin and you can change (or view) the character set there. What you have changed will affect further database operations but will not affect the currently installed tables. Dave
|
|
 |
|
 |
|
rulola
|
Post subject: Re: Currency symbols Posted: Tue Oct 13, 2009 7:38 am |
|
Joined: Fri Aug 28, 2009 8:50 am Posts: 186 Location: Miami, FL
|
|
I got it to work configuring everything on my CentOS5.3 LAMP server for utf8 and recreating the company file with utf-8 encoding.
Now the currency symbol is displayed and printer correctly.
These are all the steps I took to make sure it would work:
Add the following code to /etc/httpd/conf/httpd.conf ---------------------------------------------------- AddDefaultCharset UTF-8
Add the following code to /etc/php.ini: -------------------------------------- default_charset = "utf-8"
Add the following code to /etc/my.cnf: -------------------------------------- [mysqld] init-connect='SET collation_connection = utf8_unicode_ci' init-connect='SET NAMES utf8' default-character-set=utf8 default-collation=utf8_unicode_ci collation-server=utf8_unicode_ci character-set-server=utf8 skip-character-set-client-handshake [client] default-character-set=utf8 [mysql] default-character-set=utf8
Restart mysql and apache ------------------------ #>service mysqld restart #>service httpd restart
Backup the PhreeBooks database(substitute mydatabase for the name of your own database): ---------------------------------------------------------------------------------------- #>mysqldump --opt -u root -p mydatabase > db-mydatabase-20091013.sql
Add the following lines at the beginning of the file db-mydatabase-20091013.sql: -------------------------------------------------------------------------------- DROP DATABASE IF EXISTS mydatabase; CREATE DATABASE mydatabase DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci; USE mydatabase;
Recreate the database: ---------------------- #>mysql -u root -p < db-mydatabase-20091013.sql
_________________ Ruben.
|
|
 |
|
 |
|