Browse Source

Use isModEnabled

Alexandre SPANGARO 2 years ago
parent
commit
8f41a59fce

+ 1 - 1
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) {

+ 2 - 2
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);

+ 1 - 1
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) {