*
@@ -26,14 +26,6 @@
// Load Dolibarr environment
require '../../main.inc.php';
-require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
-require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
-require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
/**
* @var Conf $conf
@@ -43,6 +35,16 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php
* @var User $user
*/
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
+require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyreport.class.php';
+require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
+
// Load translation files required by the page
$langs->loadLangs(array("errors", "admin", "companies", "resource", "holiday", "accountancy", "hrm"));
@@ -70,7 +72,7 @@ $listlimit = GETPOSTINT('listlimit') > 0 ? GETPOSTINT('listlimit') : 1000;
$sortfield = (string) GETPOST("sortfield", 'aZ09comma');
$sortorder = GETPOST("sortorder", 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
-if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
+if (empty($page) || $page < 0 || GETPOST('button_refresh', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
// If $page is not defined, or '' or -1 or if we click on clear filters
$page = 0;
}
@@ -80,6 +82,22 @@ $pagenext = $page + 1;
$search_country_id = GETPOST('search_country_id', 'int');
+// Report filter (Multi report)
+$search_report = GETPOSTINT('search_report');
+if (getDolGlobalInt('ACCOUNTING_ENABLE_MULTI_REPORT')) {
+ if (empty($search_report)) {
+ // Try to get from session
+ if (!empty($_SESSION['accounting_category_report_filter'])) {
+ $search_report = $_SESSION['accounting_category_report_filter'];
+ } else {
+ $search_report = 1; // Default report
+ }
+ } else {
+ // Save in session
+ $_SESSION['accounting_category_report_filter'] = $search_report;
+ }
+}
+
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('admin'));
@@ -99,7 +117,7 @@ $tablib[32] = "DictionaryAccountancyCategory";
// Requests to extract data
$tabsql = array();
-$tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid AND c.active=1 AND a.entity IN (".getEntity('c_accounting_category').")";
+$tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.category_type, a.formula, a.position as position, a.fk_report, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid AND c.active=1 AND a.entity IN (".getEntity('c_accounting_category').")";
// Criteria to sort dictionaries
$tabsqlsort = array();
@@ -147,6 +165,12 @@ $accountingcategory = new AccountancyCategory($db);
if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter_x', 'alpha')) {
$search_country_id = '';
+
+ // Reset report filter
+ if (getDolGlobalInt('ACCOUNTING_ENABLE_MULTI_REPORT')) {
+ $search_report = 1;
+ $_SESSION['accounting_category_report_filter'] = 1;
+ }
}
// Actions add or modify an entry into a dictionary
@@ -426,6 +450,71 @@ print load_fiche_titre($titre, $linkback, $titlepicto);
print ''.$langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'
';
+// Report selector (New System)
+if (getDolGlobalInt('ACCOUNTING_ENABLE_MULTI_REPORT')) {
+ print '';
+
+ print '
';
+
+ print '
';
+ print '';
+}
+
// Confirmation of the deletion of the line
if ($action == 'delete') {
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id.($search_country_id > 0 ? '&search_country_id='.$search_country_id : ''), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
@@ -443,6 +532,15 @@ if ($search_country_id > 0) {
$sql .= " (a.fk_country = ".((int) $search_country_id)." OR a.fk_country = 0)";
}
+if (getDolGlobalInt('ACCOUNTING_ENABLE_MULTI_REPORT') && $search_report > 0) {
+ if (preg_match('/ WHERE /', $sql)) {
+ $sql .= " AND ";
+ } else {
+ $sql .= " WHERE ";
+ }
+ $sql .= " a.fk_report = ".((int) $search_report);
+}
+
// If sort order is "country", we use country_code instead
if ($sortfield == 'country') {
$sortfield = 'country_code';
@@ -461,6 +559,9 @@ $param = '&id='.$id;
if ($search_country_id > 0) {
$param .= '&search_country_id='.urlencode((string) ($search_country_id));
}
+if (getDolGlobalInt('ACCOUNTING_ENABLE_MULTI_REPORT') && $search_report > 0) {
+ $param .= '&search_report='.urlencode((string) ($search_report));
+}
$paramwithsearch = $param;
if ($sortorder) {
$paramwithsearch .= '&sortorder='.urlencode($sortorder);
@@ -889,11 +990,18 @@ if ($resql) {
print '';
if (empty($obj->formula)) {
// Count number of accounts into group
- $nbofaccountintogroup = 0;
- $listofaccountintogroup = $accountingcategory->getCptsCat($obj->rowid);
- $nbofaccountintogroup = count($listofaccountintogroup);
+ if (getDolGlobalInt('ACCOUNTING_ENABLE_MULTI_REPORT')) {
+ // NEW SYSTEM: Multi report
+ $accountingcategory_temp = new AccountancyCategory($db);
+ $accountingcategory_temp->id = $obj->rowid;
+ $nbofaccountintogroup = $accountingcategory_temp->countAccountsInCategory();
+ } else {
+ // OLD SYSTEM: Only one report
+ $listofaccountintogroup = $accountingcategory->getCptsCat($obj->rowid);
+ $nbofaccountintogroup = count($listofaccountintogroup);
+ }
- print '';
+ print '';
print $langs->trans("NAccounts", $nbofaccountintogroup);
print '';
} else {
@@ -902,7 +1010,7 @@ if ($resql) {
print ' | ';
// Active
- print '';
+ print ' | ';
if ($canbedisabled) {
print ''.$actl[$obj->active].'';
} else {
diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php
index dcfdbd16518..4931bcbad02 100644
--- a/htdocs/accountancy/class/accountancycategory.class.php
+++ b/htdocs/accountancy/class/accountancycategory.class.php
@@ -1,8 +1,8 @@
- * Copyright (C) 2016-2025 Alexandre Spangaro
- * Copyright (C) 2018-2025 Frédéric France
- * Copyright (C) 2024-2025 MDW
+/* Copyright (C) 2016 Jamal Elbaz
+ * Copyright (C) 2016-2026 Alexandre Spangaro
+ * Copyright (C) 2018-2025 Frédéric France
+ * Copyright (C) 2024-2025 MDW
*
* 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
@@ -906,4 +906,326 @@ class AccountancyCategory // extends CommonObject
return -1;
}
}
+
+
+ // ====================================================================
+ // MULTI REPORT METHODS (New system with llx_accounting_category_account)
+ // Requires constant ACCOUNTING_ENABLE_MULTI_REPORT
+ // ====================================================================
+
+ /**
+ * Link an accounting account to this category (multi-report system)
+ *
+ * @param int $fkAccountingAccount ID of the accounting account to link
+ * @return int<-1,1> <0 if KO, 0 if already exists, >0 if OK
+ */
+ public function addAccountToCategory($fkAccountingAccount)
+ {
+ // Check if relation already exists
+ if ($this->isAccountInCategory($fkAccountingAccount)) {
+ return 0;
+ }
+
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_category_account";
+ $sql .= " (fk_accounting_category, fk_accounting_account)";
+ $sql .= " VALUES (".((int) $this->id).", ".((int) $fkAccountingAccount).")";
+
+ dol_syslog(get_class($this)."::addAccountToCategory", LOG_DEBUG);
+
+ $this->db->begin();
+
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ $this->db->commit();
+ return 1;
+ } else {
+ $this->error = $this->db->lasterror();
+ $this->errors[] = $this->error;
+ $this->db->rollback();
+ return -1;
+ }
+ }
+
+ /**
+ * Unlink an accounting account from this category (multi-report system)
+ *
+ * @param int $fkAccountingAccount ID of the accounting account to unlink
+ * @return int<-1,1> <0 if KO, >0 if OK
+ */
+ public function deleteAccountFromCategory($fkAccountingAccount)
+ {
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."accounting_category_account";
+ $sql .= " WHERE fk_accounting_category = ".((int) $this->id);
+ $sql .= " AND fk_accounting_account = ".((int) $fkAccountingAccount);
+
+ dol_syslog(get_class($this)."::deleteAccountFromCategory", LOG_DEBUG);
+
+ $this->db->begin();
+
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ $this->db->commit();
+ return 1;
+ } else {
+ $this->error = $this->db->lasterror();
+ $this->errors[] = $this->error;
+ $this->db->rollback();
+ return -1;
+ }
+ }
+
+ /**
+ * Get all accounting accounts linked to this category (multi-report system)
+ *
+ * @return array Array of accounting accounts indexed by account ID, or empty array if error
+ */
+ public function getAccountsForCategory()
+ {
+ global $conf;
+
+ $accounts = array();
+
+ $sql = "SELECT aca.fk_accounting_account, aa.account_number, aa.label";
+ $sql .= " FROM ".MAIN_DB_PREFIX."accounting_category_account as aca";
+ $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = aca.fk_accounting_account";
+ $sql .= " WHERE aca.fk_accounting_category = ".((int) $this->id);
+ $sql .= " AND aa.entity = ".$conf->entity;
+ $sql .= " ORDER BY aa.account_number ASC";
+
+ dol_syslog(get_class($this)."::getAccountsForCategory", LOG_DEBUG);
+
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ $num = $this->db->num_rows($resql);
+ $i = 0;
+ while ($i < $num) {
+ $obj = $this->db->fetch_object($resql);
+ $accounts[$obj->fk_accounting_account] = array(
+ 'id' => $obj->fk_accounting_account,
+ 'account_number' => $obj->account_number,
+ 'label' => $obj->label
+ );
+ $i++;
+ }
+ $this->db->free($resql);
+ return $accounts;
+ } else {
+ $this->error = $this->db->lasterror();
+ $this->errors[] = $this->error;
+ dol_syslog(get_class($this)."::getAccountsForCategory ".$this->error, LOG_ERR);
+ return array();
+ }
+ }
+
+ /**
+ * Get categories for a specific accounting account (multi-report system)
+ *
+ * @param int $fkAccountingAccount ID of the accounting account
+ * @return array Array of categories indexed by category ID, or empty array if error
+ */
+ public function getCategoriesForAccount($fkAccountingAccount)
+ {
+ global $conf;
+
+ $categories = array();
+
+ $sql = "SELECT aca.fk_accounting_category, ac.code, ac.label, ac.fk_report";
+ $sql .= " FROM ".MAIN_DB_PREFIX."accounting_category_account as aca";
+ $sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_accounting_category as ac ON ac.rowid = aca.fk_accounting_category";
+ $sql .= " WHERE aca.fk_accounting_account = ".((int) $fkAccountingAccount);
+ $sql .= " AND ac.entity = ".$conf->entity;
+ $sql .= " ORDER BY ac.position ASC";
+
+ dol_syslog(get_class($this)."::getCategoriesForAccount", LOG_DEBUG);
+
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ $num = $this->db->num_rows($resql);
+ $i = 0;
+ while ($i < $num) {
+ $obj = $this->db->fetch_object($resql);
+ $categories[$obj->fk_accounting_category] = array(
+ 'id' => $obj->fk_accounting_category,
+ 'code' => $obj->code,
+ 'label' => $obj->label,
+ 'fk_report' => $obj->fk_report
+ );
+ $i++;
+ }
+ $this->db->free($resql);
+ return $categories;
+ } else {
+ $this->error = $this->db->lasterror();
+ $this->errors[] = $this->error;
+ dol_syslog(get_class($this)."::getCategoriesForAccount ".$this->error, LOG_ERR);
+ return array();
+ }
+ }
+
+ /**
+ * Check if an account belongs to this category (multi-report system)
+ *
+ * @param int $fkAccountingAccount ID of the accounting account
+ * @return bool True if account is in category, false otherwise
+ */
+ public function isAccountInCategory($fkAccountingAccount)
+ {
+ $sql = "SELECT COUNT(*) as nb";
+ $sql .= " FROM ".MAIN_DB_PREFIX."accounting_category_account";
+ $sql .= " WHERE fk_accounting_category = ".((int) $this->id);
+ $sql .= " AND fk_accounting_account = ".((int) $fkAccountingAccount);
+
+ dol_syslog(get_class($this)."::isAccountInCategory", LOG_DEBUG);
+
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ $obj = $this->db->fetch_object($resql);
+ return ($obj->nb > 0);
+ }
+ return false;
+ }
+
+ /**
+ * Get all accounting accounts NOT linked to this category (for selection)
+ *
+ * @return array Array of available accounts, or empty array if error
+ */
+ public function getAvailableAccountsForCategory()
+ {
+ global $conf;
+
+ $accounts = array();
+
+ $pcgverid = getDolGlobalInt('CHARTOFACCOUNTS');
+ $pcgvercode = dol_getIdFromCode($this->db, (string) $pcgverid, 'accounting_system', 'rowid', 'pcg_version');
+ if (empty($pcgvercode)) {
+ $pcgvercode = $pcgverid;
+ }
+
+ $sql = "SELECT aa.rowid, aa.account_number, aa.label";
+ $sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa";
+ $sql .= " WHERE aa.rowid NOT IN (";
+ $sql .= " SELECT fk_accounting_account";
+ $sql .= " FROM ".MAIN_DB_PREFIX."accounting_category_account";
+ $sql .= " WHERE fk_accounting_category = ".((int) $this->id);
+ $sql .= " )";
+ $sql .= " AND aa.entity = ".$conf->entity;
+ $sql .= " AND aa.active = 1";
+ $sql .= " AND aa.fk_pcg_version = '".$this->db->escape($pcgvercode)."'";
+ $sql .= " ORDER BY aa.account_number ASC";
+
+ dol_syslog(get_class($this)."::getAvailableAccountsForCategory", LOG_DEBUG);
+
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ $num = $this->db->num_rows($resql);
+ $i = 0;
+ while ($i < $num) {
+ $obj = $this->db->fetch_object($resql);
+ $accounts[$obj->rowid] = array(
+ 'id' => $obj->rowid,
+ 'account_number' => $obj->account_number,
+ 'label' => $obj->label
+ );
+ $i++;
+ }
+ $this->db->free($resql);
+ return $accounts;
+ } else {
+ $this->error = $this->db->lasterror();
+ $this->errors[] = $this->error;
+ dol_syslog(get_class($this)."::getAvailableAccountsForCategory ".$this->error, LOG_ERR);
+ return array();
+ }
+ }
+
+ /**
+ * Add multiple accounts to this category at once
+ *
+ * @param array $accountIds Array of accounting account IDs
+ * @return int<-1,max> Number of accounts added, -1 if error
+ */
+ public function addMultipleAccountsToCategory(array $accountIds)
+ {
+ $added = 0;
+ $error = 0;
+
+ $this->db->begin();
+
+ foreach ($accountIds as $accountId) {
+ if (!$this->isAccountInCategory($accountId)) {
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_category_account";
+ $sql .= " (fk_accounting_category, fk_accounting_account)";
+ $sql .= " VALUES (".((int) $this->id).", ".((int) $accountId).")";
+
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ $added++;
+ } else {
+ $error++;
+ $this->error = $this->db->lasterror();
+ $this->errors[] = $this->error;
+ }
+ }
+ }
+
+ if ($error) {
+ $this->db->rollback();
+ return -1;
+ } else {
+ $this->db->commit();
+ return $added;
+ }
+ }
+
+ /**
+ * Remove all accounts from this category
+ *
+ * @return int<-1,max> Number of deleted relations if OK, -1 if error
+ */
+ public function removeAllAccountsFromCategory()
+ {
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."accounting_category_account";
+ $sql .= " WHERE fk_accounting_category = ".((int) $this->id);
+
+ dol_syslog(get_class($this)."::removeAllAccountsFromCategory", LOG_DEBUG);
+
+ $this->db->begin();
+
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ $affected = $this->db->affected_rows($resql);
+ $this->db->commit();
+ return $affected;
+ } else {
+ $this->error = $this->db->lasterror();
+ $this->errors[] = $this->error;
+ $this->db->rollback();
+ return -1;
+ }
+ }
+
+ /**
+ * Count number of accounts linked to this category
+ *
+ * @return int Number of accounts, <0 if error
+ */
+ public function countAccountsInCategory()
+ {
+ $sql = "SELECT COUNT(*) as nb";
+ $sql .= " FROM ".MAIN_DB_PREFIX."accounting_category_account";
+ $sql .= " WHERE fk_accounting_category = ".((int) $this->id);
+
+ dol_syslog(get_class($this)."::countAccountsInCategory", LOG_DEBUG);
+
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ $obj = $this->db->fetch_object($resql);
+ return (int) $obj->nb;
+ } else {
+ $this->error = $this->db->lasterror();
+ $this->errors[] = $this->error;
+ return -1;
+ }
+ }
}
diff --git a/htdocs/accountancy/class/accountancyreport.class.php b/htdocs/accountancy/class/accountancyreport.class.php
index 69f1dda8a0e..9d9b8b3701b 100644
--- a/htdocs/accountancy/class/accountancyreport.class.php
+++ b/htdocs/accountancy/class/accountancyreport.class.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2024-2026 Alexandre Spangaro
* Copyright (C) 2025 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql
index 3701b84b757..529e081e4ae 100644
--- a/htdocs/core/menus/init_menu_auguria.sql
+++ b/htdocs/core/menus/init_menu_auguria.sql
@@ -300,7 +300,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2465__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_product', 2451__+MAX_llx_menu__, '/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuProductsAccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 60, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2466__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_closure', 2451__+MAX_llx_menu__, '/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'MenuClosureAccounts', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 70, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2470__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_report_group', 2451__+MAX_llx_menu__, '/accountancy/admin/report_list.php?id=45&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingReport', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 75, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin" && getDolGlobalInt("ACCOUNTING_ENABLE_MULTI_REPORT")', __HANDLER__, 'left', 2470__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_report_group', 2451__+MAX_llx_menu__, '/accountancy/admin/report_list.php?id=45&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingReport', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 75, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2471__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_chart_group', 2451__+MAX_llx_menu__, '/accountancy/admin/categories_list.php?id=32&mainmenu=accountancy&leftmenu=accountancy_admin', 'AccountingCategory', 2, 'accountancy', '$user->hasRight("accounting","chartofaccount")', '', 0, 80, __ENTITY__);
-- Binding
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 4c06713d889..430b0152550 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -1764,10 +1764,10 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef
$newmenu->add("/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuExpenseReportAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 100);
}
$newmenu->add("/accountancy/admin/template/list.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuListBookkeepingTemplates"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_template', 110);
- $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_product', 120);
- $newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_closure', 130);
- if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
- $newmenu->add("/accountancy/admin/report_list.php?id=32&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingReport"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_report', 140);
+ $newmenu->add("/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuProductsAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_product', 110);
+ $newmenu->add("/accountancy/admin/closure.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuClosureAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_closure', 120);
+ if (getDolGlobalInt('ACCOUNTING_ENABLE_MULTI_REPORT')) {
+ $newmenu->add("/accountancy/admin/report_list.php?id=32&search_country_id=" . $mysoc->country_id . "&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingReport"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_report', 125);
}
$newmenu->add("/accountancy/admin/categories_list.php?id=32&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("AccountingCategory"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 145);
}
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index eb8ddebcdf4..50bb879da49 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -339,6 +339,24 @@ BindingOptions=Options for the transfer in accountancy
ApplyMassCategories=Apply mass categories
AddAccountFromBookKeepingWithNoCategories=Available account not yet in the personalized group
CategoryDeleted=Category for the accounting account has been removed
+ManageAccountsForCategory=Manage accounts for category
+AccountsLinked=Linked accounts
+AccountAddedToCategory=Account added to category
+AccountAlreadyInCategory=Account already in this category
+AccountRemovedFromCategory=Account removed from category
+RemoveAccountFromCategory=Remove account from category
+ConfirmRemoveAccountFromCategory=Are you sure you want to remove this account from this category?
+RemoveAllAccountsFromCategory=Remove all accounts
+ConfirmRemoveAllAccountsFromCategory=Are you sure you want to remove all accounts from this category?
+XAccountsAdded=%s account(s) added
+XAccountsRemoved=%s account(s) removed
+NoAccountAdded=No account added
+NoAccountLinked=No linked account
+AddAccountsToCategory=Add accounts to category
+SelectAccountsToAdd=Select the accounts to add to this category
+AllAccountsAlreadyLinked=All accounts are already linked to this category
+ReportPersonalized=Personalized report
+AccountingCategoriesFilteredByReport=Accounting categories displayed are filtered by the selected report
AccountingJournals=Accounting journals
AccountingJournal=Accounting journal
NewAccountingJournal=New accounting journal
|