diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index fc1e74f1ac4..6adb3f97f5e 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -248,7 +248,7 @@ if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0 && empty($conf- } } -if (!empty($conf->accounting->enabled) && $line->fk_accounting_account > 0) { +if (isModEnabled('accounting') && $line->fk_accounting_account > 0) { $accountingaccount = new AccountingAccount($this->db); $accountingaccount->fetch($line->fk_accounting_account); print '

'.$langs->trans('AccountingAffectation').' : '.$accountingaccount->getNomUrl(0, 1, 1); diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index 9a360f69882..a78935c74fd 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -if (!empty($conf->accounting->enabled)) { +if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; } @@ -169,7 +169,7 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { $dir = "../../core/modules/dons/"; $form = new Form($db); -if (!empty($conf->accounting->enabled)) { +if (isModEnabled('accounting')) { $formaccounting = new FormAccounting($db); } @@ -335,7 +335,7 @@ print ''; $label = $langs->trans("AccountAccounting"); print ''; print ''; -if (!empty($conf->accounting->enabled)) { +if (isModEnabled('accounting')) { print $formaccounting->select_account($conf->global->DONATION_ACCOUNTINGACCOUNT, 'DONATION_ACCOUNTINGACCOUNT', 1, '', 1, 1); } else { print ''; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 680f1861fe3..8f929ee13cf 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (!empty($conf->accounting->enabled)) { +if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; } @@ -1989,7 +1989,7 @@ if ($action == 'create') { $bankaccountstatic->label = $objp->baref; $bankaccountstatic->number = $objp->banumber; - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { $bankaccountstatic->account_number = $objp->account_number; $accountingjournal = new AccountingJournal($db); @@ -2121,7 +2121,7 @@ if ($action == 'create') { } $titlealt = ''; - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; $accountingaccount = new AccountingAccount($db); $resaccountingaccount = $accountingaccount->fetch(0, $line->type_fees_accountancy_code, 1); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index c4e034dd7a1..1a08e780484 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -40,10 +40,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -if (!empty($conf->accounting->enabled)) { +if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; } -if (!empty($conf->accounting->enabled)) { +if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; } diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 276c5b20ed9..1fdc1816544 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1212,13 +1212,13 @@ class ProductFournisseur extends Product } } - if (!empty($conf->accounting->enabled) && $this->status) { + if (isModEnabled('accounting') && $this->status) { include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; $label .= '
'.$langs->trans('ProductAccountancySellCode').': '.length_accountg($this->accountancy_code_sell); $label .= '
'.$langs->trans('ProductAccountancySellIntraCode').': '.length_accountg($this->accountancy_code_sell_intra); $label .= '
'.$langs->trans('ProductAccountancySellExportCode').': '.length_accountg($this->accountancy_code_sell_export); } - if (!empty($conf->accounting->enabled) && $this->status_buy) { + if (isModEnabled('accounting') && $this->status_buy) { include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; $label .= '
'.$langs->trans('ProductAccountancyBuyCode').': '.length_accountg($this->accountancy_code_buy); $label .= '
'.$langs->trans('ProductAccountancyBuyIntraCode').': '.length_accountg($this->accountancy_code_buy_intra);