Ajout d'une fonction pour compter la presence dans les factures
This commit is contained in:
parent
c1fbc56637
commit
1823a9c1c8
@ -158,5 +158,28 @@ class Product
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Function count_facture()
|
||||||
|
{
|
||||||
|
$sql = "SELECT pd.fk_facture";
|
||||||
|
$sql .= " FROM llx_facturedet as pd, llx_product as p";
|
||||||
|
$sql .= " WHERE p.rowid = pd.fk_product AND p.rowid = ".$this->id;
|
||||||
|
$sql .= " GROUP BY pd.fk_facture";
|
||||||
|
|
||||||
|
$result = $this->db->query($sql) ;
|
||||||
|
|
||||||
|
if ( $result )
|
||||||
|
{
|
||||||
|
return $this->db->num_rows();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user