diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php
index f04833ff107..6265ed2af69 100644
--- a/htdocs/stripe/transaction.php
+++ b/htdocs/stripe/transaction.php
@@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
-if (!empty($conf->accounting->enabled)) {
+if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
}
diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php
index 4f3ee5c32c8..36b3da25c7a 100644
--- a/htdocs/user/bank.php
+++ b/htdocs/user/bank.php
@@ -573,7 +573,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
}
// Accountancy code
- if (!empty($conf->accounting->enabled)) {
+ if (isModEnabled('accounting')) {
print '
| '.$langs->trans("AccountancyCode").' | ';
print ''.$object->accountancy_code.' |
';
}
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index b1038b3a4cd..11aa6f01148 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -1155,7 +1155,7 @@ if ($action == 'create' || $action == 'adduserldap') {
}
// Accountancy code
- if (!empty($conf->accounting->enabled)) {
+ if (isModEnabled('accounting')) {
print '| '.$langs->trans("AccountancyCode").' | ';
print '';
print '';
@@ -2540,7 +2540,7 @@ if ($action == 'create' || $action == 'adduserldap') {
}
// Accountancy code
- if (!empty($conf->accounting->enabled)) {
+ if (isModEnabled('accounting')) {
print " |
";
print '| '.$langs->trans("AccountancyCode").' | ';
print '';
diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php
index 6124b77e95f..0e36db8c405 100644
--- a/htdocs/user/param_ihm.php
+++ b/htdocs/user/param_ihm.php
@@ -201,7 +201,7 @@ if (isModEnabled("product") || isModEnabled("service")) {
if (isModEnabled("propal") || isModEnabled('commande') || !empty($conf->ficheinter->enabled) || isModEnabled('contrat')) {
$tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = 'CommercialArea';
}
-if (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled)) {
+if (!empty($conf->comptabilite->enabled) || isModEnabled('accounting')) {
$tmparray['compta/index.php?mainmenu=compta&leftmenu='] = 'AccountancyTreasuryArea';
}
if (isModEnabled('adherent')) {
diff --git a/test/phpunit/AccountingAccountTest.php b/test/phpunit/AccountingAccountTest.php
index 52efe3a0147..7bee4dd3b00 100644
--- a/test/phpunit/AccountingAccountTest.php
+++ b/test/phpunit/AccountingAccountTest.php
@@ -83,7 +83,7 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase
global $conf,$user,$langs,$db;
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
- if (empty($conf->accounting->enabled)) {
+ if (!isModEnabled('accounting')) {
print __METHOD__." module accouting must be enabled.\n"; exit(-1);
}
|