diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index d731acea3b5..f1e1ac7a868 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -324,12 +324,12 @@ if ($resql) { print ''.$langs->trans("Total").''; print ' '; print ''; - //if ($totalinvoices != $object->amount) print img_warning("AmountOfFileDiffersFromSumOfInvoices"); // It is normal to have total that differs. For an amount of invoice of 100, request to pay may be 50 only. - if ($totalamount_requested != $object->amount) { - print img_warning("AmountOfFileDiffersFromSumOfInvoices"); - } print "\n"; print ''; + // If the page show all record (no pagination) and total does not match total of file, we show a warning. Should not happen. + if (($nbtotalofrecords <= $num) && $totalamount_requested != $object->amount) { + print img_warning("AmountOfFileDiffersFromSumOfInvoices"); + } print price($totalamount_requested); print "\n"; print ' ';