diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index ff74273d744..1ee9cc3f7c0 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -513,7 +513,7 @@ $tabcond[27] = isModEnabled("societe");
$tabcond[28] = isModEnabled('holiday');
$tabcond[29] = isModEnabled('project');
$tabcond[30] = isModEnabled('label');
-//$tabcond[31]= !empty($conf->accounting->enabled);
+//$tabcond[31]= isModEnabled('accounting');
$tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm'));
$tabcond[33] = isModEnabled('hrm');
$tabcond[34] = isModEnabled('hrm');
@@ -2076,7 +2076,7 @@ if ($id > 0) {
} elseif (in_array($value, array('recuperableonly'))) {
$class = "center";
} elseif ($value == 'accountancy_code' || $value == 'accountancy_code_sell' || $value == 'accountancy_code_buy') {
- if (!empty($conf->accounting->enabled)) {
+ if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
$tmpaccountingaccount = new AccountingAccount($db);
$tmpaccountingaccount->fetch(0, $valuetoshow, 1);
@@ -2485,7 +2485,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
print '';
} elseif ($value == 'accountancy_code' || $value == 'accountancy_code_sell' || $value == 'accountancy_code_buy') {
print '
';
- if (!empty($conf->accounting->enabled)) {
+ if (isModEnabled('accounting')) {
$fieldname = $value;
$accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0);
print $formaccounting->select_account($accountancy_account, '.'. $value, 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone');
diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php
index 4f8f06ca160..e42da4169b8 100644
--- a/htdocs/asset/admin/setup.php
+++ b/htdocs/asset/admin/setup.php
@@ -530,7 +530,7 @@ if ($action == 'edit') {
}
} elseif ($val['type'] == 'accountancy_code') {
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
- if (!empty($conf->accounting->enabled)) {
+ if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
$formaccounting = new FormAccounting($db);
print $formaccounting->select_account($selected, $constname, 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
@@ -539,7 +539,7 @@ if ($action == 'edit') {
}
} elseif ($val['type'] == 'accountancy_category') {
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
- if (!empty($conf->accounting->enabled)) {
+ if (isModEnabled('accounting')) {
print '';
// autosuggest from existing account types if found
print ' |