Gestion du code produit par ligne de facture

This commit is contained in:
Rodolphe Quiedeville 2003-06-27 16:12:36 +00:00
parent 0d4e2798a7
commit 269e909992

View File

@ -20,13 +20,15 @@
* *
*/ */
class FactureLigne { class FactureLigne
{
Function FactureLigne() Function FactureLigne()
{ {
} }
} }
class Facture { class Facture
{
var $id; var $id;
var $db; var $db;
var $socidp; var $socidp;
@ -281,13 +283,16 @@ class Facture {
* *
* *
*/ */
Function addline($facid, $desc, $pu, $qty, $txtva) Function addline($facid, $desc, $pu, $qty, $txtva, $fk_product='NULL')
{ {
$sql = "INSERT INTO llx_facturedet (fk_facture,description,price,qty,tva_taux) VALUES ($facid, '$desc', $pu, $qty, $txtva) ;"; $sql = "INSERT INTO llx_facturedet (fk_facture,description,price,qty,tva_taux, fk_product)";
$result = $this->db->query( $sql); $sql .= " VALUES ($facid, '$desc', $pu, $qty, $txtva, $fk_product) ;";
if ( $this->db->query( $sql) )
{
$this->updateprice($facid); $this->updateprice($facid);
} }
}
/* /*
* *
* *