diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php
index 8714173e45f..88ab8ef5227 100644
--- a/htdocs/takepos/phone.php
+++ b/htdocs/takepos/phone.php
@@ -39,10 +39,10 @@ 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);
+ $place = GETPOSTISSET("key") ? dol_decode(GETPOST('key')) : 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');
$setterminal = GETPOST('setterminal', 'int');
$idproduct = GETPOST('idproduct', 'int');
@@ -62,28 +62,54 @@ if (empty($user->rights->takepos->run) && !defined('INCLUDE_PHONEPAGE_FROM_PUBLI
* View
*/
-// Title
-$title = 'TakePOS - Dolibarr '.DOL_VERSION;
-if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
-$head = '
-
-
-';
-top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
-
-print '';
-
-if ($action=="productinfo"){
+if ($action == "productinfo") {
$prod = new Product($db);
$prod->fetch($idproduct);
- print "".$prod->label."
";
- print '
';
+ print '';
+ print "
".$prod->label."
";
+ print '
';
print "
".$prod->description;
print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency)."";
print '
';
- print '';
+} elseif ($action == "publicpreorder") {
+ print '';
+ print "
";
+ print '
';
+ print '
';
+} elseif ($action == "publicpayment") {
+ $langs->loadLangs(array("orders"));
+ print ''.$langs->trans('StatusOrderDelivered').'
';
+ print '';
+ print '
';
}
-elseif ($action=="editline"){
+elseif ($action == "checkplease") {
+ 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');
$selectedline = GETPOST('selectedline', 'int');
$invoice = new Facture($db);
@@ -95,17 +121,25 @@ elseif ($action=="editline"){
$prod = new Product($db);
$prod->fetch($line->fk_product);
print "".$prod->label."
";
- print '
';
+ print '
';
print "
".$prod->description;
print "
".price($prod->price_ttc, 1, $langs, 1, -1, -1, $conf->currency)."";
print '
';
- print '';
- print '';
- print '';
+ print '';
+ print '';
+ print '';
}
}
-}
else {
+ // Title
+ $title = 'TakePOS - Dolibarr '.DOL_VERSION;
+ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title = 'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
+ $head = '
+
+
+';
+ $arrayofcss = array('/takepos/css/phone.css');
+ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
?>
-
+
global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"] == "") print ''.$langs->trans('TerminalSelect').'
';
?>
@@ -300,19 +363,19 @@ function CheckPlease(){
print '';
print '';
}
- else{
- print '';
- print '';
- print '';
+ else {
+ print '';
+ print '';
+ print '';
}
?>
-
-