Skip to content
Snippets Groups Projects
Commit 0d3445b8 authored by Rodolphe Quiedeville's avatar Rodolphe Quiedeville
Browse files

Graph tous les comptes

parent 69e9e7d4
Branches
Tags
No related merge requests found
...@@ -38,8 +38,6 @@ $datetime = time(); ...@@ -38,8 +38,6 @@ $datetime = time();
$month = strftime("%m", $datetime); $month = strftime("%m", $datetime);
$year = strftime("%Y", $datetime); $year = strftime("%Y", $datetime);
$account = 1;
if ($month == 1) if ($month == 1)
{ {
$monthprev = "12"; $monthprev = "12";
...@@ -60,6 +58,35 @@ else ...@@ -60,6 +58,35 @@ else
$monthnext = substr("00".($month + 1), -2) ; $monthnext = substr("00".($month + 1), -2) ;
} }
$sql = "SELECT distinct(fk_account)";
$sql .= " FROM ".MAIN_DB_PREFIX."bank";
$sql .= " WHERE date_format(datev,'%Y%m') = '".$year.$month."'";
$resql = $db->query($sql);
$amounts = array();
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$row = $db->fetch_row($resql);
array_push($accounts, $row[0]);
$i++;
}
}
$account = 1;
foreach ($accounts as $account)
{
$sql = "SELECT sum(amount)"; $sql = "SELECT sum(amount)";
$sql .= " FROM ".MAIN_DB_PREFIX."bank"; $sql .= " FROM ".MAIN_DB_PREFIX."bank";
...@@ -154,6 +181,6 @@ $graph->img->SetImgFormat("png"); ...@@ -154,6 +181,6 @@ $graph->img->SetImgFormat("png");
$file= DOL_DATA_ROOT."/graph/banque/solde.$account.png"; $file= DOL_DATA_ROOT."/graph/banque/solde.$account.png";
$graph->Stroke($file); $graph->Stroke($file);
}
?> ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment