Skip to content
Snippets Groups Projects
Commit 500f6fc5 authored by Rodolphe Quiedeville's avatar Rodolphe Quiedeville
Browse files

Bugfix

parent 50ddaa6e
No related branches found
No related tags found
No related merge requests found
......@@ -418,27 +418,31 @@ class BonPrelevement
* Renvoie toutes les factures prsente
* dans un bon de prlvement
*/
$sql = "SELECT fk_facture";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture";
$sql .= " WHERE fk_prelevement = ".$this->id;
$result=$this->db->query($sql);
if ($result)
$sql = "SELECT fk_facture";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
$sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf";
$sql .= " WHERE pf.fk_prelevement_lignes = pl.rowid";
$sql .= " AND pl.fk_prelevement_bons = p.rowid";
$sql .= " AND p.rowid=".$this->id;
$resql=$this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows();
$num = $this->db->num_rows($resql);
if ($num)
{
$i = 0;
while ($i < $num)
{
$row = $this->db->fetch_row();
$row = $this->db->fetch_row($resql);
$arr[$i] = $row[0];
$i++;
}
}
$this->db->free();
$this->db->free($resql);
}
else
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment