From 36f2c139e585eb00099299aa8a9761d4192a3645 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 4 Sep 2022 13:33:11 +0200 Subject: [PATCH] update code --- htdocs/societe/admin/societe.php | 2 +- htdocs/societe/card.php | 18 +++++++++--------- htdocs/societe/class/societe.class.php | 4 ++-- htdocs/stripe/charge.php | 2 +- htdocs/stripe/payout.php | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index f9f5f800a04..24647fd0975 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -713,7 +713,7 @@ foreach ($profid as $key => $val) { $i++; } -if (!empty($conf->accounting->enabled)) { +if (isModEnabled('accounting')) { print ''; print ''.$langs->trans('CustomerAccountancyCodeShort')."\n"; print ''; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 7080ade778e..19d3a2be91e 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -50,13 +50,13 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; if (isModEnabled('adherent')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } -if (!empty($conf->accounting->enabled)) { +if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.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'; } if (isModEnabled('eventorganization')) { @@ -80,7 +80,7 @@ if (!empty($conf->incoterm->enabled)) { if (!empty($conf->notification->enabled)) { $langs->load("mails"); } -if (!empty($conf->accounting->enabled)) { +if (isModEnabled('accounting')) { $langs->load("products"); } @@ -961,7 +961,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formadmin = new FormAdmin($db); $formcompany = new FormCompany($db); -if (!empty($conf->accounting->enabled)) { +if (isModEnabled('accounting')) { $formaccounting = new FormAccounting($db); } @@ -1834,7 +1834,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { print ''; - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { // Accountancy_code_sell print ''; print '
'.$langs->trans("ProductAccountancySellCode").''; @@ -2562,7 +2562,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'; print ''; - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { // Accountancy_code_sell print ''; print '
'.$langs->trans("ProductAccountancySellCode").''; @@ -2984,7 +2984,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'; print $langs->trans("ProductAccountancySellCode"); print ''; - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { if (!empty($object->accountancy_code_sell)) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch('', $object->accountancy_code_sell, 1); @@ -3000,7 +3000,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'; print $langs->trans("ProductAccountancyBuyCode"); print ''; - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { if (!empty($object->accountancy_code_buy)) { $accountingaccount2 = new AccountingAccount($db); $accountingaccount2->fetch('', $object->accountancy_code_buy, 1); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 58a8d973fe6..54decc3f8ea 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2711,10 +2711,10 @@ class Societe extends CommonObject if (!empty($this->code_fournisseur) && $this->fournisseur) { $label2 .= '
'.$langs->trans('SupplierCode').': '.$this->code_fournisseur; } - if (!empty($conf->accounting->enabled) && ($this->client == 1 || $this->client == 3)) { + if (isModEnabled('accounting') && ($this->client == 1 || $this->client == 3)) { $label2 .= '
'.$langs->trans('CustomerAccountancyCode').': '.($this->code_compta ? $this->code_compta : $this->code_compta_client); } - if (!empty($conf->accounting->enabled) && $this->fournisseur) { + if (isModEnabled('accounting') && $this->fournisseur) { $label2 .= '
'.$langs->trans('SupplierAccountancyCode').': '.$this->code_compta_fournisseur; } $label .= ($label2 ? '
'.$label2 : '').''; diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index eb30537438c..747644edbf5 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -if (!empty($conf->accounting->enabled)) { +if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; } diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php index a33c183a1e7..5d456856f79 100644 --- a/htdocs/stripe/payout.php +++ b/htdocs/stripe/payout.php @@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -if (!empty($conf->accounting->enabled)) { +if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; }