From 12440e6a7e62087adb32a07b17abf9f64ac9f018 Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Wed, 2 May 2018 11:30:35 +0200 Subject: [PATCH] Do not display multicurrency cols if currency of object is same as main currency --- htdocs/core/class/commonobject.class.php | 4 ++-- htdocs/core/tpl/objectline_create.tpl.php | 6 +++--- htdocs/core/tpl/objectline_edit.tpl.php | 4 ++-- htdocs/core/tpl/objectline_view.tpl.php | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 046097eec86..4c236324373 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3677,7 +3677,7 @@ abstract class CommonObject print ''.$langs->trans('PriceUHT').''; // Multicurrency - if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).''; + if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) print ''.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).''; if ($inputalsopricewithtax) print ''.$langs->trans('PriceUTTC').''; @@ -3716,7 +3716,7 @@ abstract class CommonObject print ''.$langs->trans('TotalHTShort').''; // Multicurrency - if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).''; + if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) print ''.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).''; if ($outputalsopricetotalwithtax) print ''.$langs->trans('TotalTTCShort').''; diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index fdef8a03ed8..61818d4deb9 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -111,7 +111,7 @@ if ($nolinesbefore) { trans('VAT'); ?> trans('PriceUHT'); ?> - multicurrency->enabled)) { $colspan++;?> + multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { $colspan++;?> trans('PriceUHTCurrency'); ?> @@ -345,7 +345,7 @@ else { "> - multicurrency->enabled)) { $colspan++;?> + multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { $colspan++;?> "> @@ -462,7 +462,7 @@ if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $da } } - if (!empty($conf->multicurrency->enabled)) $colspan+=2; + if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) $colspan+=2; if (! empty($usemargins)) { diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index a6f5fef5310..d3dc9807c5a 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -53,7 +53,7 @@ $colspan = 3; // Col total ht + col edit + col delete if (! empty($inputalsopricewithtax)) $colspan++; // We add 1 if col total ttc if (in_array($object->element,array('propal','supplier_proposal','facture','invoice','commande','order','order_supplier','invoice_supplier'))) $colspan++; // With this, there is a column move button if (empty($user->rights->margins->creer)) $colspan++; -if (!empty($conf->multicurrency->enabled)) $colspan+=2; +if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) $colspan+=2; ?> @@ -148,7 +148,7 @@ $coldisplay=-1; // We remove first td if ($this->situation_counter > 1) print ' readonly'; print '>'; - if (!empty($conf->multicurrency->enabled)) { + if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { print ''; } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index f48b0b917a1..b36159f9340 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -195,7 +195,7 @@ $domData .= ' data-product_type="'.$line->product_type.'"'; subprice); ?> - multicurrency->enabled)) { ?> + multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?> multicurrency_subprice); ?> @@ -261,7 +261,7 @@ $domData .= ' data-product_type="'.$line->product_type.'"'; trans('Option'); ?> total_ht); ?> - multicurrency->enabled)) { ?> + multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?> multicurrency_total_ht); ?>