Graph le ca achat
This commit is contained in:
parent
d0153ef5b8
commit
0cb5dff90c
@ -84,7 +84,7 @@ foreach ($fournisseurs as $id => $fdir)
|
|||||||
{
|
{
|
||||||
$values = array();
|
$values = array();
|
||||||
$legends = array();
|
$legends = array();
|
||||||
$sql = "SELECT year, ca_genere";
|
$sql = "SELECT year, ca_genere, ca_achat";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."fournisseur_ca";
|
$sql .= " FROM ".MAIN_DB_PREFIX."fournisseur_ca";
|
||||||
$sql .= " WHERE fk_societe = $id";
|
$sql .= " WHERE fk_societe = $id";
|
||||||
$sql .= " ORDER BY year ASC";
|
$sql .= " ORDER BY year ASC";
|
||||||
@ -96,7 +96,8 @@ foreach ($fournisseurs as $id => $fdir)
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while ($row = $db->fetch_row($resql))
|
while ($row = $db->fetch_row($resql))
|
||||||
{
|
{
|
||||||
$values[$i] = $row[1];
|
$values_gen[$i] = $row[1];
|
||||||
|
$values_ach[$i] = $row[2];
|
||||||
$legends[$i] = $row[0];
|
$legends[$i] = $row[0];
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
@ -111,11 +112,19 @@ foreach ($fournisseurs as $id => $fdir)
|
|||||||
require_once DOL_DOCUMENT_ROOT."/../external-libs/Artichow/BarPlot.class.php";
|
require_once DOL_DOCUMENT_ROOT."/../external-libs/Artichow/BarPlot.class.php";
|
||||||
|
|
||||||
$file = $fdir ."ca_genere-".$id.".png";
|
$file = $fdir ."ca_genere-".$id.".png";
|
||||||
$title = "CA généré en euros HT";
|
$title = "CA généré par ce fournisseur (euros HT)";
|
||||||
|
|
||||||
graph_datas($file, $title, $values, $legends);
|
graph_datas($file, $title, $values_gen, $legends);
|
||||||
if ($verbose)
|
if ($verbose)
|
||||||
print "$file\n";
|
print "$file\n";
|
||||||
|
|
||||||
|
$file = $fdir ."ca_achat-".$id.".png";
|
||||||
|
$title = "CA avec ce fournisseur (euros HT)";
|
||||||
|
|
||||||
|
graph_datas($file, $title, $values_ach, $legends);
|
||||||
|
if ($verbose)
|
||||||
|
print "$file\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function graph_datas($file, $title, $values, $legends)
|
function graph_datas($file, $title, $values, $legends)
|
||||||
@ -148,6 +157,8 @@ function graph_datas($file, $title, $values, $legends)
|
|||||||
$plot->barShadow->setColor(new Color(180, 180, 180, 10));
|
$plot->barShadow->setColor(new Color(180, 180, 180, 10));
|
||||||
$plot->barShadow->smooth(TRUE);
|
$plot->barShadow->smooth(TRUE);
|
||||||
|
|
||||||
|
$plot->xAxis->hideTicks();
|
||||||
|
|
||||||
$plot->xAxis->setLabelText($legends);
|
$plot->xAxis->setLabelText($legends);
|
||||||
$plot->xAxis->label->setFont(new Tuffy(7));
|
$plot->xAxis->label->setFont(new Tuffy(7));
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user