diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index a9f5418f135..53ba07ba441 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -448,7 +448,7 @@ if (empty($reshook)) {
$object->origin_id = GETPOST('originid');
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
}
@@ -1653,7 +1653,7 @@ if ($action == 'create') {
$objectsrc->fetch_optionals();
$object->array_options = $objectsrc->array_options;
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
if (!empty($objectsrc->multicurrency_code)) {
$currency_code = $objectsrc->multicurrency_code;
}
@@ -1663,7 +1663,7 @@ if ($action == 'create') {
}
}
} else {
- if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) {
+ if (isModEnabled("multicurrency") && !empty($soc->multicurrency_code)) {
$currency_code = $soc->multicurrency_code;
}
}
@@ -1865,7 +1865,7 @@ if ($action == 'create') {
print "";
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print '
';
print '';
@@ -2649,7 +2649,7 @@ if ($action == 'create') {
print '';
- if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
+ if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
// Multicurrency Amount HT
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/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 7997c948ea8..4c4a0a6c19a 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -335,11 +335,11 @@ class Propal extends CommonObject
'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>220),
'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLabel', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>225),
'fk_multicurrency' =>array('type'=>'integer', 'label'=>'MulticurrencyID', 'enabled'=>1, 'visible'=>-1, 'position'=>230),
- 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'MulticurrencyCurrency', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>235),
- 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyRate', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>240, 'isameasure'=>1),
- 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>245, 'isameasure'=>1),
- 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>250, 'isameasure'=>1),
- 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>255, 'isameasure'=>1),
+ 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'MulticurrencyCurrency', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>235),
+ 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyRate', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>240, 'isameasure'=>1),
+ 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>245, 'isameasure'=>1),
+ 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>250, 'isameasure'=>1),
+ 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>255, 'isameasure'=>1),
'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>260),
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index d2bcf6186e2..cf6237cd012 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -6,7 +6,7 @@
* Copyright (C) 2005-2013 Regis Houssin
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2010-2011 Juanjo Menent
- * Copyright (C) 2010-2011 Philippe Grand
+ * Copyright (C) 2010-2022 Philippe Grand
* Copyright (C) 2012 Christophe Battarel
* Copyright (C) 2013 Cédric Salvador
* Copyright (C) 2015 Jean-François Ferry
@@ -227,13 +227,13 @@ $arrayfields = array(
'p.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
'p.total_ht_invoiced'=>array('label'=>"AmountInvoicedHT", 'checked'=>0, 'enabled'=>!empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
'p.total_invoiced'=>array('label'=>"AmountInvoicedTTC", 'checked'=>0, 'enabled'=>!empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
- 'p.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
- 'p.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
- 'p.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
- 'p.multicurrency_total_tva'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
- 'p.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
- 'p.multicurrency_total_ht_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedHT', 'checked'=>0, 'enabled'=>!empty($conf->multicurrency->enabled) && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
- 'p.multicurrency_total_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedTTC', 'checked'=>0, 'enabled'=>!empty($conf->multicurrency->enabled) && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
+ 'p.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
+ 'p.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
+ 'p.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
+ 'p.multicurrency_total_tva'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
+ 'p.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
+ 'p.multicurrency_total_ht_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedHT', 'checked'=>0, 'enabled'=>isModEnabled("multicurrency") && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
+ 'p.multicurrency_total_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedTTC', 'checked'=>0, 'enabled'=>isModEnabled("multicurrency") && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10),
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>-1),
'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)),
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 27fddbb7dba..d6a4aead2ec 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -13,7 +13,7 @@
* Copyright (C) 2014 Ferran Marcet
* Copyright (C) 2015 Jean-François Ferry
* Copyright (C) 2018-2021 Frédéric France
- * Copyright (C) 2022 Gauthier VERDOL
+ * Copyright (C) 2022 Gauthier VERDOL
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1664,7 +1664,7 @@ if ($action == 'create' && $usercancreate) {
$date_delivery = (!empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : '');
}
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
if (!empty($objectsrc->multicurrency_code)) {
$currency_code = $objectsrc->multicurrency_code;
}
@@ -1692,7 +1692,7 @@ if ($action == 'create' && $usercancreate) {
$remise_absolue = 0;
$dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER) ?-1 : '';
- if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) {
+ if (isModEnabled("multicurrency") && !empty($soc->multicurrency_code)) {
$currency_code = $soc->multicurrency_code;
}
@@ -1913,7 +1913,7 @@ if ($action == 'create' && $usercancreate) {
print " ";
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print '';
print ''.$form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0).' ';
print '';
@@ -1992,7 +1992,7 @@ if ($action == 'create' && $usercancreate) {
print ' '.$langs->trans('AmountTTC').' '.price($objectsrc->total_ttc)." ";
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print ''.$langs->trans('MulticurrencyAmountHT').' '.price($objectsrc->multicurrency_total_ht).' ';
print ''.$langs->trans('MulticurrencyAmountVAT').' '.price($objectsrc->multicurrency_total_tva)." ";
print ''.$langs->trans('MulticurrencyAmountTTC').' '.price($objectsrc->multicurrency_total_ttc)." ";
@@ -2535,7 +2535,7 @@ if ($action == 'create' && $usercancreate) {
print '';
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
// Multicurrency code
print '';
print '';
@@ -2646,7 +2646,7 @@ if ($action == 'create' && $usercancreate) {
print '';
- 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($object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).' ';
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 690fcb56bfb..436a0a51114 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -348,12 +348,12 @@ class Commande extends CommonOrder
'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>225),
'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>230),
'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLabel', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>235),
- 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>240),
- 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'MulticurrencyCurrency', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>245),
- 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyRate', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>250, 'isameasure'=>1),
- 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>255, 'isameasure'=>1),
- 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>260, 'isameasure'=>1),
- 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>265, 'isameasure'=>1),
+ 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>240),
+ 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'MulticurrencyCurrency', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>245),
+ 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyRate', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>250, 'isameasure'=>1),
+ 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>255, 'isameasure'=>1),
+ 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>260, 'isameasure'=>1),
+ 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>265, 'isameasure'=>1),
'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>270),
'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>275),
'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>280),
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index e194bda8e3a..6984255b91c 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -192,11 +192,11 @@ $arrayfields = array(
'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>75),
'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>80),
'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>85),
- 'c.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>90),
- 'c.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>95),
- 'c.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>100),
- 'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>105),
- 'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>110),
+ 'c.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>90),
+ 'c.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>95),
+ 'c.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>100),
+ 'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>105),
+ 'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>110),
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>115),
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>116),
'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)),
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 594ee548da7..c6281e77e67 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -348,12 +348,12 @@ class Facture extends CommonInvoice
'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>260),
'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLabel', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>265),
'date_pointoftax' =>array('type'=>'date', 'label'=>'DatePointOfTax', 'enabled'=>'$conf->global->INVOICE_POINTOFTAX_DATE', 'visible'=>-1, 'position'=>270),
- 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'MulticurrencyID', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>275),
- 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Currency', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>280),
- 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'CurrencyRate', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>285, 'isameasure'=>1),
- 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>290, 'isameasure'=>1),
- 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>291, 'isameasure'=>1),
- 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'$conf->multicurrency->enabled', 'visible'=>-1, 'position'=>292, 'isameasure'=>1),
+ 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'MulticurrencyID', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>275),
+ 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Currency', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>280),
+ 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'CurrencyRate', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>285, 'isameasure'=>1),
+ 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>290, 'isameasure'=>1),
+ 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>291, 'isameasure'=>1),
+ 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>292, 'isameasure'=>1),
'fk_fac_rec_source' =>array('type'=>'integer', 'label'=>'RecurringInvoiceSource', 'enabled'=>1, 'visible'=>-1, 'position'=>305),
'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>310),
'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>315),
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 9eafcb6ead0..9cbe8b5c686 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -1514,7 +1514,7 @@ if ($action == 'create') {
print ''.$langs->trans("ServiceNb", $cursorline).' ';
print ''.$langs->trans("VAT").' ';
print ''.$langs->trans("PriceUHT").' ';
- //if (!empty($conf->multicurrency->enabled)) {
+ //if (isModEnabled("multicurrency")) {
// print ''.$langs->trans("PriceUHTCurrency").' ';
//}
print ''.$langs->trans("Qty").' ';
@@ -1575,7 +1575,7 @@ if ($action == 'create') {
// Price
print ''.($objp->subprice != '' ? price($objp->subprice) : '')." \n";
// Price multicurrency
- /*if (!empty($conf->multicurrency->enabled)) {
+ /*if (isModEnabled("multicurrency")) {
print ''.price($objp->multicurrency_subprice).' ';
}*/
// Quantity
@@ -1718,7 +1718,7 @@ if ($action == 'create') {
print ' ';
// Price multicurrency
- /*if (!empty($conf->multicurrency->enabled)) {
+ /*if (isModEnabled("multicurrency")) {
print ''.price($objp->multicurrency_subprice).' ';
}*/
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 4aeed158dc5..8be014b8959 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -3,7 +3,7 @@
* Copyright (C) 2005-2013 Regis Houssin
* Copyright (C) 2010-2020 Juanjo Menent
* Copyright (C) 2012-2013 Christophe Battarel
- * Copyright (C) 2011-2019 Philippe Grand
+ * Copyright (C) 2011-2022 Philippe Grand
* Copyright (C) 2012-2015 Marcos García
* Copyright (C) 2012-2015 Raphaël Doursenaud
* Copyright (C) 2012 Cedric Salvador
@@ -5086,7 +5086,7 @@ abstract class CommonObject
print ''.$langs->trans('Description').' ';
print ''.$langs->trans('VATRate').' ';
print ''.$langs->trans('PriceUHT').' ';
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print ''.$langs->trans('PriceUHTCurrency').' ';
}
print ''.$langs->trans('Qty').' ';
diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php
index 49dccc2d0fa..b76ad8c7a47 100644
--- a/htdocs/core/class/dolreceiptprinter.class.php
+++ b/htdocs/core/class/dolreceiptprinter.class.php
@@ -830,7 +830,7 @@ class dolReceiptPrinter extends Printer
$row = $this->db->fetch_object($resql);
$spacestoadd = $nbcharactbyline - strlen($langs->transnoentitiesnoconv("PaymentTypeShort".$row->code)) - 12;
$spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0);
- $amount_payment = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
+ $amount_payment = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount;
if ($row->code == "LIQ") {
$amount_payment = $amount_payment + $row->pos_change; // Show amount with excess received if is cash payment
}
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index 4efea43b044..3b0c2250c49 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -1868,7 +1868,7 @@ function pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails = 0)
}
if (empty($reshook)) {
if (empty($hidedetails) || $hidedetails > 1) {
- $subprice = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_subprice : $object->lines[$i]->subprice);
+ $subprice = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_subprice : $object->lines[$i]->subprice);
$result .= price($sign * $subprice, 0, $outputlangs);
}
}
@@ -2253,7 +2253,7 @@ function pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails = 0)
if ($object->lines[$i]->special_code == 3) {
$result .= $outputlangs->transnoentities("Option");
} elseif (empty($hidedetails) || $hidedetails > 1) {
- $total_ht = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ht : $object->lines[$i]->total_ht);
+ $total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ht : $object->lines[$i]->total_ht);
if (!empty($object->lines[$i]->situation_percent) && $object->lines[$i]->situation_percent > 0) {
// TODO Remove this. The total should be saved correctly in database instead of being modified here.
$prev_progress = 0;
@@ -2309,7 +2309,7 @@ function pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails = 0)
if ($object->lines[$i]->special_code == 3) {
$result .= $outputlangs->transnoentities("Option");
} elseif (empty($hidedetails) || $hidedetails > 1) {
- $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ttc : $object->lines[$i]->total_ttc);
+ $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ttc : $object->lines[$i]->total_ttc);
if ($object->lines[$i]->situation_percent > 0) {
// TODO Remove this. The total should be saved correctly in database instead of being modified here.
$prev_progress = 0;
diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php
index de378ee79a8..e313c612eb0 100644
--- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php
+++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php
@@ -669,13 +669,13 @@ class pdf_standard_asset extends ModelePDFAsset
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
if ($prev_progress > 0 && !empty($object->lines[$i]->situation_percent)) { // Compute progress from previous situation
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
$tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent;
} else {
$tvaligne = $sign * $object->lines[$i]->total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent;
}
} else {
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
$tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva;
} else {
$tvaligne = $sign * $object->lines[$i]->total_tva;
diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
index d34c66c0def..b1476b393d0 100644
--- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
@@ -529,7 +529,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
// Collection of totals by value of vat in $this->vat["rate"] = total_tva
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
$tvaligne = $object->lines[$i]->multicurrency_total_tva;
} else {
$tvaligne = $object->lines[$i]->total_tva;
@@ -938,14 +938,14 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1);
- $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+ $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1);
// Show VAT by rates and total
$pdf->SetFillColor(248, 248, 248);
- $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
+ $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$this->atleastoneratenotnull = 0;
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
index 28003fff639..34cdb41e6b8 100644
--- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php
@@ -754,7 +754,7 @@ class pdf_eratosthene extends ModelePDFCommandes
// Collection of totals by value of vat in $this->tva["rate"] = total_tva
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
$tvaligne = $object->lines[$i]->multicurrency_total_tva;
} else {
$tvaligne = $object->lines[$i]->total_tva;
@@ -1152,14 +1152,14 @@ class pdf_eratosthene extends ModelePDFCommandes
$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1);
- $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+ $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1);
// Show VAT by rates and total
$pdf->SetFillColor(248, 248, 248);
- $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
+ $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$this->atleastoneratenotnull = 0;
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index 3b82e92f1ab..2a94a94103e 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -298,9 +298,9 @@ class pdf_crabe extends ModelePDFFactures
if ($conf->facture->dir_output) {
$object->fetch_thirdparty();
- $deja_regle = $object->getSommePaiement((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0);
- $amount_credit_notes_included = $object->getSumCreditNotesUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0);
- $amount_deposits_included = $object->getSumDepositsUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0);
+ $deja_regle = $object->getSommePaiement((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
+ $amount_credit_notes_included = $object->getSumCreditNotesUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
+ $amount_deposits_included = $object->getSumDepositsUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
// Definition of $dir and $file
if ($object->specimen) {
@@ -707,13 +707,13 @@ class pdf_crabe extends ModelePDFFactures
// Collection of totals by value of VAT in $this->tva["taux"]=total_tva
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
if ($prev_progress > 0 && !empty($object->lines[$i]->situation_percent)) { // Compute progress from previous situation
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
$tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent;
} else {
$tvaligne = $sign * $object->lines[$i]->total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent;
}
} else {
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
$tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva;
} else {
$tvaligne = $sign * $object->lines[$i]->total_tva;
@@ -966,7 +966,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($tab3_posx, $tab3_top + $y);
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($obj->datef), 'day', false, $outputlangs, true), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 21, $tab3_top + $y);
- $pdf->MultiCell(20, 3, price((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', 0);
+ $pdf->MultiCell(20, 3, price((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 40, $tab3_top + $y);
$pdf->MultiCell(20, 3, $text, 0, 'L', 0);
$pdf->SetXY($tab3_posx + 58, $tab3_top + $y);
@@ -1016,7 +1016,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($tab3_posx, $tab3_top + $y);
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 21, $tab3_top + $y);
- $pdf->MultiCell(20, 3, price($sign * ((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', 0);
+ $pdf->MultiCell(20, 3, price($sign * ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 40, $tab3_top + $y);
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$row->code);
@@ -1323,14 +1323,14 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total") : ''), 0, 'L', 1);
- $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+ $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0, 'R', 1);
// Show VAT by rates and total
$pdf->SetFillColor(248, 248, 248);
- $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
+ $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$this->atleastoneratenotnull = 0;
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
@@ -1545,8 +1545,8 @@ class pdf_crabe extends ModelePDFFactures
}
$pdf->SetTextColor(0, 0, 0);
- $creditnoteamount = $object->getSumCreditNotesUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received
- $depositsamount = $object->getSumDepositsUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0);
+ $creditnoteamount = $object->getSumCreditNotesUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received
+ $depositsamount = $object->getSumDepositsUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
//print "x".$creditnoteamount."-".$depositsamount;exit;
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
if (!empty($object->paye)) {
diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
index a537e35223f..cb1c2fb64e0 100644
--- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php
@@ -331,9 +331,9 @@ class pdf_sponge extends ModelePDFFactures
if ($conf->facture->multidir_output[$conf->entity]) {
$object->fetch_thirdparty();
- $deja_regle = $object->getSommePaiement((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0);
- $amount_credit_notes_included = $object->getSumCreditNotesUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0);
- $amount_deposits_included = $object->getSumDepositsUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0);
+ $deja_regle = $object->getSommePaiement((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
+ $amount_credit_notes_included = $object->getSumCreditNotesUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
+ $amount_deposits_included = $object->getSumDepositsUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
// Definition of $dir and $file
if ($object->specimen) {
@@ -871,13 +871,13 @@ class pdf_sponge extends ModelePDFFactures
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
if ($prev_progress > 0 && !empty($object->lines[$i]->situation_percent)) { // Compute progress from previous situation
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
$tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent;
} else {
$tvaligne = $sign * $object->lines[$i]->total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent;
}
} else {
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
$tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva;
} else {
$tvaligne = $sign * $object->lines[$i]->total_tva;
@@ -1128,7 +1128,7 @@ class pdf_sponge extends ModelePDFFactures
$pdf->SetXY($tab3_posx, $tab3_top + $y);
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($obj->datef), 'day', false, $outputlangs, true), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 21, $tab3_top + $y);
- $pdf->MultiCell(20, 3, price((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', 0);
+ $pdf->MultiCell(20, 3, price((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 40, $tab3_top + $y);
$pdf->MultiCell(20, 3, $text, 0, 'L', 0);
$pdf->SetXY($tab3_posx + 58, $tab3_top + $y);
@@ -1164,7 +1164,7 @@ class pdf_sponge extends ModelePDFFactures
$pdf->SetXY($tab3_posx, $tab3_top + $y);
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 21, $tab3_top + $y);
- $pdf->MultiCell(20, 3, price($sign * ((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', 0);
+ $pdf->MultiCell(20, 3, price($sign * ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 40, $tab3_top + $y);
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$row->code);
@@ -1557,7 +1557,7 @@ class pdf_sponge extends ModelePDFFactures
// Get Total HT
- $total_ht = (!empty($conf->multicurrency->enabled) && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
+ $total_ht = (isModEnabled("multicurrency") && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
// Total remise
$total_line_remise = 0;
@@ -1595,14 +1595,14 @@ class pdf_sponge extends ModelePDFFactures
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) ? "TotalHT" : "Total") : ''), 0, 'L', 1);
- $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+ $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0, 'R', 1);
// Show VAT by rates and total
$pdf->SetFillColor(248, 248, 248);
- $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
+ $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$this->atleastoneratenotnull = 0;
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
@@ -1847,8 +1847,8 @@ class pdf_sponge extends ModelePDFFactures
$pdf->SetTextColor(0, 0, 0);
- $creditnoteamount = $object->getSumCreditNotesUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received
- $depositsamount = $object->getSumDepositsUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0);
+ $creditnoteamount = $object->getSumCreditNotesUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received
+ $depositsamount = $object->getSumDepositsUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
if (!empty($object->paye)) {
diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php
index 4f2b58ff00d..6a88c14271b 100644
--- a/htdocs/core/modules/modCommande.class.php
+++ b/htdocs/core/modules/modCommande.class.php
@@ -211,7 +211,7 @@ class modCommande extends DolibarrModules
'cd.tva_tx'=>"LineVATRate", 'cd.qty'=>"LineQty", 'cd.total_ht'=>"LineTotalHT", 'cd.total_tva'=>"LineTotalVAT", 'cd.total_ttc'=>"LineTotalTTC",
'p.rowid'=>'ProductId', 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel'
);
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->export_fields_array[$r]['c.multicurrency_code'] = 'Currency';
$this->export_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate';
$this->export_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
@@ -328,7 +328,7 @@ class modCommande extends DolibarrModules
'c.fk_statut' => 'Status*'
);
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->import_fields_array[$r]['c.multicurrency_code'] = 'Currency';
$this->import_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate';
$this->import_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
@@ -405,7 +405,7 @@ class modCommande extends DolibarrModules
'cd.rang' => 'LinePosition'
);
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->import_fields_array[$r]['cd.multicurrency_code'] = 'Currency';
$this->import_fields_array[$r]['cd.multicurrency_subprice'] = 'CurrencyRate';
$this->import_fields_array[$r]['cd.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php
index a819dae666c..f7d902d22f1 100644
--- a/htdocs/core/modules/modFacture.class.php
+++ b/htdocs/core/modules/modFacture.class.php
@@ -267,7 +267,7 @@ class modFacture extends DolibarrModules
'f.note_private' => 'NotePrivate',
'f.model_pdf' => 'Model'
);
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->import_fields_array[$r]['f.multicurrency_code'] = 'Currency';
$this->import_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
$this->import_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
@@ -399,7 +399,7 @@ class modFacture extends DolibarrModules
// fk_user_modif
// ref_ext
);
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->import_fields_array[$r]['fd.multicurrency_code'] = 'Currency';
$this->import_fields_array[$r]['fd.multicurrency_subprice'] = 'CurrencyRate';
$this->import_fields_array[$r]['fd.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
@@ -518,7 +518,7 @@ class modFacture extends DolibarrModules
'f.note_private'=>"NotePrivate", 'f.note_public'=>"NotePublic"
);
// Add multicurrency fields
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency';
$this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
$this->export_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
@@ -647,7 +647,7 @@ class modFacture extends DolibarrModules
'pt.code'=>'CodePaymentMode', 'pt.libelle'=>'LabelPaymentMode', 'p.note'=>'PaymentNote', 'p.fk_bank'=>'IdTransaction', 'ba.ref'=>'AccountRef'
);
$this->export_help_array[$r] = array('f.paye'=>'InvoicePaidCompletelyHelp');
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency';
$this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
$this->export_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php
index afc6fec4fc6..e05d7964094 100644
--- a/htdocs/core/modules/modFournisseur.class.php
+++ b/htdocs/core/modules/modFournisseur.class.php
@@ -317,7 +317,7 @@ class modFournisseur extends DolibarrModules
'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', 'p.accountancy_code_buy'=>'ProductAccountancyBuyCode', 'project.rowid'=>'ProjectId',
'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel'
);
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency';
$this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
$this->export_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
@@ -391,7 +391,7 @@ class modFournisseur extends DolibarrModules
'f.fk_statut'=>'InvoiceStatus', 'f.note_public'=>"InvoiceNote", 'p.rowid'=>'PaymentId', 'pf.amount'=>'AmountPayment',
'p.datep'=>'DatePayment', 'p.num_paiement'=>'PaymentNumber', 'p.fk_bank'=>'IdTransaction', 'project.rowid'=>'ProjectId', 'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel'
);
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency';
$this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
$this->export_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
@@ -458,7 +458,7 @@ class modFournisseur extends DolibarrModules
'fd.product_type'=>'TypeOfLineServiceOrProduct', 'fd.ref'=>'RefSupplier', 'fd.fk_product'=>'ProductId',
'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', 'project.rowid'=>'ProjectId', 'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel'
);
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->export_fields_array[$r]['f.multicurrency_code'] = 'Currency';
$this->export_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
$this->export_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
@@ -557,7 +557,7 @@ class modFournisseur extends DolibarrModules
'f.model_pdf' => 'Model',
'f.date_valid' => 'Validation Date'
);
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->import_fields_array[$r]['f.multicurrency_code'] = 'Currency';
$this->import_fields_array[$r]['f.multicurrency_tx'] = 'CurrencyRate';
$this->import_fields_array[$r]['f.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
@@ -649,7 +649,7 @@ class modFournisseur extends DolibarrModules
'fd.date_end' => 'End Date',
'fd.fk_unit' => 'Unit'
);
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->import_fields_array[$r]['fd.multicurrency_code'] = 'Currency';
$this->import_fields_array[$r]['fd.multicurrency_subprice'] = 'CurrencyRate';
$this->import_fields_array[$r]['fd.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
@@ -735,7 +735,7 @@ class modFournisseur extends DolibarrModules
'c.model_pdf' => 'Model'
);
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->import_fields_array[$r]['c.multicurrency_code'] = 'Currency';
$this->import_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate';
$this->import_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
@@ -817,7 +817,7 @@ class modFournisseur extends DolibarrModules
'cd.fk_unit' => 'Unit'
);
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->import_fields_array[$r]['cd.multicurrency_code'] = 'Currency';
$this->import_fields_array[$r]['cd.multicurrency_subprice'] = 'CurrencyRate';
$this->import_fields_array[$r]['cd.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php
index f3c79de5ab8..604d96fd4cd 100644
--- a/htdocs/core/modules/modProduct.class.php
+++ b/htdocs/core/modules/modProduct.class.php
@@ -791,7 +791,7 @@ class modProduct extends DolibarrModules
'sp.remise_percent'=>'DiscountQtyMin'
));
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
'sp.fk_multicurrency'=>'CurrencyCodeId', //ideally this should be automatically obtained from the CurrencyCode on the next line
'sp.multicurrency_code'=>'CurrencyCode',
@@ -853,7 +853,7 @@ class modProduct extends DolibarrModules
// TODO Make this field not required and calculate it from price and qty
'sp.remise_percent' => '20'
));
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array(
'sp.fk_multicurrency'=>'eg: 2, rowid for code of multicurrency currency',
'sp.multicurrency_code'=>'GBP',
diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php
index 13991cdcafa..524aa0086ea 100644
--- a/htdocs/core/modules/modPropale.class.php
+++ b/htdocs/core/modules/modPropale.class.php
@@ -197,7 +197,7 @@ class modPropale extends DolibarrModules
'cd.tva_tx'=>"LineVATRate", 'cd.qty'=>"LineQty", 'cd.total_ht'=>"LineTotalHT", 'cd.total_tva'=>"LineTotalVAT", 'cd.total_ttc'=>"LineTotalTTC",
'p.rowid'=>'ProductId', 'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel'
);
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->export_fields_array[$r]['c.multicurrency_code'] = 'Currency';
$this->export_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate';
$this->export_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
@@ -300,7 +300,7 @@ class modPropale extends DolibarrModules
'c.date_livraison' => 'DeliveryDate',
'c.fk_user_valid' => 'ValidatedById'
);
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->import_fields_array[$r]['c.multicurrency_code'] = 'Currency';
$this->import_fields_array[$r]['c.multicurrency_tx'] = 'CurrencyRate';
$this->import_fields_array[$r]['c.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
@@ -388,7 +388,7 @@ class modPropale extends DolibarrModules
'cd.date_end' => 'End Date',
'cd.buy_price_ht' => 'LineBuyPriceHT'
);
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->import_fields_array[$r]['cd.multicurrency_code'] = 'Currency';
$this->import_fields_array[$r]['cd.multicurrency_subprice'] = 'CurrencyRate';
$this->import_fields_array[$r]['cd.multicurrency_total_ht'] = 'MulticurrencyAmountHT';
diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php
index 598c9131efb..d2431d3e22c 100644
--- a/htdocs/core/modules/modService.class.php
+++ b/htdocs/core/modules/modService.class.php
@@ -740,7 +740,7 @@ class modService extends DolibarrModules
'sp.remise_percent'=>'DiscountQtyMin'
));
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array(
'sp.fk_multicurrency'=>'CurrencyCodeId', //ideally this should be automatically obtained from the CurrencyCode on the next line
'sp.multicurrency_code'=>'CurrencyCode',
@@ -782,7 +782,7 @@ class modService extends DolibarrModules
// TODO Make this field not required and calculate it from price and qty
'sp.remise_percent' => '20'
));
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array(
'sp.fk_multicurrency'=>'eg: 2, rowid for code of multicurrency currency',
'sp.multicurrency_code'=>'GBP',
diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php
index ba41c94ab4f..ed10b5ee2bf 100644
--- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php
+++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php
@@ -819,7 +819,7 @@ class pdf_vinci extends ModelePDFMo
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
- $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+ $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, 'R', 1);
@@ -943,7 +943,7 @@ class pdf_vinci extends ModelePDFMo
$pdf->SetFillColor(224, 224, 224);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
- $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
+ $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1);
$pdf->SetFont('', '', $default_font_size - 1);
diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php
index 3f75a87fc73..e4bcc0e4f04 100644
--- a/htdocs/core/modules/product/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php
@@ -421,7 +421,7 @@ class pdf_standard extends ModelePDFProduct
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva;
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva;
else $tvaligne=$object->lines[$i]->total_tva;
$localtax1ligne=$object->lines[$i]->total_localtax1;
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index 3d209fce798..86d6306a576 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -640,7 +640,7 @@ class pdf_azur extends ModelePDFPropales
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
$tvaligne = $object->lines[$i]->multicurrency_total_tva;
} else {
$tvaligne = $object->lines[$i]->total_tva;
@@ -1113,14 +1113,14 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
- $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+ $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1);
// Show VAT by rates and total
$pdf->SetFillColor(248, 248, 248);
- $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
+ $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$this->atleastoneratenotnull = 0;
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
index 224e3979f38..ec04a8e8906 100644
--- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
@@ -764,7 +764,7 @@ class pdf_cyan extends ModelePDFPropales
// Collection of totals by value of vat in $this->tva["rate"] = total_tva
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
$tvaligne = $object->lines[$i]->multicurrency_total_tva;
} else {
$tvaligne = $object->lines[$i]->total_tva;
@@ -1238,14 +1238,14 @@ class pdf_cyan extends ModelePDFPropales
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1);
- $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+ $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1);
// Show VAT by rates and total
$pdf->SetFillColor(248, 248, 248);
- $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
+ $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$this->atleastoneratenotnull = 0;
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php
index 9a6ee3c5f01..fa49b0b6d44 100644
--- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php
+++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php
@@ -682,7 +682,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes
// Collection of totals by value of vat in $this->tva["rate"] = total_tva
- if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne = $object->lines[$i]->multicurrency_total_tva;
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) $tvaligne = $object->lines[$i]->multicurrency_total_tva;
else $tvaligne = $object->lines[$i]->total_tva;
$localtax1ligne = $object->lines[$i]->total_localtax1;
@@ -1035,7 +1035,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes
/*$pdf->SetFillColor(255, 255, 255);
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1);
- $total_ht = (($conf->multicurrency->enabled && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+ $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1);*/
diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
index 5cbdad90b03..39a9aab7e78 100644
--- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
+++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
@@ -232,9 +232,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$nblines = count($object->lines);
if ($conf->fournisseur->facture->dir_output) {
- $deja_regle = $object->getSommePaiement((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0);
- $amount_credit_notes_included = $object->getSumCreditNotesUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0);
- $amount_deposits_included = $object->getSumDepositsUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0);
+ $deja_regle = $object->getSommePaiement((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
+ $amount_credit_notes_included = $object->getSumCreditNotesUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
+ $amount_deposits_included = $object->getSumDepositsUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
// Definition of $dir and $file
if ($object->specimen) {
@@ -499,7 +499,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
// Collection of totals by VAT value in $this->tva["taux"]=total_tva
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
$tvaligne = $object->lines[$i]->multicurrency_total_tva;
} else {
$tvaligne = $object->lines[$i]->total_tva;
@@ -683,14 +683,14 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
- $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+ $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0, 'R', 1);
// Show VAT by rates and total
$pdf->SetFillColor(248, 248, 248);
- $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
+ $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$this->atleastoneratenotnull = 0;
foreach ($this->tva as $tvakey => $tvaval) {
@@ -802,8 +802,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1);
$pdf->SetTextColor(0, 0, 0);
- $creditnoteamount = $object->getSumCreditNotesUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received
- $depositsamount = $object->getSumDepositsUsed((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? 1 : 0);
+ $creditnoteamount = $object->getSumCreditNotesUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received
+ $depositsamount = $object->getSumDepositsUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
//print "x".$creditnoteamount."-".$depositsamount;exit;
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
if (!empty($object->paye)) {
@@ -1036,7 +1036,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->SetXY($tab3_posx, $tab3_top + $y);
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 21, $tab3_top + $y);
- $pdf->MultiCell(20, 3, price($sign * ((!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount)), 0, 'L', 0);
+ $pdf->MultiCell(20, 3, price($sign * ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount)), 0, 'L', 0);
$pdf->SetXY($tab3_posx + 40, $tab3_top + $y);
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$row->code);
diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
index a8f671fb528..00d1e2e28e7 100644
--- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
@@ -693,7 +693,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
$tvaligne = $object->lines[$i]->multicurrency_total_tva;
} else {
$tvaligne = $object->lines[$i]->total_tva;
@@ -975,7 +975,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
- $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+ $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, 'R', 1);
@@ -1099,7 +1099,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$pdf->SetFillColor(224, 224, 224);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
- $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
+ $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1);
$pdf->SetFont('', '', $default_font_size - 1);
diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
index 12b5b990648..410a631fa62 100644
--- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
@@ -573,7 +573,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
}
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
$tvaligne = $object->lines[$i]->multicurrency_total_tva;
} else {
$tvaligne = $object->lines[$i]->total_tva;
@@ -856,7 +856,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
- $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
+ $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, 'R', 1);
@@ -980,7 +980,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetFillColor(224, 224, 224);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
- $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
+ $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1);
$pdf->SetFont('', '', $default_font_size - 1);
diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
index f5825957845..28c8ed0a3bd 100644
--- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
@@ -573,7 +573,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
*/
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
$tvaligne = $object->lines[$i]->multicurrency_total_tva;
} else {
$tvaligne = $object->lines[$i]->total_tva;
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index 54e64ccc769..81a1692c6a3 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -65,7 +65,7 @@ if (empty($inputalsopricewithtax)) {
}
// Define colspan for the button 'Add'
$colspan = 3; // Columns: total ht + col edit + col delete
-if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
+if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
$colspan++; //Add column for Total (currency) if required
}
if (in_array($object->element, array('propal', 'commande', 'order', 'facture', 'facturerec', 'invoice', 'supplier_proposal', 'order_supplier', 'invoice_supplier', 'invoice_supplier_rec'))) {
@@ -119,7 +119,7 @@ if ($nolinesbefore) {
?>
trans('VAT'); ?>
trans('PriceUHT'); ?>
- multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?>
+ multicurrency_code != $conf->currency) { ?>
trans('PriceUHTCurrency'); ?>
@@ -399,7 +399,7 @@ if ($nolinesbefore) {
multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
+ if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
$coldisplay++;
?>
diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php
index b2974ffbbfc..d755c3996a8 100644
--- a/htdocs/core/tpl/objectline_edit.tpl.php
+++ b/htdocs/core/tpl/objectline_edit.tpl.php
@@ -70,7 +70,7 @@ if (!empty($inputalsopricewithtax)) {
if (in_array($object->element, array('propal', 'supplier_proposal', 'facture', 'facturerec', 'invoice', 'commande', 'order', 'order_supplier', 'invoice_supplier', 'invoice_supplier_rec'))) {
$colspan++; // With this, there is a column move button
}
-if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
+if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
$colspan += 2;
}
if (isModEnabled('asset') && $object->element == 'invoice_supplier') {
@@ -214,7 +214,7 @@ $coldisplay++;
}
print '> ';
- if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
+ if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
$coldisplay++;
print ' ';
}
diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php
index 79d4ebeae11..9646d8ce88f 100644
--- a/htdocs/core/tpl/objectline_title.tpl.php
+++ b/htdocs/core/tpl/objectline_title.tpl.php
@@ -88,7 +88,7 @@ print '';
print ''.$langs->trans('PriceUHT').' ';
// Multicurrency
-if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
+if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
print ''.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).' ';
}
@@ -152,7 +152,7 @@ if ($usemargins && !empty($conf->margin->enabled) && empty($user->socid)) {
print ''.$langs->trans('TotalHTShort').' ';
// Multicurrency
-if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
+if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
print ''.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).' ';
}
diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php
index b660bd89d93..fc1e74f1ac4 100644
--- a/htdocs/core/tpl/objectline_view.tpl.php
+++ b/htdocs/core/tpl/objectline_view.tpl.php
@@ -282,7 +282,7 @@ print vatrate($positiverates.($line->vat_src_code ? ' ('.$line->vat_src_code.')'
subprice); ?>
-multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?>
+multicurrency_code != $conf->currency) { ?>
multicurrency_subprice); ?>
special_code == 3) { ?>
print '';
}
print '';
- if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
+ if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
print ''.price($sign * $line->multicurrency_total_ht).' ';
$coldisplay++;
}
diff --git a/htdocs/core/tpl/originproductline.tpl.php b/htdocs/core/tpl/originproductline.tpl.php
index 25c799ffbfd..090ba834ba1 100644
--- a/htdocs/core/tpl/originproductline.tpl.php
+++ b/htdocs/core/tpl/originproductline.tpl.php
@@ -32,7 +32,7 @@ print ''.$this->tpl['label'].' ';
print ''.$this->tpl['description'].' ';
print ''.$this->tpl['vat_rate'].' ';
print ''.$this->tpl['price'].' ';
-if (!empty($conf->multicurrency->enabled)) {
+if (isModEnabled("multicurrency")) {
print ''.$this->tpl['multicurrency_price'].' ';
}
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index ae7d522a115..4d5b27e9c7a 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -558,7 +558,7 @@ if ($id > 0 || !empty($ref)) {
print '';
- 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($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).' ';
diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php
index ed74cc2eeb6..7cde90e3d7e 100644
--- a/htdocs/fichinter/card.php
+++ b/htdocs/fichinter/card.php
@@ -998,7 +998,7 @@ if ($action == 'create') {
print '' . $langs->trans('AmountTTC') . ' ' . price($objectsrc->total_ttc) . " ";
- if (!empty($conf->multicurrency->enabled))
+ if (isModEnabled("multicurrency"))
{
print '' . $langs->trans('MulticurrencyAmountHT') . ' ' . price($objectsrc->multicurrency_total_ht) . ' ';
print '' . $langs->trans('MulticurrencyAmountVAT') . ' ' . price($objectsrc->multicurrency_total_tva) . " ";
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 4d8ed594770..b19609dc7bb 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -191,7 +191,7 @@ class CommandeFournisseur extends CommonOrder
* 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)
@@ -247,11 +247,11 @@ class CommandeFournisseur extends CommonOrder
'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>1, 'visible'=>3, 'position'=>205),
'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLocation', 'enabled'=>1, 'visible'=>3, 'position'=>210),
'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>0, 'position'=>215),
- 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Currency', 'enabled'=>'!empty($conf->multicurrency->enabled)', 'visible'=>-1, 'position'=>220),
- 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'CurrencyRate', 'enabled'=>'!empty($conf->multicurrency->enabled)', 'visible'=>-1, 'position'=>225),
- 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'!empty($conf->multicurrency->enabled)', 'visible'=>-1, 'position'=>230),
- 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'!empty($conf->multicurrency->enabled)', 'visible'=>-1, 'position'=>235),
- 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'!empty($conf->multicurrency->enabled)', 'visible'=>-1, 'position'=>240),
+ 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Currency', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>220),
+ 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'CurrencyRate', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>225),
+ 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>230),
+ 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>235),
+ 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>240),
'date_creation' =>array('type'=>'datetime', 'label'=>'Date creation', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>1, 'notnull'=>1, 'position'=>46),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>1000, 'index'=>1),
@@ -1888,7 +1888,7 @@ class CommandeFournisseur extends CommonOrder
}
}
- if (!empty($conf->multicurrency->enabled) && $pu_ht_devise > 0) {
+ if (isModEnabled("multicurrency") && $pu_ht_devise > 0) {
$pu = 0;
}
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 7fa932d497a..c4e034dd7a1 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -2125,7 +2125,7 @@ class FactureFournisseur extends CommonInvoice
$product_type = $type;
}
- if (!empty($conf->multicurrency->enabled) && $pu_devise > 0) {
+ if (isModEnabled("multicurrency") && $pu_devise > 0) {
$pu = 0;
}
diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php
index 25b26c75852..276c5b20ed9 100644
--- a/htdocs/fourn/class/fournisseur.product.class.php
+++ b/htdocs/fourn/class/fournisseur.product.class.php
@@ -296,7 +296,7 @@ class ProductFournisseur extends Product
// Multicurrency
$multicurrency_unitBuyPrice = null;
$fk_multicurrency = null;
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
if (empty($multicurrency_tx)) {
$multicurrency_tx = 1;
}
diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php
index 386c34483de..e0b3fcac0c6 100644
--- a/htdocs/fourn/class/paiementfourn.class.php
+++ b/htdocs/fourn/class/paiementfourn.class.php
@@ -862,7 +862,7 @@ class PaiementFourn extends Paiement
global $conf;
$way = 'dolibarr';
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
foreach ($this->multicurrency_amounts as $value) {
if (!empty($value)) { // one value found then payment is in invoice currency
$way = 'customer';
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index c987103dd3d..439f6b09760 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -1616,7 +1616,7 @@ if ($action == 'create') {
$datedelivery = (!empty($objectsrc->date_livraison) ? $objectsrc->date_livraison : (!empty($objectsrc->delivery_date) ? $objectsrc->delivery_date : ''));
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
if (!empty($objectsrc->multicurrency_code)) {
$currency_code = $objectsrc->multicurrency_code;
}
@@ -1634,7 +1634,7 @@ if ($action == 'create') {
$cond_reglement_id = !empty($societe->cond_reglement_supplier_id) ? $societe->cond_reglement_supplier_id : 0;
$mode_reglement_id = !empty($societe->mode_reglement_supplier_id) ? $societe->mode_reglement_supplier_id : 0;
- if (!empty($conf->multicurrency->enabled) && !empty($societe->multicurrency_code)) {
+ if (isModEnabled("multicurrency") && !empty($societe->multicurrency_code)) {
$currency_code = $societe->multicurrency_code;
}
@@ -1772,7 +1772,7 @@ if ($action == 'create') {
}
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print '';
print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).' ';
print '';
@@ -1819,7 +1819,7 @@ if ($action == 'create') {
print ' '.$langs->trans('AmountTTC').' '.price($objectsrc->total_ttc)." ";
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print ''.$langs->trans('MulticurrencyAmountHT').' '.price($objectsrc->multicurrency_total_ht).' ';
print ''.$langs->trans('MulticurrencyAmountVAT').' '.price($objectsrc->multicurrency_total_tva).' ';
print ''.$langs->trans('MulticurrencyAmountTTC').' '.price($objectsrc->multicurrency_total_ttc).' ';
@@ -2165,7 +2165,7 @@ if ($action == 'create') {
print '';
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
// Multicurrency code
print '';
print '';
diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index a44c0d13338..c5aa40d99d6 100644
--- a/htdocs/fourn/commande/dispatch.php
+++ b/htdocs/fourn/commande/dispatch.php
@@ -243,7 +243,7 @@ if ($action == 'dispatch' && $permissiontoreceive) {
$fk_commandefourndet = "fk_commandefourndet_".$reg[1].'_'.$reg[2];
if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
- if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) {
+ if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) {
$dto = GETPOST("dto_".$reg[1].'_'.$reg[2], 'int');
if (!empty($dto)) {
$unit_price = price2num(GETPOST("pu_".$reg[1]) * (100 - $dto) / 100, 'MU');
@@ -269,7 +269,7 @@ if ($action == 'dispatch' && $permissiontoreceive) {
}
if (!$error && !empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
- if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) {
+ if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) {
$dto = price2num(GETPOST("dto_".$reg[1].'_'.$reg[2], 'int'), '');
if (empty($dto)) {
$dto = 0;
@@ -311,7 +311,7 @@ if ($action == 'dispatch' && $permissiontoreceive) {
$fk_commandefourndet = 'fk_commandefourndet_'.$reg[1].'_'.$reg[2];
if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
- if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) {
+ if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) {
$dto = GETPOST("dto_".$reg[1].'_'.$reg[2], 'int');
if (!empty($dto)) {
$unit_price = price2num(GETPOST("pu_".$reg[1]) * (100 - $dto) / 100, 'MU');
@@ -344,7 +344,7 @@ if ($action == 'dispatch' && $permissiontoreceive) {
}
if (!$error && !empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
- if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) {
+ if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) {
$dto = GETPOST("dto_".$reg[1].'_'.$reg[2], 'int');
//update supplier price
if (GETPOSTISSET($saveprice)) {
@@ -742,7 +742,7 @@ if ($id > 0 || !empty($ref)) {
print ' ';
if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
- if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) {
+ if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) {
print ''.$langs->trans("Price").' ';
print ''.$langs->trans("ReductionShort").' (%) ';
print ''.$langs->trans("UpdatePrice").' ';
@@ -991,7 +991,7 @@ if ($id > 0 || !empty($ref)) {
print '';
if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
- if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) {
+ if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) {
// Price
print '';
print ' ';
diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php
index 8983c3e4b8b..3b3a0d75253 100644
--- a/htdocs/fourn/facture/card-rec.php
+++ b/htdocs/fourn/facture/card-rec.php
@@ -1243,7 +1243,7 @@ if ($action == 'create') {
print ' ';
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
// Multicurrency code
print '';
print '';
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 92318ba820e..2f8f3f2adae 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -1915,7 +1915,7 @@ if ($action == 'create') {
if (GETPOST('socid', 'int') > 0) {
$societe = new Societe($db);
$societe->fetch(GETPOST('socid', 'int'));
- if (!empty($conf->multicurrency->enabled) && !empty($societe->multicurrency_code)) {
+ if (isModEnabled("multicurrency") && !empty($societe->multicurrency_code)) {
$currency_code = $societe->multicurrency_code;
}
}
@@ -1964,7 +1964,7 @@ if ($action == 'create') {
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '';
$transport_mode_id = (!empty($objectsrc->transport_mode_id) ? $objectsrc->transport_mode_id : (!empty($soc->transport_mode_id) ? $soc->transport_mode_id : 0));
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
if (!empty($objectsrc->multicurrency_code)) {
$currency_code = $objectsrc->multicurrency_code;
}
@@ -1991,7 +1991,7 @@ if ($action == 'create') {
$datetmp = dol_mktime(12, 0, 0, GETPOST('echmonth', 'int'), GETPOST('echday', 'int'), GETPOST('echyear', 'int'));
$datedue = ($datetmp == '' ?-1 : $datetmp);
- if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) {
+ if (isModEnabled("multicurrency") && !empty($soc->multicurrency_code)) {
$currency_code = $soc->multicurrency_code;
}
}
@@ -2428,7 +2428,7 @@ if ($action == 'create') {
}
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print ' ';
print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).' ';
print '';
@@ -2537,7 +2537,7 @@ if ($action == 'create') {
}
print ' '.$langs->trans('AmountTTC').' '.price($objectsrc->total_ttc)." ";
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print ''.$langs->trans('MulticurrencyAmountHT').' '.price($objectsrc->multicurrency_total_ht).' ';
print ''.$langs->trans('MulticurrencyAmountVAT').' '.price($objectsrc->multicurrency_total_tva)." ";
print ''.$langs->trans('MulticurrencyAmountTTC').' '.price($objectsrc->multicurrency_total_ttc)." ";
@@ -2613,7 +2613,7 @@ if ($action == 'create') {
$resteapayer = price2num($object->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits, 'MT');
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$multicurrency_totalpaid = $object->getSommePaiement(1);
$multicurrency_totalcreditnotes = $object->getSumCreditNotesUsed(1);
$multicurrency_totaldeposits = $object->getSumDepositsUsed(1);
@@ -3046,7 +3046,7 @@ if ($action == 'create') {
print '';
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
// Multicurrency code
print '';
print '';
@@ -3169,7 +3169,7 @@ if ($action == 'create') {
print '';
- 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($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).' ';
@@ -3256,7 +3256,7 @@ if ($action == 'create') {
if (!empty($conf->incoterm->enabled)) {
$nbrows++;
}
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$nbrows += 5;
}
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index 0072349c06b..305c50b29d5 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -195,13 +195,13 @@ $arrayfields = array(
'u.login'=>array('label'=>"Author", 'checked'=>1),
'dynamount_payed'=>array('label'=>"Paid", 'checked'=>0),
'rtp'=>array('label'=>"Rest", 'checked'=>0),
- 'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
- 'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
- 'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
- 'f.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
- 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
- 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
- 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), // Not enabled by default because slow
+ 'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
+ 'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
+ 'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
+ 'f.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
+ 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
+ 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
+ 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), // Not enabled by default because slow
'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index 09507929daf..d9b755fdf4e 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -575,7 +575,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print ''.$langs->trans('RefSupplier').' ';
print ''.$langs->trans('Date').' ';
print ''.$langs->trans('DateMaxPayment').' ';
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print ''.$langs->trans('Currency').' ';
print ''.$langs->trans('MulticurrencyAmountTTC').' ';
print ''.$langs->trans('MulticurrencyAlreadyPaid').' ';
@@ -612,7 +612,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT');
// Multicurrency Price
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$multicurrency_payment = $invoice->getSommePaiement(1);
$multicurrency_creditnotes = $invoice->getSumCreditNotesUsed(1);
$multicurrency_deposits = $invoice->getSumDepositsUsed(1);
@@ -653,7 +653,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
// Currency
print ''.$objp->multicurrency_code." \n";
@@ -767,7 +767,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Print total
print '';
print ''.$langs->trans('TotalTTC').': ';
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print ' ';
print ' ';
print ' ';
diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php
index 0762d95d154..81da2909779 100644
--- a/htdocs/modulebuilder/index.php
+++ b/htdocs/modulebuilder/index.php
@@ -907,7 +907,7 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray',
* 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)
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index 1d6b6650d27..8265bbadaf8 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -84,7 +84,7 @@ class MyObject 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)
diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
index 561c09f88d6..3990d49fa6d 100644
--- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
+++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
@@ -634,13 +634,13 @@ class pdf_standard_myobject extends ModelePDFMyObject
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
if ($prev_progress > 0 && !empty($object->lines[$i]->situation_percent)) { // Compute progress from previous situation
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
$tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent;
} else {
$tvaligne = $sign * $object->lines[$i]->total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent;
}
} else {
- if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
+ if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
$tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva;
} else {
$tvaligne = $sign * $object->lines[$i]->total_tva;
diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php
index 06fe91c120d..3f20476f72a 100644
--- a/htdocs/multicurrency/multicurrency_rate.php
+++ b/htdocs/multicurrency/multicurrency_rate.php
@@ -102,7 +102,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
// Access control
// TODO Open this page to a given permission so a sale representative can modify change rates. Permission should be added into module multicurrency.
// One permission to read rates (history) and one to add/edit rates.
-if (!$user->admin || empty($conf->multicurrency->enabled)) {
+if (!$user->admin || !isModEnabled("multicurrency")) {
accessforbidden();
}
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index 164dac7d185..03e7881dffb 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -243,7 +243,7 @@ if (empty($reshook)) {
$_POST["price"] = 0;
}
}
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
if (!GETPOST("multicurrency_code")) {
$error++;
$langs->load("errors");
@@ -299,7 +299,7 @@ if (empty($reshook)) {
}*/
$object->packaging = $packaging;
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$multicurrency_tx = price2num(GETPOST("multicurrency_tx", 'alpha'));
$multicurrency_price = price2num(GETPOST("multicurrency_price", 'alpha'));
$multicurrency_code = GETPOST("multicurrency_code", 'alpha');
@@ -630,7 +630,7 @@ if ($id > 0 || $ref) {
';
}
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
// Currency
print ' '.$langs->trans("Currency").' ';
print '';
@@ -973,7 +973,7 @@ END;
}
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("PriceQtyMinHT", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print_liste_field_titre("PriceQtyMinHTCurrency", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
}
if (!empty($arrayfields['pfp.unitprice']['checked'])) {
@@ -982,7 +982,7 @@ END;
if (!empty($arrayfields['pfp.multicurrency_unitprice']['checked'])) {
print_liste_field_titre("UnitPriceHTCurrency", $_SERVER["PHP_SELF"], "pfp.multicurrency_unitprice", "", $param, '', $sortfield, $sortorder, 'right ');
}
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print_liste_field_titre("Currency", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
}
print_liste_field_titre("DiscountQtyMin", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
@@ -1089,7 +1089,7 @@ END;
print $productfourn->fourn_price ? ''.price($productfourn->fourn_price).' ' : "";
print ' ';
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
// Price for the quantity in currency
print '';
print $productfourn->fourn_multicurrency_price ? ''.price($productfourn->fourn_multicurrency_price).' ' : "";
@@ -1112,7 +1112,7 @@ END;
}
// Currency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print ' ';
print $productfourn->fourn_multicurrency_code ? currency_name($productfourn->fourn_multicurrency_code) : '';
print ' ';
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('Capital', 'capital', '', $object, 0).' ';
print ' ';
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print ''.$langs->trans("Currency".$object->multicurrency_code).' ';
} else {
print ''.$langs->trans("Currency".$conf->currency).' ';
@@ -1788,7 +1788,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print '';
print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).' ';
print '';
@@ -2002,7 +2002,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// We set multicurrency_code if enabled
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$object->multicurrency_code = GETPOST('multicurrency_code') ? GETPOST('multicurrency_code') : $object->multicurrency_code;
}
}
@@ -2439,7 +2439,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ' '.$form->editfieldkey('Capital', 'capital', '', $object, 0).' ';
print ' '.$langs->trans("Currency".$object->multicurrency_code).' ';
} else {
print '"> '.$langs->trans("Currency".$conf->currency).' ';
@@ -2494,7 +2494,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print '';
print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).' ';
print '';
@@ -2930,7 +2930,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Capital
print ' '.$langs->trans('Capital').' ';
if ($object->capital) {
- if (!empty($conf->multicurrency->enabled) && !empty($object->multicurrency_code)) {
+ if (isModEnabled("multicurrency") && !empty($object->multicurrency_code)) {
print price($object->capital, '', $langs, 0, -1, -1, $object->multicurrency_code);
} else {
print price($object->capital, '', $langs, 0, -1, -1, $conf->currency);
@@ -2971,7 +2971,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print ' ';
print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).' ';
print '';
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 5228f0ccac2..b7270037a09 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -307,7 +307,7 @@ if (empty($reshook)) {
$object->origin_id = GETPOST('originid');
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
}
@@ -1190,7 +1190,7 @@ if ($action == 'create') {
$objectsrc->fetch_optionals();
$object->array_options = $objectsrc->array_options;
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
if (!empty($objectsrc->multicurrency_code)) {
$currency_code = $objectsrc->multicurrency_code;
}
@@ -1201,7 +1201,7 @@ if ($action == 'create') {
} else {
$cond_reglement_id = $soc->cond_reglement_supplier_id;
$mode_reglement_id = $soc->mode_reglement_supplier_id;
- if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) {
+ if (isModEnabled("multicurrency") && !empty($soc->multicurrency_code)) {
$currency_code = $soc->multicurrency_code;
}
}
@@ -1334,7 +1334,7 @@ if ($action == 'create') {
}
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print ' ';
print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).' ';
print '';
@@ -1381,7 +1381,7 @@ if ($action == 'create') {
}
print ' '.$langs->trans('AmountTTC').' '.price($objectsrc->total_ttc)." ";
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
print ''.$langs->trans('MulticurrencyAmountHT').' '.price($objectsrc->multicurrency_total_ht).' ';
print ''.$langs->trans('MulticurrencyAmountVAT').' '.price($objectsrc->multicurrency_total_tva)." ";
print ''.$langs->trans('MulticurrencyAmountTTC').' '.price($objectsrc->multicurrency_total_ttc)." ";
@@ -1685,7 +1685,7 @@ if ($action == 'create') {
print '';
// Multicurrency
- if (!empty($conf->multicurrency->enabled)) {
+ if (isModEnabled("multicurrency")) {
// Multicurrency code
print '';
print '';
@@ -1778,7 +1778,7 @@ if ($action == 'create') {
print '';
- 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($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)