Change automatically calculated quantity and list quantity to 2 decimal places

This commit is contained in:
Ralf Becker 2014-09-10 11:02:26 +00:00
parent 9210a652cc
commit a8088acfe0

View File

@ -175,7 +175,7 @@ class timesheet_ui extends timesheet_bo
case 'apply': case 'apply':
if ((!$this->data['ts_quantity'] || $this->ts_viewtype == 'short') && $this->data['ts_duration']) // set the quantity (in h) from the duration (in min) if ((!$this->data['ts_quantity'] || $this->ts_viewtype == 'short') && $this->data['ts_duration']) // set the quantity (in h) from the duration (in min)
{ {
$this->data['ts_quantity'] = $this->data['ts_duration'] / 60.0; $this->data['ts_quantity'] = round($this->data['ts_duration'] / 60.0, 2);
} }
if (!$this->data['ts_quantity']) if (!$this->data['ts_quantity'])
{ {
@ -733,6 +733,10 @@ class timesheet_ui extends timesheet_bo
$row['titleClass'] = 'timesheet_titleSum'; $row['titleClass'] = 'timesheet_titleSum';
continue; continue;
} }
if($row['ts_quantity'])
{
$row['ts_quantity'] = round($row['ts_quantity'], 2);
}
if (!$this->check_acl(EGW_ACL_EDIT,$row)) if (!$this->check_acl(EGW_ACL_EDIT,$row))
{ {
$row['class'] .= ' rowNoEdit '; $row['class'] .= ' rowNoEdit ';