Renvoi d'une valeur dans set_valid
This commit is contained in:
parent
65c5749e6d
commit
bd851016d1
@ -20,6 +20,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
class FactureLigne {
|
||||||
|
Function FactureLigne()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class Facture {
|
class Facture {
|
||||||
var $id;
|
var $id;
|
||||||
var $db;
|
var $db;
|
||||||
@ -110,7 +116,7 @@ class Facture {
|
|||||||
Function fetch($rowid)
|
Function fetch($rowid)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "SELECT fk_soc,facnumber,amount,remise,".$this->db->pdate(datef)."as df FROM llx_facture WHERE rowid=$rowid;";
|
$sql = "SELECT fk_soc,facnumber,amount,tva,total,remise,".$this->db->pdate(datef)."as df FROM llx_facture WHERE rowid=$rowid;";
|
||||||
|
|
||||||
if ($this->db->query($sql) )
|
if ($this->db->query($sql) )
|
||||||
{
|
{
|
||||||
@ -120,19 +126,65 @@ class Facture {
|
|||||||
|
|
||||||
$this->id = $rowid;
|
$this->id = $rowid;
|
||||||
$this->datep = $obj->dp;
|
$this->datep = $obj->dp;
|
||||||
|
$this->date = $obj->df;
|
||||||
$this->ref = $obj->facnumber;
|
$this->ref = $obj->facnumber;
|
||||||
|
$this->total_ht = $obj->amount;
|
||||||
|
$this->total_tva = $obj->tva;
|
||||||
|
$this->total_ttc = $obj->total;
|
||||||
$this->remise = $obj->remise;
|
$this->remise = $obj->remise;
|
||||||
$this->socidp = $obj->fk_soc;
|
$this->socidp = $obj->fk_soc;
|
||||||
|
$this->lignes = array();
|
||||||
|
$this->db->free();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Lignes
|
||||||
|
*/
|
||||||
|
|
||||||
|
$sql = "SELECT l.description, l.price, l.qty, l.rowid, l.tva_taux";
|
||||||
|
$sql .= " FROM llx_facturedet as l WHERE l.fk_facture = ".$this->id;
|
||||||
|
|
||||||
|
$result = $this->db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
$num = $this->db->num_rows();
|
||||||
|
$i = 0; $total = 0;
|
||||||
|
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$objp = $this->db->fetch_object($i);
|
||||||
|
$faclig = new FactureLigne();
|
||||||
|
$faclig->desc = stripslashes($objp->description);
|
||||||
|
$faclig->qty = $objp->qty;
|
||||||
|
$faclig->price = price($objp->price);
|
||||||
|
$faclig->tva_taux = $objp->tva_taux;
|
||||||
|
$this->lignes[$i] = $faclig;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
$this->db->free();
|
$this->db->free();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $this->db->error();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $this->db->error();
|
print $this->db->error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Function fetch_client()
|
||||||
|
{
|
||||||
|
$client = new Societe($this->db);
|
||||||
|
$client->fetch($this->socidp);
|
||||||
|
$this->client = $client;
|
||||||
|
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@ -225,6 +277,7 @@ class Facture {
|
|||||||
print $dir;
|
print $dir;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user