Gestion de la virgule dans les prix

This commit is contained in:
Rodolphe Quiedeville 2004-07-21 09:58:10 +00:00
parent 854580d17b
commit 26f13060e4

View File

@ -170,7 +170,7 @@ class Product
$sql .= " SET date_price= now()"; $sql .= " SET date_price= now()";
$sql .= " ,fk_product = ".$this->id; $sql .= " ,fk_product = ".$this->id;
$sql .= " ,fk_user_author = ".$user->id; $sql .= " ,fk_user_author = ".$user->id;
$sql .= " ,price = ".$this->price; $sql .= " ,price = ".ereg_replace(",",".",$this->price);
$sql .= " ,envente = ".$this->envente; $sql .= " ,envente = ".$this->envente;
$sql .= " ,tva_tx = ".$this->tva_tx; $sql .= " ,tva_tx = ".$this->tva_tx;
@ -181,6 +181,7 @@ class Product
else else
{ {
print $this->db->error() . ' in ' . $sql; print $this->db->error() . ' in ' . $sql;
return 0;
} }
} }
/* /*
@ -191,7 +192,6 @@ class Product
{ {
if (strlen(trim($this->price)) > 0 ) if (strlen(trim($this->price)) > 0 )
{ {
$this->price = round($this->price, 2);
$sql = "UPDATE ".MAIN_DB_PREFIX."product "; $sql = "UPDATE ".MAIN_DB_PREFIX."product ";
$sql .= " SET price = " . ereg_replace(",",".",$this->price); $sql .= " SET price = " . ereg_replace(",",".",$this->price);
@ -214,7 +214,6 @@ class Product
return -2; return -2;
} }
} }
/** /**
* *
* *