/[dolibarr]/dolibarr/htdocs/tva.class.php
ViewVC logotype

Diff of /dolibarr/htdocs/tva.class.php

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

revision 1.8 by eldy, Sun May 8 19:35:46 2005 UTC revision 1.9 by ccomb, Mon Aug 15 15:15:36 2005 UTC
# Line 113  class Tva Line 113  class Tva
113      function tva_sum_payee($year = 0)      function tva_sum_payee($year = 0)
114      {      {
115    
116          $sql = "SELECT sum(f.amount) as amount";          $sql = "SELECT sum(f.total_tva) as total_tva";
117          $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";          $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
118    
119          if ($year)          if ($year)
120          {          {
121              $sql .= " WHERE f.datef >= '$year-01-01' AND f.datef <= '$year-12-31' ";              $sql .= " WHERE f.datef >= '$year-01-01' AND f.datef <= '$year-12-31' ";
122          }          }
123    echo $sql;
124          $result = $this->db->query($sql);          $result = $this->db->query($sql);
125    
126          if ($result)          if ($result)
# Line 128  class Tva Line 128  class Tva
128              if ($this->db->num_rows())              if ($this->db->num_rows())
129              {              {
130                  $obj = $this->db->fetch_object($result);                  $obj = $this->db->fetch_object($result);
131                  return $obj->amount;                  return $obj->total_tva;
132              }              }
133              else              else
134              {              {

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

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