diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php
index 5f6e30016d4..3625d32cff7 100644
--- a/htdocs/compta/bank/index.php
+++ b/htdocs/compta/bank/index.php
@@ -57,7 +57,7 @@ $limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
-if ($page == -1) { $page = 0; }
+if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
@@ -127,9 +127,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
$search_number='';
$search_statut='';
}
-
-
-
+
+
+
/*
* View
*/
@@ -299,9 +299,9 @@ if (! empty($arrayfields['toreconcile']['checked'])) print_liste_field_titr
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
- foreach($extrafields->attribute_label as $key => $val)
+ foreach($extrafields->attribute_label as $key => $val)
{
- if (! empty($arrayfields["ef.".$key]['checked']))
+ if (! empty($arrayfields["ef.".$key]['checked']))
{
$align=$extrafields->getAlignFlag($key);
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
@@ -435,7 +435,7 @@ $var=true;
foreach ($accounts as $key=>$type)
{
if ($i >= $limit) break;
-
+
$found++;
$acc = new Account($db);
@@ -452,7 +452,7 @@ foreach ($accounts as $key=>$type)
{
$lastcurrencycode=$acc->currency_code;
}
-
+
print '
';
// Ref
@@ -461,14 +461,14 @@ foreach ($accounts as $key=>$type)
print '| '.$acc->getNomUrl(1).' | ';
if (! $i) $totalarray['nbfield']++;
}
-
+
// Label
if (! empty($arrayfields['b.label']['checked']))
{
print ''.$acc->label.' | ';
if (! $i) $totalarray['nbfield']++;
}
-
+
// Account type
if (! empty($arrayfields['accountype']['checked']))
{
@@ -477,14 +477,14 @@ foreach ($accounts as $key=>$type)
print '';
if (! $i) $totalarray['nbfield']++;
}
-
+
// Number
if (! empty($arrayfields['b.number']['checked']))
{
print ''.$acc->number.' | ';
if (! $i) $totalarray['nbfield']++;
}
-
+
// Account number
if (! empty($arrayfields['b.account_number']['checked']))
{
@@ -492,7 +492,7 @@ foreach ($accounts as $key=>$type)
print ''.length_accountg($acc->account_number).' | ';
if (! $i) $totalarray['nbfield']++;
}
-
+
// Accountancy journal
if (! empty($arrayfields['b.accountancy_journal']['checked']))
{
@@ -500,7 +500,7 @@ foreach ($accounts as $key=>$type)
print ''.length_accountg($acc->accountancy_journal).' | ';
if (! $i) $totalarray['nbfield']++;
}
-
+
// Transactions to reconcile
if (! empty($arrayfields['toreconcile']['checked']))
{
@@ -519,13 +519,13 @@ foreach ($accounts as $key=>$type)
print '';
if (! $i) $totalarray['nbfield']++;
}
-
+
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
- foreach($extrafields->attribute_label as $key => $val)
+ foreach($extrafields->attribute_label as $key => $val)
{
- if (! empty($arrayfields["ef.".$key]['checked']))
+ if (! empty($arrayfields["ef.".$key]['checked']))
{
print 'getAlignFlag($key);
@@ -558,14 +558,14 @@ foreach ($accounts as $key=>$type)
print ' | ';
if (! $i) $totalarray['nbfield']++;
}
-
+
// Statut
if (! empty($arrayfields['b.clos']['checked']))
{
print ''.$acc->getLibStatut(5).' | ';
if (! $i) $totalarray['nbfield']++;
}
-
+
// Balance
if (! empty($arrayfields['balance']['checked']))
{
@@ -576,7 +576,7 @@ foreach ($accounts as $key=>$type)
if (! $i) $totalarray['totalbalancefield']=$totalarray['nbfield'];
$totalarray['totalbalance'] += $solde;
}
-
+
// Action column
print '';
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
@@ -587,7 +587,7 @@ foreach ($accounts as $key=>$type)
}
print ' | ';
if (! $i) $totalarray['nbfield']++;
-
+
print '
';
$total[$acc->currency_code] += $solde;