From f6eadbbc3f0a58fd1966657fb3b95c3712d2aea7 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Tue, 24 Nov 2020 21:48:08 +0100 Subject: [PATCH] Order receipt improvements in TakePOS --- htdocs/takepos/invoice.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index c7cfb2c0899..81da82087ec 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -678,7 +678,10 @@ if ($action == "order" and $placeid != 0) $printer = new dolReceiptPrinter($db); } - $headerorder = '
'.$langs->trans('Place').' '.$place.'
'; + $sql = "SELECT label FROM ".MAIN_DB_PREFIX."takepos_floor_tables where rowid=".((int) $place); + $resql = $db->query($sql); + $row = $db->fetch_object($resql); + $headerorder = '
'.$langs->trans('Place').' '.$row->label.'
'.$langs->trans("Label").''.$langs->trans("Qty").'
'; $footerorder = '
'.$langs->trans("Label").''.$langs->trans("Qty").'
'.dol_print_date(dol_now(), 'dayhour').'
'; $order_receipt_printer1 = ""; $order_receipt_printer2 = ""; @@ -695,11 +698,15 @@ if ($action == "order" and $placeid != 0) $existing = $c->containing($line->fk_product, Categorie::TYPE_PRODUCT, 'id'); $result = array_intersect($catsprinter1, $existing); $count = count($result); + if (!$line->fk_product) $count++; // Print Free-text item (Unassigned printer) to Printer 1 if ($count > 0) { $linestoprint++; $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='1' where rowid=".$line->id; //Set to print on printer 1 $db->query($sql); - $order_receipt_printer1 .= ''.$line->product_label.''.$line->qty; + $order_receipt_printer1 .= ''; + if ($line->fk_product) $order_receipt_printer1 .= $line->product_label; + else $order_receipt_printer1 .= $line->description; + $order_receipt_printer1 .= ''.$line->qty; if (!empty($line->array_options['options_order_notes'])) $order_receipt_printer1 .= "
(".$line->array_options['options_order_notes'].")"; $order_receipt_printer1 .= ''; } @@ -1372,4 +1379,4 @@ if ($action == "search") '; } -print ''; +print ''; \ No newline at end of file