This commit is contained in:
Laurent Destailleur 2016-11-17 19:49:33 +01:00
parent 979632fdc8
commit 0af0aa89bb
2 changed files with 8 additions and 11 deletions

View File

@ -1,7 +1,6 @@
<?php <?php
/* /*
* Copyright (C) 2016 Neil Orley <neil.orley@oeris.fr> * Copyright (C) 2016 Neil Orley <neil.orley@oeris.fr> largely based on the great work of :
* largely based on the great work of :
* - Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com> * - Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* - Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro> * - Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* - Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * - Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
@ -18,7 +17,6 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/ */
/** /**
@ -72,11 +70,8 @@ $pagenext = $page + 1;
if ($sortorder == "") $sortorder = "ASC"; if ($sortorder == "") $sortorder = "ASC";
if ($sortfield == "") $sortfield = "t.rowid"; if ($sortfield == "") $sortfield = "t.rowid";
if (empty($search_date_start)) { if (empty($search_date_start)) $search_date_start = dol_mktime(0, 0, 0, 1, 1, dol_print_date(dol_now(), '%Y'));
$search_date_start = dol_mktime(0, 0, 0, 1, 1, dol_print_date(dol_now(), '%Y')); if (empty($search_date_end)) $search_date_end = dol_mktime(0, 0, 0, 12, 31, dol_print_date(dol_now(), '%Y'));
$search_date_end = dol_mktime(0, 0, 0, 12, 31, dol_print_date(dol_now(), '%Y'));
}
$object = new BookKeeping($db); $object = new BookKeeping($db);
@ -126,11 +121,12 @@ if (!GETPOST("button_removefilter_x") && !GETPOST("button_removefilter")) // Bot
} }
} }
/* /*
* Action * Action
*/ */
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
{ {
$search_doc_date = ''; $search_doc_date = '';
$search_accountancy_code = ''; $search_accountancy_code = '';

View File

@ -600,7 +600,8 @@ class BookKeeping extends CommonObject
} }
} }
} }
$sql.= ' WHERE 1 = 1'; $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
$sql .= ' WHERE 1 = 1';
$sql .= " AND entity IN (" . getEntity("accountancy", 1) . ")"; $sql .= " AND entity IN (" . getEntity("accountancy", 1) . ")";
if (count($sqlwhere) > 0) { if (count($sqlwhere) > 0) {
$sql .= ' AND ' . implode(' ' . $filtermode . ' ', $sqlwhere); $sql .= ' AND ' . implode(' ' . $filtermode . ' ', $sqlwhere);