diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 02e27813c6f2e..8bc356e18d921 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -94,13 +94,13 @@ print load_fiche_titre($langs->trans("LimitsSetup"), '', 'title_setup'); +$currencycode = (! empty($currencycode)?$currencycode:$conf->currency); +$aCurrencies = array($conf->currency); // Default currency always first position + if (! empty($conf->multicurrency->enabled) && ! empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/multicurrency.lib.php'; - $currencycode = (! empty($currencycode)?$currencycode:$conf->currency); - $aCurrencies = array($conf->currency); // Default currency always first position - $sql = 'SELECT rowid, code FROM '.MAIN_DB_PREFIX.'multicurrency'; $sql.= ' WHERE entity = '.$conf->entity; $sql.= ' AND code != "'.$conf->currency.'"'; // Default currency always first position @@ -111,12 +111,12 @@ { $aCurrencies[] = $obj->code; } + } - if (! empty($aCurrencies) && count($aCurrencies) > 1) - { - $head = multicurrencyLimitPrepareHead($aCurrencies); - dol_fiche_head($head, $currencycode, '', -1, "multicurrency"); - } + if (! empty($aCurrencies) && count($aCurrencies) > 1) + { + $head = multicurrencyLimitPrepareHead($aCurrencies); + dol_fiche_head($head, $currencycode, '', -1, "multicurrency"); } } @@ -139,18 +139,18 @@ print ''; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"), $langs->trans("ParameterActiveForNextInputOnly")); - print ''; + print ''; print ''; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); - print ''; + print ''; print ''.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").''; - print ''; + print ''; print ''; print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); - print ''; + print ''; print ''; @@ -170,18 +170,18 @@ print ''; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"), $langs->trans("ParameterActiveForNextInputOnly")); - print ''.(! empty($conf->global->$mainmaxdecimalsunit)?$conf->global->$mainmaxdecimalsunit:$conf->global->MAIN_MAX_DECIMALS_UNIT).''; + print ''.(isset($conf->global->$mainmaxdecimalsunit)?$conf->global->$mainmaxdecimalsunit:$conf->global->MAIN_MAX_DECIMALS_UNIT).''; print ''; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); - print ''.(! empty($conf->global->$mainmaxdecimalstot)?$conf->global->$mainmaxdecimalstot:$conf->global->MAIN_MAX_DECIMALS_TOT).''; + print ''.(isset($conf->global->$mainmaxdecimalstot)?$conf->global->$mainmaxdecimalstot:$conf->global->MAIN_MAX_DECIMALS_TOT).''; print ''.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").''; - print ''.(! empty($conf->global->$mainmaxdecimalsshown)?$conf->global->$mainmaxdecimalsshown:$conf->global->MAIN_MAX_DECIMALS_SHOWN).''; + print ''.(isset($conf->global->$mainmaxdecimalsshown)?$conf->global->$mainmaxdecimalsshown:$conf->global->MAIN_MAX_DECIMALS_SHOWN).''; print ''; print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); - print ''.(! empty($conf->global->$mainroundingruletot)?$conf->global->$mainroundingruletot:$conf->global->MAIN_ROUNDING_RULE_TOT).''; + print ''.(isset($conf->global->$mainroundingruletot)?$conf->global->$mainroundingruletot:$conf->global->MAIN_ROUNDING_RULE_TOT).''; print ''; @@ -190,6 +190,14 @@ print ''; } +if (! empty($conf->multicurrency->enabled) && ! empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) +{ + if (! empty($aCurrencies) && count($aCurrencies) > 1) + { + dol_fiche_end(); + } +} + if (empty($mysoc->country_code)) { $langs->load("errors");