diff --git a/htdocs/compta/stats/comp.php b/htdocs/compta/stats/comp.php index 127ee3af6dd..76079aa8974 100644 --- a/htdocs/compta/stats/comp.php +++ b/htdocs/compta/stats/comp.php @@ -20,46 +20,7 @@ * */ require("./pre.inc.php"); - - -function get_ca_propal ($db, $year, $socidp) -{ - - $sql = "SELECT sum(f.price - f.remise) as sum FROM llx_propal as f WHERE fk_statut in (1,2) AND date_format(f.datep, '%Y') = $year "; - if ($socidp) - { - $sql .= " AND f.fk_soc = $socidp"; - } - - $result = $db->query($sql); - - if ($result) - { - return $db->result (0, 0); - } - else - { - return 0; - } - -} -function get_ca ($db, $year, $socidp) -{ - $sql = "SELECT sum(f.amount) as sum FROM llx_facture as f WHERE f.paye = 1 AND date_format(f.datef , '%Y') = $year "; - if ($socidp) - { - $sql .= " AND f.fk_soc = $socidp"; - } - - $result = $db->query($sql); - - if ($result) { - return $db->result ( 0, 0); - } else { - return 0; - } - -} +require("./lib.inc.php"); function propals ($db, $year, $month) {