From f1ea0ce5a160ac9a998039fa9ee71fb52ee966ee Mon Sep 17 00:00:00 2001 From: altairis Date: Wed, 29 Jan 2020 11:47:23 +0100 Subject: [PATCH] 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);