From 31dd9885e6d6d1c8c3abb4680ddf7e59b0b81db5 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 4 Oct 2020 14:39:02 +0200 Subject: [PATCH 1/3] NEW multicurrency total in takepos --- htdocs/takepos/invoice.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index d3ec86a7268..6d16e6cc6b0 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -893,6 +893,13 @@ if ($_SESSION["basiclayout"] != 1) // In phone version only show when it is invoice page if ($mobilepage == "invoice" || $mobilepage == "") { print ''.price($invoice->total_ttc, 1, '', 1, -1, -1, $conf->currency).''; + if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"]!="" && $conf->currency!=$_SESSION["takeposcustomercurrency"]) { + //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency + include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; + $multicurrency = new MultiCurrency($db); + $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]); + print '
('.price($invoice->total_ttc*$multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"].')'; + } print ''; } print ''; From d25c5bf36a90e610b50ccbabc309744697c392d6 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 4 Oct 2020 12:40:52 +0000 Subject: [PATCH 2/3] Fixing style errors. --- htdocs/takepos/invoice.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 6d16e6cc6b0..e1245ce8c78 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -893,13 +893,13 @@ if ($_SESSION["basiclayout"] != 1) // In phone version only show when it is invoice page if ($mobilepage == "invoice" || $mobilepage == "") { print ''.price($invoice->total_ttc, 1, '', 1, -1, -1, $conf->currency).''; - if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"]!="" && $conf->currency!=$_SESSION["takeposcustomercurrency"]) { - //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency - include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; - $multicurrency = new MultiCurrency($db); - $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]); - print '
('.price($invoice->total_ttc*$multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"].')'; - } + if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"]!="" && $conf->currency!=$_SESSION["takeposcustomercurrency"]) { + //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency + include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; + $multicurrency = new MultiCurrency($db); + $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]); + print '
('.price($invoice->total_ttc*$multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"].')'; + } print ''; } print ''; From 1e6ad59856f8633ede72a38b94b539a6a6742361 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 4 Oct 2020 14:42:16 +0200 Subject: [PATCH 3/3] Update invoice.php --- htdocs/takepos/invoice.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index e1245ce8c78..f6b5b692040 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1098,13 +1098,13 @@ if ($placeid > 0) else $htmlforlines .= $line->qty; $htmlforlines .= ''; $htmlforlines .= ''; - $htmlforlines .= price($line->total_ttc); + $htmlforlines .= price($line->total_ttc, 1, '', 1, -1, -1, $conf->currency); if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"]!="" && $conf->currency!=$_SESSION["takeposcustomercurrency"]) { //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; $multicurrency = new MultiCurrency($db); $multicurrency->fetch(0, $_SESSION["takeposcustomercurrency"]); - $htmlforlines .= ' ('.price($line->total_ttc*$multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"].')'; + $htmlforlines .= '
('.price($line->total_ttc*$multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"].')'; } $htmlforlines .= ''; }