From e3747861fe55b6e7a70876d505b922c9441a7e4e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 26 Oct 2007 18:52:27 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20certaine=20fois=20la=20v=E9rification=20?= =?UTF-8?q?d'un=20paiement=20contenant=20un=20montant=20avec=20un=20point?= =?UTF-8?q?=20au=20lieu=20d'une=20virgule=20indiquait=20que=20le=20paiemen?= =?UTF-8?q?t=20=E9tait=20sup=E9rieure=20alors=20que=20c'=E9tait=20la=20som?= =?UTF-8?q?me=20exact.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/paiement.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 218460277b4..92100acf1d1 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -64,32 +64,32 @@ if ($_POST['action'] == 'add_paiement' || $_POST['action'] == 'confirm_paiement' // Verifie si des paiements sont supérieurs au montant facture foreach ($_POST as $key => $value) - { - if (substr($key,0,7) == 'amount_') - { - $cursorfacid = substr($key,7); - $amounts[$cursorfacid] = $_POST[$key]; - $totalpaiement = $totalpaiement + price2num($amounts[$cursorfacid]); - $tmpfacture=new Facture($db); - $tmpfacture->fetch($cursorfacid); - $amountsresttopay[$cursorfacid]=($tmpfacture->total_ttc-$tmpfacture->getSommePaiement()); - if ($amounts[$cursorfacid] && $amounts[$cursorfacid] > $amountsresttopay[$cursorfacid]) + { + if (substr($key,0,7) == 'amount_') + { + $cursorfacid = substr($key,7); + $amounts[$cursorfacid] = price2num($_POST[$key]); + $totalpaiement = $totalpaiement + $amounts[$cursorfacid]; + $tmpfacture=new Facture($db); + $tmpfacture->fetch($cursorfacid); + $amountsresttopay[$cursorfacid]=price2num($tmpfacture->total_ttc-$tmpfacture->getSommePaiement()); + if ($amounts[$cursorfacid] && $amounts[$cursorfacid] > $amountsresttopay[$cursorfacid]) { $addwarning=1; $formquestion['text'] = img_warning($langs->trans("PaymentHigherThanReminderToPay")).' Attention, le montant de paiement pour une ou plusieurs facture est supérieur au reste à payer.'; $formquestion['text'].='
Corriger votre saisie, sinon, confirmer et penser à créer un avoir du trop perçu lors de la fermeture de chacune des factures surpayées.'; } - - $formquestion[$i++]=array('type' => 'hidden','name' => $key, 'value' => $_POST[$key]); + + $formquestion[$i++]=array('type' => 'hidden','name' => $key, 'value' => $_POST[$key]); + } } - } // Effectue les vérifications des parametres if ($_POST['paiementid'] <= 0) - { - $fiche_erreur_message = '
'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('PaymentMode')).'
'; - $error++; - } + { + $fiche_erreur_message = '
'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('PaymentMode')).'
'; + $error++; + } if ($conf->banque->enabled) {