diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php
index 4051055af60..a81c732017f 100644
--- a/htdocs/compta/stats/index.php
+++ b/htdocs/compta/stats/index.php
@@ -109,7 +109,7 @@ $nbofyear = ($year_end - $year_start) + 1;
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
$modecompta = $conf->global->ACCOUNTING_MODE;
-if (!empty($conf->accounting->enabled)) {
+if (isModEnabled('accounting')) {
$modecompta = 'BOOKKEEPING';
}
if (GETPOST("modecompta")) {
@@ -120,10 +120,10 @@ if (GETPOST("modecompta")) {
if ($user->socid > 0) {
$socid = $user->socid;
}
-if (!empty($conf->comptabilite->enabled)) {
+if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
-if (!empty($conf->accounting->enabled)) {
+if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
@@ -153,7 +153,7 @@ if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("Turnover");
$calcmode = $langs->trans("CalcModeDebt");
//$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')';
- if (!empty($conf->accounting->enabled)) {
+ if (isModEnabled('accounting')) {
$calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')';
$calcmode = str_replace('{link1}', '', $calcmode);
$calcmode = str_replace('{link2}', '', $calcmode);
@@ -171,7 +171,7 @@ if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("TurnoverCollected");
$calcmode = $langs->trans("CalcModeEngagement");
//$calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode",'','').')';
- //if (!empty($conf->accounting->enabled)) {
+ //if (isModEnabled('accounting')) {
//$calcmode.='
('.$langs->trans("SeeReportInBookkeepingMode",'','').')';
//}
$periodlink = ($year_start ? "".img_previous()." ".img_next()."" : "");
@@ -201,7 +201,7 @@ if (!empty($modecompta)) {
}
report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $moreparam, $calcmode);
-if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') {
+if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
}