Merge pull request #13962 from andreubisquerra/develop
TakePOS Auto Order improvements
This commit is contained in:
commit
4e0d8ba518
@ -60,7 +60,7 @@ if ($query == "cat")
|
|||||||
{
|
{
|
||||||
$filename = $obj['photo'];
|
$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);
|
header('Location: '.$file);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -865,6 +865,9 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT)
|
|||||||
print $langs->trans('Place')." <b>".$label."</b> - ";
|
print $langs->trans('Place')." <b>".$label."</b> - ";
|
||||||
print $langs->trans('Floor')." <b>".$floor."</b> - ";
|
print $langs->trans('Floor')." <b>".$floor."</b> - ";
|
||||||
}
|
}
|
||||||
|
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
|
// In phone version only show when is invoice page
|
||||||
if ($mobilepage == "invoice" || $mobilepage == "") {
|
if ($mobilepage == "invoice" || $mobilepage == "") {
|
||||||
@ -879,7 +882,7 @@ if ($_SESSION["basiclayout"] != 1)
|
|||||||
print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
|
print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
|
||||||
print '<td class="linecolht right nowraponall">'.$langs->trans('TotalTTCShort').'</td>';
|
print '<td class="linecolht right nowraponall">'.$langs->trans('TotalTTCShort').'</td>';
|
||||||
}
|
}
|
||||||
else print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
|
elseif ($mobilepage == "invoice") print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|
||||||
@ -892,11 +895,14 @@ if ($_SESSION["basiclayout"] == 1)
|
|||||||
$categories = $categorie->get_full_arbo('product');
|
$categories = $categorie->get_full_arbo('product');
|
||||||
$htmlforlines = '';
|
$htmlforlines = '';
|
||||||
foreach ($categories as $row) {
|
foreach ($categories as $row) {
|
||||||
$htmlforlines .= '<div class="leftcat';
|
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '<div class="leftcat';
|
||||||
|
else $htmlforlines .= '<tr class="drag drop oddeven posinvoiceline';
|
||||||
$htmlforlines .= '" onclick="LoadProducts('.$row['id'].');">';
|
$htmlforlines .= '" onclick="LoadProducts('.$row['id'].');">';
|
||||||
$htmlforlines .= '<img class="imgwrapper" width="33%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=cat&query=cat&id='.$row['id'].'"><br>';
|
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '<img class="imgwrapper" width="33%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=cat&query=cat&id='.$row['id'].'"><br>';
|
||||||
|
else $htmlforlines .= '<td class="left">';
|
||||||
$htmlforlines .= $row['label'];
|
$htmlforlines .= $row['label'];
|
||||||
$htmlforlines .= '</div>'."\n";
|
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '</div>'."\n";
|
||||||
|
else $htmlforlines .= '</td></tr>'."\n";
|
||||||
}
|
}
|
||||||
$htmlforlines .= '</table>';
|
$htmlforlines .= '</table>';
|
||||||
$htmlforlines .= '</table>';
|
$htmlforlines .= '</table>';
|
||||||
@ -912,11 +918,20 @@ if ($_SESSION["basiclayout"] == 1)
|
|||||||
$prods = $object->getObjectsInCateg("product");
|
$prods = $object->getObjectsInCateg("product");
|
||||||
$htmlforlines = '';
|
$htmlforlines = '';
|
||||||
foreach ($prods as $row) {
|
foreach ($prods as $row) {
|
||||||
$htmlforlines .= '<div class="leftcat';
|
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) $htmlforlines .= '<div class="leftcat';
|
||||||
|
else $htmlforlines .= '<tr class="drag drop oddeven posinvoiceline';
|
||||||
$htmlforlines .= '" onclick="AddProduct(\''.$place.'\', '.$row->id.')">';
|
$htmlforlines .= '" onclick="AddProduct(\''.$place.'\', '.$row->id.')">';
|
||||||
$htmlforlines .= '<img class="imgwrapper" width="33%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=pro&query=pro&id='.$row->id.'"><br>';
|
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||||
$htmlforlines .= $row->label.''.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency);
|
$htmlforlines .= '<img class="imgwrapper" width="33%" src="'.DOL_URL_ROOT.'/takepos/public/auto_order.php?genimg=pro&query=pro&id='.$row->id.'"><br>';
|
||||||
$htmlforlines .= '</div>'."\n";
|
$htmlforlines .= $row->label.''.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency);
|
||||||
|
$htmlforlines .= '</div>'."\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$htmlforlines .= '<td class="left">';
|
||||||
|
$htmlforlines .= $row->label;
|
||||||
|
$htmlforlines .= '<div class="right">'.price($row->price_ttc, 1, $langs, 1, -1, -1, $conf->currency).'</div>';
|
||||||
|
$htmlforlines .= '</tr>'."\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$htmlforlines .= '</table>';
|
$htmlforlines .= '</table>';
|
||||||
print $htmlforlines;
|
print $htmlforlines;
|
||||||
@ -993,7 +1008,6 @@ if ($placeid > 0)
|
|||||||
$htmlforlines .= '" id="'.$line->id.'">';
|
$htmlforlines .= '" id="'.$line->id.'">';
|
||||||
$htmlforlines .= '<td class="left">';
|
$htmlforlines .= '<td class="left">';
|
||||||
if ($_SESSION["basiclayout"] == 1) $htmlforlines .= '<span class="phoneqty">'.$line->qty."</span> x ";
|
if ($_SESSION["basiclayout"] == 1) $htmlforlines .= '<span class="phoneqty">'.$line->qty."</span> x ";
|
||||||
//if ($line->product_label) $htmlforlines.= '<b>'.$line->product_label.'</b>';
|
|
||||||
if (isset($line->product_type))
|
if (isset($line->product_type))
|
||||||
{
|
{
|
||||||
if (empty($line->product_type)) $htmlforlines .= img_object('', 'product').' ';
|
if (empty($line->product_type)) $htmlforlines .= img_object('', 'product').' ';
|
||||||
|
|||||||
@ -39,8 +39,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
|||||||
|
|
||||||
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||||
// Decode place if it is an order from customer phone
|
// Decode place if it is an order from customer phone
|
||||||
$key = GETPOST('key');
|
if (GETPOSTISSET("key")) $place = dol_decode(GETPOST('key'));
|
||||||
$place = dol_decode($key);
|
else $place = GETPOST('place', 'aZ09');
|
||||||
}
|
}
|
||||||
else $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant
|
else $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
@ -87,9 +87,31 @@ elseif ($action == "publicpayment") {
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
elseif ($action == "checkplease") {
|
elseif ($action == "checkplease") {
|
||||||
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="CheckPlease();">'.$langs->trans('Cash').'</button>';
|
if (GETPOSTISSET("payment")){
|
||||||
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="CheckPlease();">'.$langs->trans('CreditCard').'</button>';
|
print '<h1>'.$langs->trans('StatusOrderDelivered').'</h1>';
|
||||||
print '<br>';
|
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 '<button type="button" class="publicphonebutton2 phoneblue total" onclick="CheckPlease(\'Cash\');">'.$langs->trans('Cash').'</button>';
|
||||||
|
print '<button type="button" class="publicphonebutton2 phoneblue total" onclick="CheckPlease(\'CreditCard\');">'.$langs->trans('CreditCard').'</button>';
|
||||||
|
print '<br>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif ($action == "editline") {
|
elseif ($action == "editline") {
|
||||||
$placeid = GETPOST('placeid', 'int');
|
$placeid = GETPOST('placeid', 'int');
|
||||||
@ -231,6 +253,9 @@ function AddProductConfirm(placeid, productid){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function SetQty(place, selectedline, qty){
|
function SetQty(place, selectedline, qty){
|
||||||
|
<?php
|
||||||
|
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
|
||||||
|
?>
|
||||||
if (qty==0){
|
if (qty==0){
|
||||||
$("#phonediv2").load("auto_order.php?mobilepage=invoice&action=deleteline&place="+place+"&idline="+selectedline, function() {
|
$("#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() {
|
$("#phonediv2").load("auto_order.php?mobilepage=invoice&action=updateqty&place="+place+"&idline="+selectedline+"&number="+qty, function() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
?>
|
||||||
|
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() {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
LoadCats();
|
LoadCats();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,14 +341,16 @@ function Exit(){
|
|||||||
window.location.href='../user/logout.php';
|
window.location.href='../user/logout.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
function CheckPlease(){
|
function CheckPlease(payment){
|
||||||
$("#phonediv1").load("auto_order.php?action=checkplease&place="+place, function() {
|
if (payment==undefined){
|
||||||
});
|
$("#phonediv1").load("auto_order.php?action=checkplease&place="+place, function() {
|
||||||
console.log("Request the check to the waiter");
|
});
|
||||||
$.ajax({
|
}
|
||||||
type: "GET",
|
else{
|
||||||
url: "<?php print dol_buildpath('/takepos/ajax/ajax.php', 1).'?action=thecheck&=place='.$place; ?>",
|
console.log("Request the check to the waiter");
|
||||||
});
|
$("#phonediv1").load("auto_order.php?action=checkplease&place=<?php echo $place;?>&payment="+payment, function() {
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user