diff --git a/htdocs/core/modules/modMultiCurrency.class.php b/htdocs/core/modules/modMultiCurrency.class.php index 0dbfe3380cf..7908f203c69 100644 --- a/htdocs/core/modules/modMultiCurrency.class.php +++ b/htdocs/core/modules/modMultiCurrency.class.php @@ -59,7 +59,7 @@ class modMultiCurrency extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) - $this->description = "Module to enter elements with a foreign currency"; + $this->description = "Module to manage several foreign currencies in prices and documents"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version $this->version = 'dolibarr'; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 462be52b082..a2f79e4c402 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -552,19 +552,22 @@ if ($id > 0 || $ref) // Currency print ''.$langs->trans("Currency").''; print ''; - print $form->selectMultiCurrency(GETPOST('multicurrency_code')?GETPOST('multicurrency_code'):(isset($object->fourn_multicurrency_code)?$object->fourn_multicurrency_code:''), "multicurrency_code", 1); + $currencycodetouse = GETPOST('multicurrency_code')?GETPOST('multicurrency_code'):(isset($object->fourn_multicurrency_code)?$object->fourn_multicurrency_code:''); + if (empty($currencycodetouse) && $object->fourn_multicurrency_tx == 1) $currencycodetouse=$conf->currency; + print $form->selectMultiCurrency($currencycodetouse, "multicurrency_code", 1); print ''; print ''; // Currency tx print ''.$langs->trans("CurrencyRate").''; - print ''; + print ''; print ''; print ''; // Currency price qty min print ''.$langs->trans("PriceQtyMinCurrency").''; - print ''; + $pricesupplierincurrencytouse=(GETPOST('multicurrency_price')?GETPOST('multicurrency_price'):(isset($object->fourn_multicurrency_price)?$object->fourn_multicurrency_price:'')); + print ''; print ' '; print $form->selectPriceBaseType((GETPOST('multicurrency_price_base_type')?GETPOST('multicurrency_price_base_type'):'HT'), "multicurrency_price_base_type"); // We keep 'HT' here, multicurrency_price_base_type is not yet supported for supplier prices print ''; @@ -602,7 +605,7 @@ if ($id > 0 || $ref) $('input[name="disabled_price"]').prop('disabled', true); $('select[name="disabled_price_base_type"]').prop('disabled', true); update_price_from_multicurrency(); - + $('input[name="multicurrency_price"]').keyup(function () { update_price_from_multicurrency(); }).change(function () { @@ -610,7 +613,7 @@ if ($id > 0 || $ref) }).on('paste', function () { update_price_from_multicurrency(); }); - + $('input[name="multicurrency_tx"]').keyup(function () { update_price_from_multicurrency(); }).change(function () { @@ -618,12 +621,12 @@ if ($id > 0 || $ref) }).on('paste', function () { update_price_from_multicurrency(); }); - + $('select[name="multicurrency_price_base_type"]').change(function () { $('input[name="price_base_type"]').val($(this).val()); $('select[name="disabled_price_base_type"]').val($(this).val()); }); - + var currencies_array = $currencies; $('select[name="multicurrency_code"]').change(function () { $('input[name="multicurrency_tx"]').val(currencies_array[$(this).val()]); @@ -844,7 +847,7 @@ SCRIPT; } // Modify-Remove - print ''; + print ''; if ($user->rights->produit->creer || $user->rights->service->creer) { print ''.img_edit()."";