ajout edition des lignes de factures

This commit is contained in:
Rodolphe Quiedeville 2003-02-01 21:13:19 +00:00
parent 42f6070efe
commit d1c3a18cb1

View File

@ -41,7 +41,7 @@ class Facture {
*
*/
Function Facture($DB, $soc_idp="") {
Function Facture($DB, $soc_idp="", $facid="") {
$this->db = $DB ;
$this->socidp = $soc_idp;
$this->products = array();
@ -51,6 +51,7 @@ class Facture {
$this->tva = 0;
$this->total = 0;
$this->propalid = 0;
$this->id = $facid;
}
/*
*
@ -230,8 +231,6 @@ class Facture {
*/
Function addline($facid, $desc, $pu, $qty)
{
global $conf;
$sql = "INSERT INTO llx_facturedet (fk_facture,description,price,qty) VALUES ($facid, '$desc', $pu, $qty) ;";
$result = $this->db->query( $sql);
@ -241,6 +240,17 @@ class Facture {
*
*
*/
Function updateline($rowid, $desc, $pu, $qty)
{
$sql = "UPDATE llx_facturedet set description='$desc',price=$pu,qty=$qty WHERE rowid = $rowid ;";
$result = $this->db->query( $sql);
$this->updateprice($this->id);
}
/*
*
*
*/
Function deleteline($rowid)
{
$sql = "DELETE FROM llx_facturedet WHERE rowid = $rowid;";