From b04bb9e392738366665a5d0c593762a16092b940 Mon Sep 17 00:00:00 2001 From: altairis Date: Wed, 29 Jan 2020 11:05:10 +0100 Subject: [PATCH 1/3] FIX : fetching account on current entity --- htdocs/accountancy/class/accountingaccount.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 55e463a73f6..c85fa48fe72 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -178,6 +178,7 @@ class AccountingAccount extends CommonObject if (! empty($limittoachartaccount)) { $sql .= " AND a.fk_pcg_version = '".$this->db->escape($limittoachartaccount)."'"; } + $sql.= " AND a.entity = ".$conf->entity; dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG); $result = $this->db->query($sql); From 3c3876eb595cb20bc4bfb98800613212cc2312b2 Mon Sep 17 00:00:00 2001 From: altairis Date: Wed, 29 Jan 2020 11:32:24 +0100 Subject: [PATCH 2/3] FIX : default lang selection when filter --- htdocs/core/class/html.formadmin.class.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 166e0ce2044..0ab3b2f9e55 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -95,12 +95,9 @@ class FormAdmin if ($showcode == 1) $valuetoshow=$key.' - '.$value; if ($showcode == 2) $valuetoshow=$value.' ('.$key.')'; - if ($filter && is_array($filter)) + if ($filter && is_array($filter) && array_key_exists($key, $filter)) { - if ( ! array_key_exists($key, $filter)) - { - $out.= ''; - } + continue; } elseif ($selected == $key) { From f1ea0ce5a160ac9a998039fa9ee71fb52ee966ee Mon Sep 17 00:00:00 2001 From: altairis Date: Wed, 29 Jan 2020 11:47:23 +0100 Subject: [PATCH 3/3] better fix --- htdocs/accountancy/class/accountingaccount.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index c85fa48fe72..52f71378025 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -171,6 +171,7 @@ class AccountingAccount extends CommonObject $sql .= " a.rowid = " . (int) $rowid; } elseif ($account_number) { $sql .= " a.account_number = '" . $this->db->escape($account_number) . "'"; + $sql .= " AND a.entity = ".$conf->entity; } if (! empty($limittocurrentchart)) { $sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $this->db->escape($conf->global->CHARTOFACCOUNTS) . ')'; @@ -178,7 +179,6 @@ class AccountingAccount extends CommonObject if (! empty($limittoachartaccount)) { $sql .= " AND a.fk_pcg_version = '".$this->db->escape($limittoachartaccount)."'"; } - $sql.= " AND a.entity = ".$conf->entity; dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG); $result = $this->db->query($sql);