Ajout d'une fonction pour faire des stats sur les propales
This commit is contained in:
parent
f5b82a8d4f
commit
ad9b652c67
@ -416,8 +416,8 @@ class Product
|
|||||||
|
|
||||||
return $this->_get_stats($sql);
|
return $this->_get_stats($sql);
|
||||||
}
|
}
|
||||||
/*
|
/**
|
||||||
*
|
*Renvoie le nombre de facture dans lesquelles figure le produit
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Function get_num_vente()
|
Function get_num_vente()
|
||||||
@ -427,6 +427,19 @@ class Product
|
|||||||
$sql .= " WHERE f.rowid = d.fk_facture and f.paye = 1 and d.fk_product =".$this->id;
|
$sql .= " WHERE f.rowid = d.fk_facture and f.paye = 1 and d.fk_product =".$this->id;
|
||||||
$sql .= " GROUP BY date_format(f.datef,'%Y%m') DESC ;";
|
$sql .= " GROUP BY date_format(f.datef,'%Y%m') DESC ;";
|
||||||
|
|
||||||
|
return $this->_get_stats($sql);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*Renvoie le nombre de proaple dans lesquelles figure le produit
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Function get_num_propal()
|
||||||
|
{
|
||||||
|
$sql = "SELECT count(*), date_format(p.datep, '%Y%m') ";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."propaldet as d, ".MAIN_DB_PREFIX."propal as p";
|
||||||
|
$sql .= " WHERE p.rowid = d.fk_propal and d.fk_product =".$this->id;
|
||||||
|
$sql .= " GROUP BY date_format(p.datep,'%Y%m') DESC ;";
|
||||||
|
|
||||||
return $this->_get_stats($sql);
|
return $this->_get_stats($sql);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user