From a4892071227156be6a0c8729c91b46eb6474aca2 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 12 Aug 2019 13:56:12 +0200 Subject: [PATCH 1/2] Fix force recalculate price with multicurrency --- htdocs/core/class/commonobject.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e6d47c53d5f..69b43dbe514 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1936,10 +1936,16 @@ abstract class CommonObject { foreach ($this->lines as &$line) { + // Amounts in company currency will be recalculated if($mode == 1) { $line->subprice = 0; } + // Amounts in foreign currency will be recalculated + if($mode == 2) { + $line->multicurrency_subprice = 0; + } + switch ($this->element) { case 'propal': $this->updateline( From 9f18b3d6904ed19604c2db2f322626595f705d9f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Aug 2019 19:53:38 +0200 Subject: [PATCH 2/2] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 69b43dbe514..458c6a2563b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1913,7 +1913,7 @@ abstract class CommonObject * Change the multicurrency rate * * @param double $rate multicurrency rate - * @param int $mode mode 1 : amounts in company currency will be recalculated, mode 2 : amounts in foreign currency + * @param int $mode mode 1 : amounts in company currency will be recalculated, mode 2 : amounts in foreign currency will be recalculated * @return int >0 if OK, <0 if KO */ public function setMulticurrencyRate($rate, $mode = 1)