diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php
index 905fd8b97ef..9b1b6746861 100644
--- a/htdocs/accountancy/admin/account.php
+++ b/htdocs/accountancy/admin/account.php
@@ -94,9 +94,9 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if (empty($reshook))
{
if (! empty($cancel)) $action = '';
-
+
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
-
+
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{
$search_account = "";
@@ -106,13 +106,13 @@ if (empty($reshook))
$search_pcgsubtype = "";
$search_array_options=array();
}
-
+
if (GETPOST('change_chart'))
{
$chartofaccounts = GETPOST('chartofaccounts', 'int');
-
+
if (! empty($chartofaccounts)) {
-
+
if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) {
$error ++;
}
@@ -120,12 +120,12 @@ if (empty($reshook))
$error ++;
}
}
-
+
if ($action == 'disable') {
if ($accounting->fetch($id)) {
$result = $accounting->account_desactivate($id);
}
-
+
$action = 'update';
if ($result < 0) {
setEventMessages($accounting->error, $accounting->errors, 'errors');
@@ -165,6 +165,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_vers
if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS INTEGER)";
else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS UNSIGNED)";
$sql .= " WHERE asy.rowid = " . $pcgver;
+$sql .= " AND aa.entity = " . $conf->entity;
if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account);
if (strlen(trim($search_label))) $sql .= natural_search("aa.label", $search_label);
@@ -179,7 +180,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql);
-}
+}
$sql .= $db->plimit($limit + 1, $offset);
@@ -209,11 +210,11 @@ if ($resql)
print '';
print '';
print '';
-
+
$htmlbuttonadd = '' . $langs->trans("Addanaccount") . '';
-
+
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd);
-
+
// Box to select active chart of account
print $langs->trans("Selectchartofaccounts") . " : ";
print '";
print '';
- print '
';
+ print '
';
print '
';
-
+
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
-
+
print '
| "; print $accountparent->getNomUrl(1); print " | \n"; @@ -371,11 +372,11 @@ if ($resql) } print '' . "\n"; if (! $i) $totalarray['nbfield']++; - + print "