appel de librairie

This commit is contained in:
Rodolphe Quiedeville 2003-06-29 09:22:38 +00:00
parent 1cee84b8ed
commit fe3b690c9b

View File

@ -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) {