Modif des logs et montant ngatif

This commit is contained in:
Rodolphe Quiedeville 2005-01-18 16:35:57 +00:00
parent 966a46a8f2
commit 3df537fff6

View File

@ -162,24 +162,28 @@ class Paiement
$value = trim($value);
$amount = ereg_replace(",",".",round($value, 2));
if (is_numeric($amount) && $amount > 0)
if (is_numeric($amount) && $amount <> 0)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement_facture (fk_facture, fk_paiement, amount)";
$sql .= " VALUES ('".$facid."','". $this->id."','". $amount."')";
if (! $this->db->query($sql) )
{
dolibarr_print_error($this->db);
dolibarr_syslog("Paiement::Create Erreur INSERT dans paiement_facture ".$facid);
$sql_err++;
}
}
else
{
dolibarr_syslog("Paiement::Create Montant non numérique");
}
}
}
else
{
dolibarr_print_error($this->db);
dolibarr_syslog("Paiement::Create Erreur INSERT dans paiement");
$sql_err++;
}
}