Use isModEnabled
This commit is contained in:
parent
a2fe675ead
commit
ebff140389
@ -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 .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')';
|
||||
$calcmode = str_replace('{link1}', '<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">', $calcmode);
|
||||
$calcmode = str_replace('{link2}', '</a>', $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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user