From 9019604885f4666810c5de2fe33c8b162e2de265 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Mon, 29 Aug 2022 11:26:18 +0200 Subject: [PATCH] Use isModEnabled --- htdocs/compta/resultat/clientfourn.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 936adb482d2..9f12b12f7e5 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -132,7 +132,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", 'alpha')) { @@ -146,10 +146,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'); } @@ -174,7 +174,7 @@ if ($modecompta == "CREANCES-DETTES") { $calcmode = $langs->trans("CalcModeDebt"); $calcmode .= '
('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')'; $calcmode = str_replace(array('{s1}', '{s2}'), array('', ''), $calcmode); - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')'; $calcmode = str_replace(array('{s1}', '{s2}'), array('', ''), $calcmode); } @@ -193,7 +193,7 @@ if ($modecompta == "CREANCES-DETTES") { $calcmode = $langs->trans("CalcModeEngagement"); $calcmode .= '
('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')'; $calcmode = str_replace(array('{s1}', '{s2}'), array('', ''), $calcmode); - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { $calcmode .= '
('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')'; $calcmode = str_replace(array('{s1}', '{s2}'), array('', ''), $calcmode); } @@ -223,7 +223,7 @@ $hselected = 'report'; report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array('modecompta'=>$modecompta, 'showaccountdetail'=>$showaccountdetail), $calcmode); -if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { +if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') { print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); } @@ -1127,7 +1127,7 @@ if ($modecompta == 'BOOKKEEPING') { */ //$conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY = 1; - if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->banque->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { + if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && isModEnabled('banque') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { $subtotal_ht = 0; $subtotal_ttc = 0;