diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php index fbb388b9aec..2700bad3a17 100644 --- a/htdocs/takepos/genimg/index.php +++ b/htdocs/takepos/genimg/index.php @@ -60,7 +60,7 @@ if ($query == "cat") { $filename = $obj['photo']; } - $file = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename); + $file = DOL_URL_ROOT.'/viewimage.php?cache=1&publictakepos=1&modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$filename); header('Location: '.$file); exit; } diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 3b486b7a3bc..859859fbc93 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -865,6 +865,9 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) print $langs->trans('Place')." ".$label." - "; print $langs->trans('Floor')." ".$floor." - "; } + elseif (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) print $mysoc->name; + elseif ($mobilepage == "cats") print $langs->trans('Category'); + elseif ($mobilepage == "products") print $langs->trans('Label'); } // In phone version only show when is invoice page if ($mobilepage == "invoice" || $mobilepage == "") { @@ -879,7 +882,7 @@ if ($_SESSION["basiclayout"] != 1) print ''.$langs->trans('Qty').''; print ''.$langs->trans('TotalTTCShort').''; } -else print ''.$langs->trans('Qty').''; +elseif ($mobilepage == "invoice") print ''.$langs->trans('Qty').''; print "\n"; @@ -892,11 +895,14 @@ if ($_SESSION["basiclayout"] == 1) $categories = $categorie->get_full_arbo('product'); $htmlforlines = ''; foreach ($categories as $row) { - $htmlforlines .= '
'; - $htmlforlines .= '
'; + if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '
'; + else $htmlforlines .= ''; $htmlforlines .= $row['label']; - $htmlforlines .= '
'."\n"; + if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= ''."\n"; + else $htmlforlines .= ''."\n"; } $htmlforlines .= ''; $htmlforlines .= ''; @@ -912,11 +918,20 @@ if ($_SESSION["basiclayout"] == 1) $prods = $object->getObjectsInCateg("product"); $htmlforlines = ''; foreach ($prods as $row) { - $htmlforlines .= '
id.')">'; - $htmlforlines .= '
'; - $htmlforlines .= $row->label.''.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency); - $htmlforlines .= '
'."\n"; + if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { + $htmlforlines .= '
'; + $htmlforlines .= $row->label.''.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency); + $htmlforlines .= ''."\n"; + } + else { + $htmlforlines .= ''; + $htmlforlines .= $row->label; + $htmlforlines .= '
'.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).'
'; + $htmlforlines .= ''."\n"; + } } $htmlforlines .= ''; print $htmlforlines; @@ -993,7 +1008,6 @@ if ($placeid > 0) $htmlforlines .= '" id="'.$line->id.'">'; $htmlforlines .= ''; if ($_SESSION["basiclayout"] == 1) $htmlforlines .= ''.$line->qty." x "; - //if ($line->product_label) $htmlforlines.= ''.$line->product_label.''; if (isset($line->product_type)) { if (empty($line->product_type)) $htmlforlines .= img_object('', 'product').' '; diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 32074b43d74..2276317a198 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -39,8 +39,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { // Decode place if it is an order from customer phone - $key = GETPOST('key'); - $place = dol_decode($key); + if (GETPOSTISSET("key")) $place = dol_decode(GETPOST('key')); + else $place = GETPOST('place', 'aZ09'); } else $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant $action = GETPOST('action', 'alpha'); @@ -87,9 +87,31 @@ elseif ($action == "publicpayment") { print '
'; } elseif ($action == "checkplease") { - print ''; - print ''; - print '
'; + if (GETPOSTISSET("payment")){ + print '

'.$langs->trans('StatusOrderDelivered').'

'; + 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); + $printer->initPrinter($conf->global->{'TAKEPOS_PRINTER_TO_USE'.$_SESSION["takeposterminal"]}); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->printer->text($langs->trans('IM')); + $printer->printer->feed(); + $printer->printer->text($langs->trans('Place').": ".$place); + $printer->printer->feed(); + $printer->printer->text($langs->trans('Payment').": ".$langs->trans(GETPOST('payment', 'alpha'))); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->printer->feed(); + $printer->close(); + } + else{ + print ''; + print ''; + print '
'; + } } elseif ($action == "editline") { $placeid = GETPOST('placeid', 'int'); @@ -231,6 +253,9 @@ function AddProductConfirm(placeid, productid){ } function SetQty(place, selectedline, qty){ + if (qty==0){ $("#phonediv2").load("auto_order.php?mobilepage=invoice&action=deleteline&place="+place+"&idline="+selectedline, function() { }); @@ -239,6 +264,21 @@ function SetQty(place, selectedline, qty){ $("#phonediv2").load("auto_order.php?mobilepage=invoice&action=updateqty&place="+place+"&idline="+selectedline+"&number="+qty, function() { }); } + + if (qty==0){ + $("#phonediv2").load("invoice.php?mobilepage=invoice&action=deleteline&place="+place+"&idline="+selectedline, function() { + }); + } + else{ + $("#phonediv2").load("invoice.php?mobilepage=invoice&action=updateqty&place="+place+"&idline="+selectedline+"&number="+qty, function() { + }); + } + LoadCats(); } @@ -301,14 +341,16 @@ function Exit(){ window.location.href='../user/logout.php'; } -function CheckPlease(){ - $("#phonediv1").load("auto_order.php?action=checkplease&place="+place, function() { - }); - console.log("Request the check to the waiter"); - $.ajax({ - type: "GET", - url: "", - }); +function CheckPlease(payment){ + if (payment==undefined){ + $("#phonediv1").load("auto_order.php?action=checkplease&place="+place, function() { + }); + } + else{ + console.log("Request the check to the waiter"); + $("#phonediv1").load("auto_order.php?action=checkplease&place=&payment="+payment, function() { + }); + } }