diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index f43e677d773..9e1261788bf 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -110,7 +110,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')) { @@ -122,10 +122,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'); } @@ -151,7 +151,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); } @@ -171,7 +171,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); } @@ -200,7 +200,7 @@ $hselected = 'report'; report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array('modecompta'=>$modecompta), $calcmode); -if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') { +if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') { print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1); } @@ -796,7 +796,7 @@ if (!empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom * Various Payments */ -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")) { // decaiss $sql = "SELECT date_format(p.datep, '%Y-%m') AS dm, SUM(p.amount) AS amount FROM ".MAIN_DB_PREFIX."payment_various as p"; @@ -907,7 +907,7 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan * Request in mode BOOKKEEPING */ -if (!empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING')) { +if (isModEnabled('accounting') && ($modecompta == 'BOOKKEEPING')) { $predefinedgroupwhere = "("; $predefinedgroupwhere .= " (aa.pcg_type = 'EXPENSE')"; $predefinedgroupwhere .= " OR ";