diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php
index cd70671af61..abbb92223cb 100644
--- a/htdocs/compta/stats/supplier_turnover.php
+++ b/htdocs/compta/stats/supplier_turnover.php
@@ -103,7 +103,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")) {
@@ -114,10 +114,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');
}
@@ -142,7 +142,7 @@ if ($modecompta == "BOOKKEEPINGCOLLECTED") {
if ($modecompta == "CREANCES-DETTES") {
$name = $langs->trans("PurchaseTurnover");
$calcmode = $langs->trans("CalcModeDebt");
- if (!empty($conf->accounting->enabled)) {
+ if (isModEnabled('accounting')) {
$calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')';
$calcmode = str_replace('{link1}', '', $calcmode);
$calcmode = str_replace('{link2}', '', $calcmode);
@@ -187,7 +187,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);
}