From 7f6c29fd6599e15bccf7806f37a32c751c6a86ad Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Mon, 19 Aug 2019 15:27:21 +0200 Subject: [PATCH 1/2] bad converting on php 7 is totalpaid is null display a warning error --- htdocs/expensereport/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 07318bc0571..9917682f265 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2058,7 +2058,8 @@ else $totalpaid += $objp->amount; $i++; } - $totalpaid = price2num($totalpaid); // Round $totalpaid to fix floating problem after addition into loop + if ( !is_null($totalpaid)) + $totalpaid = price2num($totalpaid); // Round $totalpaid to fix floating problem after addition into loop $remaintopay = price2num($object->total_ttc - $totalpaid); $resteapayeraffiche = $remaintopay; From bc66be51a881499cadc9530cb245b4b5cd83d792 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Aug 2019 11:50:18 +0200 Subject: [PATCH 2/2] Update card.php --- htdocs/expensereport/card.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 9917682f265..dd87485ac56 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2058,9 +2058,11 @@ else $totalpaid += $objp->amount; $i++; } - if ( !is_null($totalpaid)) + if (! is_null($totalpaid)) + { $totalpaid = price2num($totalpaid); // Round $totalpaid to fix floating problem after addition into loop - + } + $remaintopay = price2num($object->total_ttc - $totalpaid); $resteapayeraffiche = $remaintopay;