Fix missing header

This commit is contained in:
Laurent Destailleur 2024-01-20 17:16:16 +01:00
parent 6e6aa29ff3
commit 9eaefcfdbf
2 changed files with 10 additions and 1 deletions

View File

@ -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';

View File

@ -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: '<?php echo currentToken(); ?>' },
url: "<?php print DOL_URL_ROOT.'/takepos/ajax/ajax.php?action=printinvoiceticket&token='.newToken().'&term='.urlencode(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '').'&id='; ?>" + id,
});
return true;
}