[Vtigercrm-commits] [vtiger development] #5398: Dotted display of huge currency values
vtiger development
vtiger-tickets at trac.vtiger.com
Wed Nov 12 14:16:01 EST 2008
#5398: Dotted display of huge currency values
-----------------------+----------------------------------------------------
Reporter: elmue.gmx | Owner: developer
Type: defect | Status: new
Priority: minor | Milestone: 5.1.0
Component: vtigercrm | Version: 5.0.4
Keywords: |
-----------------------+----------------------------------------------------
Big currency amounts are displayed in vtiger as
30000000
This is really ugly!
You have to count the zeros to see if this is 300 millions or 30 millions.
You can easily make a heavy error when entering big amounts without even
noticing it.
If you live in a country where big values are usual
(e.g. where a television costs 1 million Pesos and a car costs 30 million
Pesos)
it is nearly impossible to work with vtiger!
First:
=======
This patch contains a bugfix which avoids that big currency values are
displayed as
1E+6 in the Potentials Amount field instead of 1000000.
Second:
=======
This patch displays all currencies in the form "300.000.000".
Currently vtiger is developed by programmers who do not know anything
about REUSABLE code.
The programmers of vtiger have a very ugly Copy and Paste mentality.
Instead of writing ONE function which does ALL the formatting of
currencies
they repeat the code to format currencies by copy and paste in each
module.
An intelligent software design NEVER uses Copy and Paste to copy the same
code to 10 places!
I introduced a new function
currencyDotFormat($amount) in the file CommonUtils.php
which from now on does the formatting of currencies.
This function is called from ALL places to format currency display.
If you want your own, different way of formatting numbers you have to
modify only this ONE function
and vtiger will display your new number format in all places.
Third:
======
When editing an amount value in the potentials you will notice that the
textbox does not contain dots in the number.
An amount of "300.000.000" will still be edited as "300000000".
This is necessary to avoid Java Script errors and problems in other
places.
Only the DISPLAY of currency values is modified by my patch, not the other
functionality like editing.
For that it was necessary to introduce an additional value which is passed
to the template DetailViewUI.tpl:
keyval = 300000000
keydisplay = 300.000.000
See this thread for the download of the modified code and a screenshot:
http://forums.vtiger.com/viewtopic.php?p=73159
Elmü
--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/5398>
vtiger development <http://trac.vtiger.com/>
vtigerCRM
More information about the vtigercrm-commits
mailing list