diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index 73905831ee5..9f3856a703f 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -396,6 +396,8 @@ if ($action == 'getProducts') { echo 'Failed to search product : '.$db->lasterror(); } } elseif ($action == "opendrawer" && $term != '') { + top_httphead('application/html'); + require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php'; $printer = new dolReceiptPrinter($db); // check printer for terminal @@ -406,6 +408,8 @@ if ($action == 'getProducts') { $printer->close(); } } elseif ($action == "printinvoiceticket" && $term != '' && $id > 0 && $user->hasRight('facture', 'lire')) { + top_httphead('application/html'); + require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $printer = new dolReceiptPrinter($db); @@ -427,6 +431,8 @@ if ($action == 'getProducts') { echo json_encode($object); } elseif ($action == 'thecheck') { + top_httphead('application/html'); + $place = GETPOST('place', 'alpha'); require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php'; diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 7afd29f7bf2..220fe3bf3b3 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -1287,12 +1287,15 @@ function TakeposConnector(id){ return true; } +// Call the ajax to execute the print. +// With some external module another method may be called. function DolibarrTakeposPrinting(id) { - console.log("DolibarrTakeposPrinting Printing invoice ticket " + id) + console.log("DolibarrTakeposPrinting Printing invoice ticket " + id); $.ajax({ type: "GET", data: { token: '' }, url: "" + id, + }); return true; }