Modif des logs et montant négatif
This commit is contained in:
parent
966a46a8f2
commit
3df537fff6
@ -162,24 +162,28 @@ class Paiement
|
|||||||
$value = trim($value);
|
$value = trim($value);
|
||||||
$amount = ereg_replace(",",".",round($value, 2));
|
$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 = "INSERT INTO ".MAIN_DB_PREFIX."paiement_facture (fk_facture, fk_paiement, amount)";
|
||||||
$sql .= " VALUES ('".$facid."','". $this->id."','". $amount."')";
|
$sql .= " VALUES ('".$facid."','". $this->id."','". $amount."')";
|
||||||
|
|
||||||
if (! $this->db->query($sql) )
|
if (! $this->db->query($sql) )
|
||||||
{
|
{
|
||||||
dolibarr_print_error($this->db);
|
dolibarr_syslog("Paiement::Create Erreur INSERT dans paiement_facture ".$facid);
|
||||||
|
|
||||||
$sql_err++;
|
$sql_err++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dolibarr_syslog("Paiement::Create Montant non numérique");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($this->db);
|
dolibarr_syslog("Paiement::Create Erreur INSERT dans paiement");
|
||||||
$sql_err++;
|
$sql_err++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user