Fix output of fields with type "real"

This commit is contained in:
Laurent Destailleur 2019-04-13 10:42:43 +02:00
parent ebe8f27c16
commit 8e9a4e1877
2 changed files with 12 additions and 4 deletions

View File

@ -452,11 +452,13 @@ while ($i < min($num, $limit))
foreach($object->fields as $key => $val)
{
$cssforfield='';
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
elseif ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap';
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right';
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap';
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) $cssforfield.=($cssforfield?' ':'').'right';
if (! empty($arrayfields['t.'.$key]['checked']))
{

View File

@ -6130,6 +6130,12 @@ abstract class CommonObject
$value=price($value);
}
}
elseif ($type == 'real')
{
if (!empty($value)) {
$value=price($value);
}
}
elseif ($type == 'boolean')
{
$checked='';