From af4288ff3f10132347263ca251d5f544482454e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Dec 2019 13:56:32 +0100 Subject: [PATCH] FIX #12728 --- htdocs/fourn/facture/paiement.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index eb0beab54f4..cb7d1351fd5 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -139,8 +139,14 @@ if (empty($reshook)) { $cursorfacid = substr($key, 7); $amounts[$cursorfacid] = price2num(trim(GETPOST($key))); - $totalpayment = $totalpayment + $amounts[$cursorfacid]; - if (!empty($amounts[$cursorfacid])) $atleastonepaymentnotnull++; + if (!empty($amounts[$cursorfacid])) { + $atleastonepaymentnotnull++; + if (is_numeric($amounts[$cursorfacid])) { + $totalpayment = $totalpayment + $amounts[$cursorfacid]; + } else { + setEventMessages($langs->transnoentities("InputValueIsNotAnNumber", GETPOST($key)), null, 'warnings'); + } + } $result = $tmpinvoice->fetch($cursorfacid); if ($result <= 0) dol_print_error($db); $amountsresttopay[$cursorfacid] = price2num($tmpinvoice->total_ttc - $tmpinvoice->getSommePaiement());