/[dolibarr]/dolibarr/htdocs/telephonie/stats/commerciaux/commercial.ca.class.php
ViewVC logotype

Diff of /dolibarr/htdocs/telephonie/stats/commerciaux/commercial.ca.class.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by rodolphe, Thu Dec 1 14:32:36 2005 UTC revision 1.3 by rodolphe, Thu Dec 1 15:02:19 2005 UTC
# Line 24  require_once (DOL_DOCUMENT_ROOT."/teleph Line 24  require_once (DOL_DOCUMENT_ROOT."/teleph
24    
25  class GraphCommercialChiffreAffaire extends GraphBar {  class GraphCommercialChiffreAffaire extends GraphBar {
26    
27    Function GraphCommercialChiffreAffaire($DB, $file)    Function GraphCommercialChiffreAffaire($DB, $file, $year=0)
28    {    {
29      $this->db = $DB;      $this->db = $DB;
30      $this->file = $file;      $this->file = $file;
31        $this->year = $year;
32      $this->client = 0;      $this->client = 0;
33      $this->titre = "Chiffre d'affaire";      $this->titre = "Chiffre d'affaire";
34        if ($this->year > 0)
35          {
36            $this->titre .= " ".$year;
37          }
38      $this->barcolor = "blue";      $this->barcolor = "blue";
39      $this->showframe = true;      $this->showframe = true;
40    }    }
# Line 44  class GraphCommercialChiffreAffaire exte Line 47  class GraphCommercialChiffreAffaire exte
47        {        {
48          $sql = "DELETE FROM ".MAIN_DB_PREFIX."telephonie_stats";              $sql = "DELETE FROM ".MAIN_DB_PREFIX."telephonie_stats";    
49          $sql .= " WHERE graph='commercial.ca.mensuel.".$commercial."';";          $sql .= " WHERE graph='commercial.ca.mensuel.".$commercial."';";
50            if ($this->year > 0)
51              {
52                $sql .= " AND legend like '".$this->year."%'";
53              }
54          $resql = $this->db->query($sql);          $resql = $this->db->query($sql);
55        }        }
56    
# Line 53  class GraphCommercialChiffreAffaire exte Line 60  class GraphCommercialChiffreAffaire exte
60      $sql .= " , ".MAIN_DB_PREFIX."telephonie_societe_ligne as l";      $sql .= " , ".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
61      $sql .= " WHERE l.rowid = f.fk_ligne";      $sql .= " WHERE l.rowid = f.fk_ligne";
62      $sql .= " AND l.fk_commercial_sign = ".$commercial;      $sql .= " AND l.fk_commercial_sign = ".$commercial;
63        if ($this->year > 0)
64          {
65            $sql .= " AND date_format(f.date,'%Y')='".$this->year."'";
66          }
67      $sql .= " GROUP BY date_format(f.date,'%Y%m') ASC";      $sql .= " GROUP BY date_format(f.date,'%Y%m') ASC";
68    
69      $resql = $this->db->query($sql);      $resql = $this->db->query($sql);
# Line 70  class GraphCommercialChiffreAffaire exte Line 81  class GraphCommercialChiffreAffaire exte
81              $row = $this->db->fetch_row($resql);                      $row = $this->db->fetch_row($resql);        
82                                            
83              $datas[$i] = $row[1];              $datas[$i] = $row[1];
84              $labels[$i] = substr($row[0],-2)."/".substr($row[0],2,2);              $labels[$i] = substr($row[0],-2);
85    
86              if ($commercial > 0)              if ($commercial > 0)
87                {                {

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26