diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index b135daa8f00..3bb6435be0d 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -52,7 +52,7 @@ $amount = price2num(GETPOST("amount", "alpha")); $paymenttype = GETPOST("paymenttype", "aZ09"); $accountancy_code = GETPOST("accountancy_code", "alpha"); $projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int')); -if (!empty($conf->accounting->enabled) && !empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { +if (isModEnabled('accounting') && !empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { $subledger_account = GETPOST("subledger_account", "alpha") > 0 ? GETPOST("subledger_account", "alpha") : ''; } else { $subledger_account = GETPOST("subledger_account", "alpha"); @@ -139,7 +139,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); $error++; } - if (!empty($conf->banque->enabled) && !$object->accountid > 0) { + if (isModEnabled('banque') && !$object->accountid > 0) { $langs->load('errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors'); $error++; @@ -149,7 +149,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentMode")), null, 'errors'); $error++; } - if (!empty($conf->accounting->enabled) && !$object->accountancy_code) { + if (isModEnabled('accounting') && !$object->accountancy_code) { $langs->load('errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AccountAccounting")), null, 'errors'); $error++; @@ -308,10 +308,10 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->banque->m llxHeader("", $langs->trans("VariousPayment")); $form = new Form($db); -if (!empty($conf->accounting->enabled)) { +if (isModEnabled('accounting')) { $formaccounting = new FormAccounting($db); } -if (!empty($conf->project->enabled)) { +if (isModEnabled('project')) { $formproject = new FormProjets($db); } @@ -409,7 +409,7 @@ if ($action == 'create') { print ''; // Bank - if (!empty($conf->banque->enabled)) { + if (isModEnabled('banque')) { print ''; print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); @@ -424,7 +424,7 @@ if ($action == 'create') { print ''; // Number - if (!empty($conf->banque->enabled)) { + if (isModEnabled('banque')) { print ''; @@ -444,7 +444,7 @@ if ($action == 'create') { } // Accountancy account - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { // TODO Remove the fieldrequired and allow instead to edit a various payment to enter accounting code print ''.$langs->trans("AccountAccounting").''; print ''; @@ -457,7 +457,7 @@ if ($action == 'create') { } // Subledger account - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { print ''.$langs->trans("SubledgerAccount").''; print ''; if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { @@ -481,7 +481,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $formproject = new FormProjets($db); // Associated project @@ -553,7 +553,7 @@ if ($id) { $morehtmlref = '
'; // Project - if (!empty($conf->project->enabled)) { + if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->banque->modifier) { @@ -621,7 +621,7 @@ if ($id) { print ''; print $langs->trans("AccountAccounting"); print ''; - if (!empty($conf->accounting->enabled)) { + if (isModEnabled('accounting')) { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch('', $object->accountancy_code, 1); @@ -638,7 +638,7 @@ if ($id) { print $form->editfieldval('SubledgerAccount', 'subledger_account', $object->subledger_account, $object, (!$alreadyaccounted && $user->rights->banque->modifier), 'string', '', 0); print ''; - if (!empty($conf->banque->enabled)) { + if (isModEnabled('banque')) { if ($object->fk_account > 0) { $bankline = new AccountLine($db); $bankline->fetch($object->fk_bank);