From e96e0f637ae50e8967493f82fae5d42749da5c31 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Thu, 28 Apr 2016 10:41:37 +0200 Subject: [PATCH 1/2] FIX: Not filtering correctly when come from dashboard --- htdocs/fourn/facture/list.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index aba66991eec..9c945f01410 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -229,6 +229,15 @@ if ($search_status != '') { $sql.= " AND fac.fk_statut = ".$search_status; } +if ($filter && $filter != -1) +{ + $aFilter = explode(',', $filter); + foreach ($aFilter as $fil) + { + $filt = explode(':', $fil); + $sql .= ' AND ' . trim($filt[0]) . ' = ' . trim($filt[1]); + } +} $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) From 33499ae6525adefdbbce62140e5d9d77cacfce4d Mon Sep 17 00:00:00 2001 From: fmarcet Date: Thu, 28 Apr 2016 11:14:00 +0200 Subject: [PATCH 2/2] FIX: Compatible with multicompany --- htdocs/compta/bank/class/account.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 9747703c58f..7058647fae6 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -7,6 +7,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Marcos GarcĂ­a * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2016 Ferran Marcet * * 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 @@ -986,6 +987,7 @@ class Account extends CommonObject $sql = "SELECT COUNT(ba.rowid) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= " WHERE ba.rappro > 0 and ba.clos = 0"; + $sql.= " AND ba.entity IN (".getEntity('bank_account', 1).")"; if (empty($conf->global->BANK_CAN_RECONCILIATE_CASHACCOUNT)) $sql.= " AND ba.courant != 2"; $resql=$db->query($sql); if ($resql)