diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 07318bc0571..dd87485ac56 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2058,8 +2058,11 @@ 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;