From 8f41a59fce5925e70bc9c85f30efe15bbcdefe4e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 24 Aug 2022 10:34:19 +0200 Subject: [PATCH] Use isModEnabled --- htdocs/accountancy/bookkeeping/listbyaccount.php | 2 +- htdocs/accountancy/class/accountingjournal.class.php | 4 ++-- htdocs/accountancy/closure/index.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index bb864fc39e3..0bd1c06aab8 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -187,7 +187,7 @@ if ($search_date_end && empty($search_date_endyear)) { $search_date_endday = $tmparray['mday']; } -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) { diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index c8948b05012..9720399fb5e 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -429,7 +429,7 @@ class AccountingJournal extends CommonObject { global $conf, $langs; - if (empty($conf->asset->enabled)) { + if (!isModEnabled('asset')) { return array(); } @@ -867,7 +867,7 @@ class AccountingJournal extends CommonObject } } // - // if (!$error_for_line && !empty($conf->asset->enabled) && $this->nature == 1 && $bookkeeping->fk_doc > 0) { + // if (!$error_for_line && isModEnabled('asset') && $this->nature == 1 && $bookkeeping->fk_doc > 0) { // // Set last cumulative depreciation // require_once DOL_DOCUMENT_ROOT . '/asset/class/asset.class.php'; // $asset = new Asset($this->db); diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php index a1d75440b56..2aaa24d942a 100644 --- a/htdocs/accountancy/closure/index.php +++ b/htdocs/accountancy/closure/index.php @@ -57,7 +57,7 @@ $search_date_end = dol_get_last_day($year_end, $month_end); $year_current = $year_start; // Security check -if (empty($conf->accounting->enabled)) { +if (!isModEnabled('accounting')) { accessforbidden(); } if ($user->socid > 0) {