From 01a7ef267df91d47afcfb94c65f6d163a6f72b2d Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 27 Jul 2004 08:09:43 +0000 Subject: [PATCH] Modif virgule et point dans les requetes SQL --- htdocs/commande/commande.class.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 8eee4e2ba82..595af9d3204 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2003-2004 Rodolphe Quiedeville * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -350,8 +350,8 @@ class Commande $price = $pu - $remise; } - $sql = "INSERT INTO ".MAIN_DB_PREFIX."commandedet (fk_commande,label,description,price,qty,tva_tx, fk_product, remise_percent, subprice, remise)"; - $sql .= " VALUES ($this->id, '" . addslashes($desc) . "','" . addslashes($desc) . "', $price, $qty, $txtva, $fk_product, $remise_percent, $subprice, $remise) ;"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."commandedet (fk_commande,label,description,fk_product, price,qty,tva_tx, remise_percent, subprice, remise)"; + $sql .= " VALUES ($this->id, '" . addslashes($desc) . "','" . addslashes($desc) . "',$fk_product,".ereg_replace(",",".",$price).", $qty, $txtva, $remise_percent,".ereg_replace(",",".",$subprice).",".ereg_replace(",",".", $remise).") ;"; if ( $this->db->query( $sql) ) { @@ -652,7 +652,13 @@ class Commande /* * */ - $sql = "UPDATE ".MAIN_DB_PREFIX."commande set amount_ht='$totalht', total_ht='$totalht', tva='$totaltva', total_ttc='$totalttc', remise='$total_remise' WHERE rowid = $this->id"; + $sql = "UPDATE ".MAIN_DB_PREFIX."commande set"; + $sql .= " amount_ht ='".ereg_replace(",",".",$totalht)."'"; + $sql .= ", total_ht ='".ereg_replace(",",".",$totalht)."'"; + $sql .= ", tva ='".ereg_replace(",",".",$totaltva)."'"; + $sql .= ", total_ttc ='".ereg_replace(",",".",$totalttc)."'"; + $sql .= ", remise ='".ereg_replace(",",".",$total_remise)."'"; + $sql .= " WHERE rowid = $this->id"; if ( $this->db->query($sql) ) { return 1;