diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 6be323a1a7a..ccc1fde97eb 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1094,7 +1094,7 @@ function Print(id, gift){ function TakeposPrinting(id){ var receipt; console.log("TakeposPrinting" + id); - $.get("receipt.php?facid="+id, function(data, status){ + $.get("receipt.php?facid="+id, function(data, status) { receipt=data.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, ''); $.ajax({ type: "POST", diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index 400d05415aa..39fe2113071 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -85,7 +85,7 @@ $hookmanager->initHooks(array('takeposfrontend'), $facid); $reshook = $hookmanager->executeHooks('TakeposReceipt', $parameters, $object); if (!empty($hookmanager->resPrint)) { print $hookmanager->resPrint; - exit; + return; // Receipt page can be called by the takepos/send.php page that use ob_start/end so we must use return and not exit to stop page } // IMPORTANT: This file is sended to 'Takepos Printing' application. Keep basic file. No external files as css, js... If you need images use absolute path. diff --git a/htdocs/takepos/send.php b/htdocs/takepos/send.php index a8e13ac01a9..7397c962555 100644 --- a/htdocs/takepos/send.php +++ b/htdocs/takepos/send.php @@ -69,12 +69,12 @@ if ($action == "send") { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); $outputlangs = new Translate('', $conf); - $model_id = $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE; + $model_id = getDolGlobalString('TAKEPOS_EMAIL_TEMPLATE_INVOICE'); $arraydefaultmessage = $formmail->getEMailTemplate($db, 'facture_send', $user, $outputlangs, $model_id); $subject = $arraydefaultmessage->topic; ob_start(); // turn on output receipt - include 'receipt.php'; + include DOL_DOCUMENT_ROOT.'/takepos/receipt.php'; $receipt = ob_get_contents(); // get the contents of the output buffer ob_end_clean();