modif delete et ajout liste des factures

This commit is contained in:
Rodolphe Quiedeville 2003-10-22 14:20:03 +00:00
parent e736c8e29e
commit 518f3f2a94

View File

@ -75,10 +75,10 @@ class Project {
if ($this->db->query($sql) )
{
$sql = "UPDATE llx_propal SET fk_projet = 0 ";
$sql = "UPDATE llx_propal SET fk_projet = 0 WHERE fk_projet = $this->id";
if ($this->db->query($sql) )
{
$sql = "UPDATE llx_facture SET fk_projet = 0 ";
$sql = "UPDATE llx_facture SET fk_projet = 0 WHERE fk_projet = $this->id";
if ($this->db->query($sql) )
{
@ -106,6 +106,7 @@ class Project {
$this->id = $rowid;
$this->ref = $obj->ref;
$this->title = $obj->title;
$this->titre = $obj->title;
$this->societe->id = $obj->fk_soc;
$this->db->free();
}
@ -151,5 +152,41 @@ class Project {
print $this->db->error() . '<br>' .$sql;
}
}
/*
*
*
*
*/
Function get_facture_list()
{
$factures = array();
$sql = "SELECT rowid FROM llx_facture WHERE fk_projet=$this->id;";
if ($this->db->query($sql) )
{
$nump = $this->db->num_rows();
if ($nump)
{
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($i);
$factures[$i] = $obj->rowid;
$i++;
}
$this->db->free();
/*
* Retourne un tableau contenant la liste des factures associees
*/
return $factures;
}
}
else
{
print $this->db->error() . '<br>' .$sql;
}
}
}
?>