Skip to content

Commit

Permalink
[ bug #1546 ] Incorrect page number when searching in the list of ban…
Browse files Browse the repository at this point in the history
…k transactions
  • Loading branch information
marcosgdf committed Sep 14, 2014
1 parent ba70c1a commit 7bac944
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -25,6 +25,7 @@ Fix: [ bug #1544 ] Can remove date from invoice.
Fix: list event view lost type event filter.
Fix: Add code save on create event.
Fix: SQL injection.
Fix: [ bug #1546 ] Incorrect page number when searching in the list of bank transactions

***** ChangeLog for 3.5.4 compared to 3.5.3 *****
Fix: Hide title of event when agenda module disabled.
Expand Down
25 changes: 15 additions & 10 deletions htdocs/compta/bank/account.php
Expand Up @@ -5,7 +5,7 @@
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@@2byte.es>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -253,17 +253,22 @@
//Total pages
$totalPages = ceil($total_lines/$viewline);

if ($page > 0)
{
$limitsql = ($totalPages - $page) * $viewline;
if ($limitsql < $viewline) $limitsql = $viewline;
$nbline = $limitsql;
}
else
{
if ($totalPages == 0) {
$page = 0;
$limitsql = $nbline;
} else {

if ($page > 0) {
$limitsql = ($totalPages - $page) * $viewline;
if ($limitsql < $viewline) {
$limitsql = $viewline;
}
$nbline = $limitsql;
} else {
$page = 0;
$limitsql = $nbline;
}
}

//print $limitsql.'-'.$page.'-'.$viewline;

// Onglets
Expand Down

0 comments on commit 7bac944

Please sign in to comment.