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

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

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

revision 1.2 by rodolphe, Thu Dec 1 14:53:41 2005 UTC revision 1.3 by rodolphe, Thu Dec 1 14:58:36 2005 UTC
# Line 24  require_once (DOL_DOCUMENT_ROOT."/teleph Line 24  require_once (DOL_DOCUMENT_ROOT."/teleph
24    
25  class GraphCommercialGain extends GraphBar {  class GraphCommercialGain extends GraphBar {
26    
27    Function GraphCommercialGain($DB, $file)    Function GraphCommercialGain($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 = "Gain mensuel";      $this->titre = "Gain mensuel";
34        if ($this->year > 0)
35          {
36            $this->titre = "Gain mensuel ".$this->year;
37          }
38      $this->barcolor = "pink";      $this->barcolor = "pink";
39      $this->showframe = true;      $this->showframe = true;
40    }    }
# Line 43  class GraphCommercialGain extends GraphB Line 46  class GraphCommercialGain extends GraphB
46      if ($commercial > 0)      if ($commercial > 0)
47        {        {
48          $sql = "DELETE FROM ".MAIN_DB_PREFIX."telephonie_stats";              $sql = "DELETE FROM ".MAIN_DB_PREFIX."telephonie_stats";    
49          $sql .= " WHERE graph='commercial.gain.mensuel.".$commercial."';";          $sql .= " WHERE graph='commercial.gain.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 52  class GraphCommercialGain extends GraphB Line 59  class GraphCommercialGain extends GraphB
59      $sql .= " , ".MAIN_DB_PREFIX."telephonie_societe_ligne as l";      $sql .= " , ".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
60      $sql .= " WHERE l.rowid = f.fk_ligne";      $sql .= " WHERE l.rowid = f.fk_ligne";
61      $sql .= " AND l.fk_commercial_sign = ".$commercial;      $sql .= " AND l.fk_commercial_sign = ".$commercial;
62        if ($this->year > 0)
63          {
64            $sql .= " AND date_format(f.date,'%Y')='".$this->year."'";
65          }
66      $sql .= " GROUP BY date_format(f.date,'%Y%m') ASC";      $sql .= " GROUP BY date_format(f.date,'%Y%m') ASC";
67    
68      $resql = $this->db->query($sql);      $resql = $this->db->query($sql);

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