diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index f8beacdbb2e..c6ee771472f 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -540,7 +540,7 @@ if (empty($reshook)) { } // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $object->multicurrency_code = GETPOST('multicurrency_code', 'alpha'); } @@ -1174,7 +1174,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->forme_juridique_code = GETPOST('forme_juridique_code'); // We set multicurrency_code if enabled - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $object->multicurrency_code = GETPOST('multicurrency_code') ? GETPOST('multicurrency_code') : $conf->currency; } /* Show create form */ @@ -1740,7 +1740,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Capital print '
| '.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).' | '; print ''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).' | '; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 24b45c992eb..276178fa2d8 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -518,7 +518,7 @@ class SupplierProposal extends CommonObject $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. } - if (!empty($conf->multicurrency->enabled) && $pu_ht_devise > 0) { + if (isModEnabled("multicurrency") && $pu_ht_devise > 0) { $pu = 0; } @@ -720,7 +720,7 @@ class SupplierProposal extends CommonObject $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. } - if (!empty($conf->multicurrency->enabled) && $pu_ht_devise > 0) { + if (isModEnabled("multicurrency") && $pu_ht_devise > 0) { $pu = 0; } @@ -1779,7 +1779,7 @@ class SupplierProposal extends CommonObject if (empty($ref_fourn)) { $ref_fourn = $product->ref_supplier; } - if (!empty($conf->multicurrency->enabled) && !empty($product->multicurrency_code)) { + if (isModEnabled("multicurrency") && !empty($product->multicurrency_code)) { list($fk_multicurrency, $multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $product->multicurrency_code); } $productsupplier->id = $product->fk_product; @@ -1842,7 +1842,7 @@ class SupplierProposal extends CommonObject $product->tva_tx, $user->id ); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { if (!empty($product->multicurrency_code)) { include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; $multicurrency = new MultiCurrency($this->db); //need to fetch because empty fk_multicurrency and rate @@ -1863,7 +1863,7 @@ class SupplierProposal extends CommonObject $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_fournisseur_price '; $sql .= '(datec, fk_product, fk_soc, ref_fourn, price, quantity, unitprice, tva_tx, fk_user'; - if (!empty($conf->multicurrency->enabled) && !empty($product->multicurrency_code)) { + if (isModEnabled("multicurrency") && !empty($product->multicurrency_code)) { $sql .= ',fk_multicurrency, multicurrency_code, multicurrency_unitprice, multicurrency_price, multicurrency_tx'; } $sql .= ') VALUES ('.implode(',', $values).')'; diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 6a8ad41dbd2..3b04695da20 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -180,11 +180,11 @@ $arrayfields = array( 'sp.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1), 'sp.total_tva'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0), 'sp.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0), - 'sp.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'sp.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'sp.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'sp.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'sp.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), + 'sp.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'sp.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'sp.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'sp.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'sp.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), 'u.login'=>array('label'=>$langs->trans("Author"), 'checked'=>1, 'position'=>10), 'sp.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'sp.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 1e82580fac9..30d541f33af 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -74,7 +74,7 @@ class Target extends CommonObject * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" * 'label' the translation key. * 'picto' is code of a picto to show before value in forms - * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or '!empty($conf->multicurrency->enabled)' ...) + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or 'isModEnabled("multicurrency")' ...) * 'position' is the sort order of field. * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)