Skip to content
Snippets Groups Projects
Commit 487a76ba authored by Rodolphe Quiedeville's avatar Rodolphe Quiedeville
Browse files

BUGFIX Correction bug #13934

Pertes des centimes
parent 3feda069
Branches
Tags
No related merge requests found
......@@ -380,7 +380,14 @@ class FactureRec
}
$sql = "INSERT INTO ".MAIN_DB_PREFIX."facturedet_rec (fk_facture,description,price,qty,tva_taux, fk_product, remise_percent, subprice, remise)";
$sql .= " VALUES ('$facid', '$desc', '$price', '$qty', '$txtva', '$fk_product', '$remise_percent', '$subprice', '$remise') ;";
$sql .= " VALUES ('$facid', '$desc'";
$sql .= ",".ereg_replace(",",".",$price);
$sql .= ",".ereg_replace(",",".",$qty);
$sql .= ",".ereg_replace(",",".",$txtva);
$sql .= ",'$fk_product'";
$sql .= ",'".ereg_replace(",",".",$remise_percent)."'";
$sql .= ",'".ereg_replace(",",".",$subprice)."'";
$sql .= ",'".ereg_replace(",",".",$remise)."') ;";
if ( $this->db->query( $sql) )
{
......@@ -419,7 +426,14 @@ class FactureRec
$remise_percent=0;
}
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set description='$desc',price=$price,subprice=$subprice,remise=$remise,remise_percent=$remise_percent,qty=$qty WHERE rowid = $rowid ;";
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set description='$desc'";
$sql .= ",price=".ereg_replace(",",".",$price);
$sql .= ",subprice=".ereg_replace(",",".",$subprice);
$sql .= ",remise=".ereg_replace(",",".",$remise);
$sql .= ",remise_percent=".ereg_replace(",",".",$remise_percent);
$sql .= ",qty=".ereg_replace(",",".",$qty);
$sql .= " WHERE rowid = $rowid ;";
$result = $this->db->query( $sql);
$this->updateprice($this->id);
......@@ -477,7 +491,13 @@ class FactureRec
$this->total_ttc = $calculs[2];
$tvas = $calculs[5];
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET amount = $this->amount_ht, remise=$this->total_remise, total=$this->total_ht, tva=$this->total_tva, total_ttc=$this->total_ttc";
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET ";
$sql .= " amount = ".ereg_replace(",",".",$this->amount_ht);
$sql .= ", remise=".ereg_replace(",",".",$this->total_remise);
$sql .= ", total=".ereg_replace(",",".",$this->total_ht);
$sql .= ", tva=".ereg_replace(",",".",$this->total_tva);
$sql .= ", total_ttc=".ereg_replace(",",".",$this->total_ttc);
$sql .= " WHERE rowid = $facid ;";
if ( $this->db->query($sql) )
......@@ -529,7 +549,5 @@ class FactureRec
}
}
}
}
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment