Fix: certaine fois la vérification d'un paiement contenant un montant avec un point au lieu d'une virgule indiquait que le paiement était supérieure alors que c'était la somme exact.

This commit is contained in:
Regis Houssin 2007-10-26 18:52:27 +00:00
parent 778b9633c9
commit e3747861fe

View File

@ -68,11 +68,11 @@ if ($_POST['action'] == 'add_paiement' || $_POST['action'] == 'confirm_paiement'
if (substr($key,0,7) == 'amount_') if (substr($key,0,7) == 'amount_')
{ {
$cursorfacid = substr($key,7); $cursorfacid = substr($key,7);
$amounts[$cursorfacid] = $_POST[$key]; $amounts[$cursorfacid] = price2num($_POST[$key]);
$totalpaiement = $totalpaiement + price2num($amounts[$cursorfacid]); $totalpaiement = $totalpaiement + $amounts[$cursorfacid];
$tmpfacture=new Facture($db); $tmpfacture=new Facture($db);
$tmpfacture->fetch($cursorfacid); $tmpfacture->fetch($cursorfacid);
$amountsresttopay[$cursorfacid]=($tmpfacture->total_ttc-$tmpfacture->getSommePaiement()); $amountsresttopay[$cursorfacid]=price2num($tmpfacture->total_ttc-$tmpfacture->getSommePaiement());
if ($amounts[$cursorfacid] && $amounts[$cursorfacid] > $amountsresttopay[$cursorfacid]) if ($amounts[$cursorfacid] && $amounts[$cursorfacid] > $amountsresttopay[$cursorfacid])
{ {
$addwarning=1; $addwarning=1;