diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 39476ee97f3..248ac312240 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1442,6 +1442,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r { if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experienc trouble with pdf thumb generation and imagick, you can disable here. { + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $ret = dol_convert_file($file, 'png', $fileimage); if ($ret < 0) $error++; } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index b5e8ed8151e..eb71a30e083 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1955,16 +1955,26 @@ else } $totalpaid = price2num($totalpaid); // Round $totalpaid to fix floating problem after addition into loop - if ($object->paid == 0) + $remaintopay = price2num($object->total_ttc - $totalpaid); + $resteapayeraffiche = $remaintopay; + + $cssforamountpaymentcomplete = 'amountpaymentcomplete'; + + if ($object->status == ExpenseReport::STATUS_REFUSED) { - print ''.$langs->trans("AlreadyPaid").':'.price($totalpaid).''; - print ''.$langs->trans("AmountExpected").':'.price($object->total_ttc).''; - - $remaintopay = price2num($object->total_ttc - $totalpaid); - - print ''.$langs->trans("RemainderToPay").':'; - print ''.price($remaintopay).''; + $cssforamountpaymentcomplete = 'amountpaymentneutral'; + $resteapayeraffiche = 0; } + elseif ($object->paid == 0) + { + $cssforamountpaymentcomplete = 'amountpaymentneutral'; + } + print ''.$langs->trans("AlreadyPaid").':'.price($totalpaid).''; + print ''.$langs->trans("AmountExpected").':'.price($object->total_ttc).''; + + print ''.$langs->trans("RemainderToPay").':'; + print ''.price($resteapayeraffiche).''; + $db->free($resql); } else