Récupération du nom et de l'id de la societe auquel la facture est rattachée

This commit is contained in:
Rodolphe Quiedeville 2004-07-13 10:16:49 +00:00
parent dcc19539a6
commit a42c21c3db

View File

@ -141,7 +141,9 @@ class FactureFourn
$sql = "SELECT fk_soc,libelle,facnumber,amount,remise,".$this->db->pdate(datef)."as df"; $sql = "SELECT fk_soc,libelle,facnumber,amount,remise,".$this->db->pdate(datef)."as df";
$sql .= ", total_ht, total_tva, total_ttc, fk_user_author"; $sql .= ", total_ht, total_tva, total_ttc, fk_user_author";
$sql .= ", fk_statut, paye"; $sql .= ", fk_statut, paye";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f WHERE f.rowid=$rowid;"; $sql .= ", s.nom as socnom, s.idp as socidp";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE f.rowid=$rowid AND f.fk_soc = s.idp ;";
if ($this->db->query($sql) ) if ($this->db->query($sql) )
{ {
@ -166,6 +168,9 @@ class FactureFourn
$this->statut = $obj->fk_statut; $this->statut = $obj->fk_statut;
$this->paye = $obj->paye; $this->paye = $obj->paye;
$this->socidp = $obj->socidp;
$this->socnom = $obj->socnom;
$this->db->free(); $this->db->free();
/* /*
@ -266,8 +271,9 @@ class FactureFourn
} }
/* /**
* Ajout ligne facture fourn * Ajoute une ligne dans la facture
*
*/ */
Function addline($desc, $pu, $tauxtva, $qty) Function addline($desc, $pu, $tauxtva, $qty)
{ {
@ -298,7 +304,7 @@ class FactureFourn
$puht = ereg_replace(",",".",$puht); $puht = ereg_replace(",",".",$puht);
$totalht = $puht * $qty; $totalht = $puht * $qty;
$tva = tva($totalht, $tauxtva); $tva = ($totalht * $tauxtva / 100);
$totalttc = $totalht + $tva; $totalttc = $totalht + $tva;
@ -321,8 +327,8 @@ class FactureFourn
// Mise a jour prix facture // Mise a jour prix facture
$this->updateprice($this->id); $this->updateprice($this->id);
} }
/* /**
* Supprime ligne facture fourn * Supprime une ligne de la facture
* *
*/ */
Function deleteline($rowid) Function deleteline($rowid)
@ -341,8 +347,8 @@ class FactureFourn
return 1; return 1;
} }
/* /**
* *Mets à jour le prix total de la facture
* *
*/ */
Function updateprice($facid) Function updateprice($facid)