Use isModEnabled
This commit is contained in:
parent
2b706c7a60
commit
a2fe675ead
@ -109,7 +109,7 @@ $nbofyear = ($year_end - $year_start) + 1;
|
|||||||
|
|
||||||
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
|
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
|
||||||
$modecompta = $conf->global->ACCOUNTING_MODE;
|
$modecompta = $conf->global->ACCOUNTING_MODE;
|
||||||
if (!empty($conf->accounting->enabled)) {
|
if (isModEnabled('accounting')) {
|
||||||
$modecompta = 'BOOKKEEPING';
|
$modecompta = 'BOOKKEEPING';
|
||||||
}
|
}
|
||||||
if (GETPOST("modecompta")) {
|
if (GETPOST("modecompta")) {
|
||||||
@ -120,10 +120,10 @@ if (GETPOST("modecompta")) {
|
|||||||
if ($user->socid > 0) {
|
if ($user->socid > 0) {
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
if (!empty($conf->comptabilite->enabled)) {
|
if (isModEnabled('comptabilite')) {
|
||||||
$result = restrictedArea($user, 'compta', '', '', 'resultat');
|
$result = restrictedArea($user, 'compta', '', '', 'resultat');
|
||||||
}
|
}
|
||||||
if (!empty($conf->accounting->enabled)) {
|
if (isModEnabled('accounting')) {
|
||||||
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
|
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ if ($modecompta == "CREANCES-DETTES") {
|
|||||||
$name = $langs->trans("Turnover");
|
$name = $langs->trans("Turnover");
|
||||||
$calcmode = $langs->trans("CalcModeDebt");
|
$calcmode = $langs->trans("CalcModeDebt");
|
||||||
//$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
|
//$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
|
||||||
if (!empty($conf->accounting->enabled)) {
|
if (isModEnabled('accounting')) {
|
||||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')';
|
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{link1}', '{link2}').')';
|
||||||
$calcmode = str_replace('{link1}', '<a class="bold" href="'.$_SERVER["PHP_SELF"].'?'.($param ? $param : 'year_start='.$year_start).'&modecompta=BOOKKEEPING">', $calcmode);
|
$calcmode = str_replace('{link1}', '<a class="bold" href="'.$_SERVER["PHP_SELF"].'?'.($param ? $param : 'year_start='.$year_start).'&modecompta=BOOKKEEPING">', $calcmode);
|
||||||
$calcmode = str_replace('{link2}', '</a>', $calcmode);
|
$calcmode = str_replace('{link2}', '</a>', $calcmode);
|
||||||
@ -171,7 +171,7 @@ if ($modecompta == "CREANCES-DETTES") {
|
|||||||
$name = $langs->trans("TurnoverCollected");
|
$name = $langs->trans("TurnoverCollected");
|
||||||
$calcmode = $langs->trans("CalcModeEngagement");
|
$calcmode = $langs->trans("CalcModeEngagement");
|
||||||
//$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
|
//$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
|
||||||
//if (!empty($conf->accounting->enabled)) {
|
//if (isModEnabled('accounting')) {
|
||||||
//$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPINGCOLLECTED">','</a>').')';
|
//$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPINGCOLLECTED">','</a>').')';
|
||||||
//}
|
//}
|
||||||
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||||
@ -201,7 +201,7 @@ if (!empty($modecompta)) {
|
|||||||
}
|
}
|
||||||
report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $moreparam, $calcmode);
|
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);
|
print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user