diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 1eebb5300d2..d8db9191c32 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -51,7 +51,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (!empty($conf->commande->enabled)) { +if (isModEnabled('commande')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if (isModEnabled('project')) { @@ -60,7 +60,7 @@ if (isModEnabled('project')) { } require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -if (!empty($conf->variants->enabled)) { +if (isModEnabled('variants')) { require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; } if (isModEnabled('accounting')) { @@ -69,10 +69,10 @@ if (isModEnabled('accounting')) { // Load translation files required by the page $langs->loadLangs(array('bills', 'companies', 'compta', 'products', 'banks', 'main', 'withdrawals')); -if (!empty($conf->incoterm->enabled)) { +if (isModEnabled('incoterm')) { $langs->load('incoterm'); } -if (!empty($conf->margin->enabled)) { +if (isModEnabled('margin')) { $langs->load('margins'); } @@ -540,7 +540,7 @@ if (empty($reshook)) { } } } - } elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled)) { // Set incoterm + } elseif ($action == 'set_incoterms' && isModEnabled('incoterm')) { // Set incoterm $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha')); } elseif ($action == 'setbankaccount' && $usercancreate) { // bank account $result = $object->setBankAccount(GETPOST('fk_account', 'int')); @@ -2076,7 +2076,7 @@ if (empty($reshook)) { $error++; } - if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') { + if (!$error && isModEnabled('variants') && $prod_entry_mode != 'free') { if ($combinations = GETPOST('combinations', 'array')) { //Check if there is a product with the given combination $prodcomb = new ProductCombination($db); @@ -2994,7 +2994,7 @@ if ($action == 'create') { $remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0)); $remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicurrency')) { if (!empty($objectsrc->multicurrency_code)) { $currency_code = $objectsrc->multicurrency_code; } @@ -3016,7 +3016,7 @@ if ($action == 'create') { $remise_absolue = 0; $dateinvoice = (empty($dateinvoice) ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $dateinvoice); // Do not set 0 here (0 for a date is 1970) - if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) { + if (isModEnabled('multicurrency') && !empty($soc->multicurrency_code)) { $currency_code = $soc->multicurrency_code; } } @@ -3667,7 +3667,7 @@ if ($action == 'create') { } // Incoterms - if (!empty($conf->incoterm->enabled)) { + if (isModEnabled('incoterm')) { print '
| '; print $langs->trans('IncotermLabel'); @@ -4708,7 +4708,7 @@ if ($action == 'create') { $sign = -1; // We invert sign for output } - if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { + if (isModEnabled('multicurrency') && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print ' | |||||||||
| '.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).' | '; print ''.price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).' | '; @@ -4819,10 +4819,10 @@ if ($action == 'create') { if ($selleruserevenustamp) { $nbrows++; } - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicurrency')) { $nbrows += 5; } - if (!empty($conf->incoterm->enabled)) { + if (isModEnabled('incoterm')) { $nbrows += 1; } @@ -4917,7 +4917,7 @@ if ($action == 'create') { print '' . $langs->trans('ListOfNextSituationInvoices') . ' | '; print ''; print ' | '; - if (! empty($conf->banque->enabled)) print ' | '; + if (isModEnabled('banque')) print ' | '; print ' | ' . $langs->trans('AmountHT') . ' | '; print '' . $langs->trans('AmountTTC') . ' | '; print ''; @@ -5259,7 +5259,7 @@ if ($action == 'create') { print ''; // Margin Infos - if (!empty($conf->margin->enabled)) { + if (isModEnabled('margin')) { $formmargin->displayMarginInfos($object); } @@ -5477,7 +5477,7 @@ if ($action == 'create') { } // POS Ticket - if (!empty($conf->takepos->enabled) && $object->module_source == 'takepos') { + if (isModEnabled('takepos') && $object->module_source == 'takepos') { $langs->load("cashdesk"); $receipt_url = DOL_URL_ROOT."/takepos/receipt.php"; print ''.$langs->trans('POSTicket').''; |