From 07e91a061a347c6f0168384c6350fed64a771bd8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 29 Aug 2022 11:26:32 +0200 Subject: [PATCH] Use isModEnabled --- htdocs/compta/resultat/result.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 81e6672a1e4..57157ec0140 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -137,7 +137,7 @@ if ($cat_id == 0) { // 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")) { @@ -151,10 +151,10 @@ $socid = GETPOST('socid', 'int'); 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'); } @@ -193,7 +193,7 @@ if ($modecompta == "CREANCES-DETTES") { $name = $langs->trans("AnnualByAccountDueDebtMode"); $calcmode = $langs->trans("CalcModeDebt"); $calcmode .= '
('.$langs->trans("SeeReportInInputOutputMode", '', '').')'; - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '', '').')'; } $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); @@ -210,7 +210,7 @@ if ($modecompta == "CREANCES-DETTES") { $name = $langs->trans("AnnualByAccountInputOutputMode"); $calcmode = $langs->trans("CalcModeEngagement"); $calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode", '', '').')'; - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '', '').')'; } $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); @@ -238,7 +238,7 @@ if ($modecompta == "CREANCES-DETTES") { report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array('modecompta'=>$modecompta, 'action' => ''), $calcmode); -if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { +if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') { print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); }