Merge branch '8.0' of https://github.com/Dolibarr/dolibarr.git into 8.0_bug
This commit is contained in:
commit
fcb97a58da
@ -384,16 +384,16 @@ abstract class Stats
|
|||||||
$row = $this->db->fetch_object($resql);
|
$row = $this->db->fetch_object($resql);
|
||||||
$result[$i]['year'] = $row->year;
|
$result[$i]['year'] = $row->year;
|
||||||
$result[$i]['nb'] = $row->nb;
|
$result[$i]['nb'] = $row->nb;
|
||||||
if($i>0 && $row->nb) $result[$i-1]['nb_diff'] = ($result[$i-1]['nb'] - $row->nb) / $row->nb * 100;
|
if($i>0 && $row->nb>0) $result[$i-1]['nb_diff'] = ($result[$i-1]['nb'] - $row->nb) / $row->nb * 100;
|
||||||
$result[$i]['total'] = $row->total;
|
$result[$i]['total'] = $row->total;
|
||||||
if($i>0 && $row->total) $result[$i-1]['total_diff'] = ($result[$i-1]['total'] - $row->total) / $row->total * 100;
|
if($i>0 && $row->total>0) $result[$i-1]['total_diff'] = ($result[$i-1]['total'] - $row->total) / $row->total * 100;
|
||||||
$result[$i]['avg'] = $row->avg;
|
$result[$i]['avg'] = $row->avg;
|
||||||
if($i>0 && $row->avg) $result[$i-1]['avg_diff'] = ($result[$i-1]['avg'] - $row->avg) / $row->avg * 100;
|
if($i>0 && $row->avg>0) $result[$i-1]['avg_diff'] = ($result[$i-1]['avg'] - $row->avg) / $row->avg * 100;
|
||||||
// For some $sql only
|
// For some $sql only
|
||||||
if (isset($row->weighted))
|
if (isset($row->weighted))
|
||||||
{
|
{
|
||||||
$result[$i]['weighted'] = $row->weighted;
|
$result[$i]['weighted'] = $row->weighted;
|
||||||
if($i>0 && $row->weighted) $result[$i-1]['avg_weighted'] = ($result[$i-1]['weighted'] - $row->weighted) / $row->weighted * 100;
|
if($i>0 && $row->weighted>0) $result[$i-1]['avg_weighted'] = ($result[$i-1]['weighted'] - $row->weighted) / $row->weighted * 100;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user