diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index bad5f112d21..111ae5fa4ad 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -44,6 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Bar or Restaurant or multiple sales $action = GETPOST('action', 'aZ09'); $setterminal = GETPOST('setterminal', 'int'); +$setcurrency = GETPOST('setcurrency', 'aZ09'); if ($_SESSION["takeposterminal"] == "") { @@ -57,6 +58,11 @@ if ($setterminal > 0) setcookie("takeposterminal", $setterminal, (time() + (86400 * 354)), '/', null, false, true); // Permanent takeposterminal var in a cookie } +if ($setcurrency!="") +{ + $_SESSION["takeposcustomercurrency"] = $setcurrency; +} + $_SESSION["urlfrom"] = '/takepos/index.php'; $langs->loadLangs(array("bills", "orders", "commercial", "cashdesk", "receiptprinter", "banks")); @@ -725,14 +731,10 @@ function CashReport(rowid) $.colorbox({href:"../compta/cashcontrol/report.php?id="+rowid+"&contextpage=takepos", width:"60%", height:"90%", transition:"none", iframe:"true", title:"trans("CashReport"); ?>"}); } -// Popup to select the terminal to use -function TerminalsDialog() +// TakePOS Popup +function ModalBox(ModalID) { - var modal = document.getElementById("ModalTerminal"); - var span = document.getElementsByClassName("close")[0]; - span.onclick = function() { - modal.style.display = "none"; - } + var modal = document.getElementById(ModalID); modal.style.display = "block"; } @@ -767,7 +769,7 @@ $( document ).ready(function() { //IF NO TERMINAL SELECTED if ($_SESSION["takeposterminal"] == "") { - print "TerminalsDialog();"; + print "ModalBox('ModalTerminal');"; } if ($conf->global->TAKEPOS_CONTROL_CASH_OPENING) { @@ -798,7 +800,7 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
+ + multicurrency->enabled)){ + print ''.$langs->trans("Currency").''; + } + ?> +
@@ -841,7 +849,7 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { + +
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index f560fee0b44..d3ec86a7268 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1090,7 +1090,16 @@ if ($placeid > 0) } else $htmlforlines .= $line->qty; $htmlforlines .= ''; - $htmlforlines .= ''.price($line->total_ttc).''; + $htmlforlines .= ''; + $htmlforlines .= price($line->total_ttc); + 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 .= ''; } $htmlforlines .= ''."\n"; $htmlforlines .= $htmlsupplements[$line->id]; diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index c7ca395a316..2bf24aa0cd3 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -182,6 +182,17 @@ if ($conf->global->TAKEPOS_SHOW_CUSTOMER) trans("TotalTTC").''.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency)."\n"; ?> 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"]); + echo ''; + if ($gift!=1) echo ''.$langs->trans("TotalTTC").' '.$_SESSION["takeposcustomercurrency"].''.price($object->total_ttc*$multicurrency->rate->rate, 1, '', 1, - 1, - 1, $_SESSION["takeposcustomercurrency"])."\n"; + //if ($gift!=1) echo ''.$langs->trans("TotalTTC").''.price($line->total_ttc*$multicurrency->rate->rate).' '.$_SESSION["takeposcustomercurrency"]."\n"; + echo ''; +} + if ($conf->global->TAKEPOS_PRINT_PAYMENT_METHOD) { $sql = "SELECT p.pos_change as pos_change, p.datep as date, p.fk_paiement, p.num_paiement as num, pf.amount as amount, pf.multicurrency_amount,"; $sql .= " cp.code";