diff --git a/htdocs/compta/facture/index.php b/htdocs/compta/facture/index.php
index 0a526e39e1e..1821d4720af 100644
--- a/htdocs/compta/facture/index.php
+++ b/htdocs/compta/facture/index.php
@@ -43,9 +43,8 @@ if (isset($user->socid) && $user->socid > 0) {
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
// Maximum elements of the tables
-$maxDraftCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
-$maxLatestEditCount = 5;
-$maxOpenCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
+$maxDraftCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? $max : $conf->global->MAIN_MAXLIST_OVERLOAD;
+$maxOpenCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? $max : $conf->global->MAIN_MAXLIST_OVERLOAD;
/*
@@ -64,7 +63,7 @@ if ($tmp) {
print $tmp;
print '
';
}
-$tmp = getCustomerInvoiceDraftTable($max, $socid);
+$tmp = getCustomerInvoiceDraftTable($maxDraftCount, $socid);
if ($tmp) {
print $tmp;
print '
';
@@ -74,13 +73,13 @@ print '';
print '