This commit is contained in:
Regis Houssin 2006-04-13 16:23:09 +00:00
parent 4c36ee8a38
commit 66fabdd807

View File

@ -124,10 +124,10 @@ class PaiementFourn
$error = 0; $error = 0;
// Nettoyage parametres // Nettoyage parametres
$value = price2num($value);
$this->total = 0; $this->total = 0;
foreach ($this->amounts as $key => $value) foreach ($this->amounts as $key => $value)
{ {
$value = price2num($value);
$val = round($value, 2); $val = round($value, 2);
$this->amounts[$key] = $val; $this->amounts[$key] = $val;
$this->total += $val; $this->total += $val;
@ -152,6 +152,7 @@ class PaiementFourn
$facid = $key; $facid = $key;
if (is_numeric($amount) && $amount <> 0) if (is_numeric($amount) && $amount <> 0)
{ {
$amount = price2num($amount);
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiementfourn_facturefourn (fk_facturefourn, fk_paiementfourn, amount)'; $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiementfourn_facturefourn (fk_facturefourn, fk_paiementfourn, amount)';
$sql .= ' VALUES ('.$facid.','. $this->id.',\''.$amount.'\')'; $sql .= ' VALUES ('.$facid.','. $this->id.',\''.$amount.'\')';
if (! $this->db->query($sql) ) if (! $this->db->query($sql) )