Use isModEnabled
This commit is contained in:
parent
9019604885
commit
768f6416ab
@ -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 .= '<br>('.$langs->trans("SeeReportInInputOutputMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">', '</a>'), $calcmode);
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">', '</a>'), $calcmode);
|
||||
}
|
||||
@ -171,7 +171,7 @@ if ($modecompta == 'CREANCES-DETTES') {
|
||||
$calcmode = $langs->trans("CalcModeEngagement");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">', '</a>'), $calcmode);
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{s1}', '{s2}').')';
|
||||
$calcmode = str_replace(array('{s1}', '{s2}'), array('<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">', '</a>'), $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 ";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user