Pārlūkot izejas kodu

Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 17.0

Laurent Destailleur 2 gadi atpakaļ
vecāks
revīzija
45fdebcda2
3 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. 1 1
      htdocs/takepos/invoice.php
  2. 1 1
      htdocs/takepos/receipt.php
  3. 2 2
      htdocs/takepos/send.php

+ 1 - 1
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",

+ 1 - 1
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.

+ 2 - 2
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();