Skip to content
Snippets Groups Projects
Commit 2d7d240c authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

FIX the time spent on project was not visible in its overwiew

parent 7d27e011
No related branches found
No related tags found
No related merge requests found
......@@ -348,7 +348,7 @@ $listofreferent=array(
'table'=>'projet_task',
'datefieldname'=>'task_date',
'disableamount'=>0,
'test'=>$conf->projet->enabled && $user->rights->projet->lire && $conf->salaries->enabled && empty($conf->global->PROJECT_HIDE_TASKS)),
'test'=>$conf->projet->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS)),
);
if ($action=="addelement")
......@@ -815,6 +815,9 @@ foreach ($listofreferent as $key => $value)
if ($tablename == 'don') $total_ht_by_line=$element->amount;
elseif ($tablename == 'projet_task')
{
if (! empty($conf->salaries->enabled))
{
// TODO Permission to read daily rate
$tmp = $element->getSumOfAmount($elementuser, $dates, $datee); // $element is a task. $elementuser may be empty
$total_ht_by_line = price2num($tmp['amount'],'MT');
if ($tmp['nblinesnull'] > 0)
......@@ -824,6 +827,11 @@ foreach ($listofreferent as $key => $value)
}
}
else
{
print $langs->trans("ModuleDisabled");
}
}
else
{
$total_ht_by_line=$element->total_ht;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment