Merge pull request #11148 from andreubisquerra/master
TakePOS Terminals
This commit is contained in:
commit
e5b613562a
52
htdocs/core/lib/takepos.lib.php
Normal file
52
htdocs/core/lib/takepos.lib.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/lib/takepos.lib.php
|
||||
* \brief Library file with function for TakePOS module
|
||||
*/
|
||||
|
||||
/**
|
||||
* Prepare array with list of tabs
|
||||
*
|
||||
* @return array Array of tabs
|
||||
*/
|
||||
function takepos_prepare_head()
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/takepos/admin/setup.php';
|
||||
$head[$h][1] = $langs->trans("Parameters");
|
||||
$head[$h][2] = 'setup';
|
||||
$h++;
|
||||
|
||||
for ($i = 2; $i <= $conf->global->TAKEPOS_NUM_TERMINALS; $i++)
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT.'/takepos/admin/terminal.php?terminal='.$i;
|
||||
$head[$h][1] = $langs->trans("Terminal"). " ".$i;
|
||||
$head[$h][2] = 'terminal'.$i;
|
||||
$h++;
|
||||
}
|
||||
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos');
|
||||
|
||||
return $head;
|
||||
}
|
||||
@ -63,4 +63,6 @@ AutoPrintTickets=Automatically print tickets
|
||||
EnableBarOrRestaurantFeatures=Enable features for Bar or Restaurant
|
||||
ConfirmDeletionOfThisPOSSale=Do your confirm the deletion of this current sale ?
|
||||
History=History
|
||||
ValidateAndClose=Validate and close
|
||||
ValidateAndClose=Validate and close
|
||||
Terminals=Terminals
|
||||
TerminalSelect=Select terminal you want to use:
|
||||
@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/core/lib/takepos.lib.php";
|
||||
|
||||
// If socid provided by ajax company selector
|
||||
if (! empty($_REQUEST['CASHDESK_ID_THIRDPARTY_id']))
|
||||
@ -88,6 +89,7 @@ if (GETPOST('action', 'alpha') == 'set')
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_NUMPAD", GETPOST('TAKEPOS_NUMPAD', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_NUM_TERMINALS", GETPOST('TAKEPOS_NUM_TERMINALS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if ($conf->global->TAKEPOS_ORDER_NOTES==1)
|
||||
{
|
||||
@ -122,6 +124,8 @@ llxHeader('', $langs->trans("CashDeskSetup"));
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
|
||||
$head = takepos_prepare_head();
|
||||
dol_fiche_head($head, 'setup', 'TakePOS', -1);
|
||||
print '<br>';
|
||||
|
||||
|
||||
@ -249,6 +253,14 @@ else
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Terminals
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("Terminals");
|
||||
print '<td colspan="2">';
|
||||
$array=array(1=>"1", 2=>"2", 3=>"3", 4=>"4", 5=>"5");
|
||||
print $form->selectarray('TAKEPOS_NUM_TERMINALS', $array, (empty($conf->global->TAKEPOS_NUM_TERMINALS)?'0':$conf->global->TAKEPOS_NUM_TERMINALS), 0);
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
@ -256,7 +268,8 @@ print '<br>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Terminal").' 0</td><td>'.$langs->trans("Value").'</td>';
|
||||
if (!$conf->global->TAKEPOS_NUM_TERMINALS || $conf->global->TAKEPOS_NUM_TERMINALS=="1") print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
else print '<td>'.$langs->trans("Terminal").' 1</td><td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
||||
|
||||
198
htdocs/takepos/admin/terminal.php
Normal file
198
htdocs/takepos/admin/terminal.php
Normal file
@ -0,0 +1,198 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/takepos/admin/setup.php
|
||||
* \ingroup takepos
|
||||
* \brief Setup page for TakePos module
|
||||
*/
|
||||
|
||||
require '../../main.inc.php'; // Load $user and permissions
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/core/lib/takepos.lib.php";
|
||||
|
||||
$terminal=GETPOST('terminal', 'int');
|
||||
// If socid provided by ajax company selector
|
||||
if (! empty($_REQUEST['CASHDESK_ID_THIRDPARTY'.$terminal.'_id']))
|
||||
{
|
||||
$_GET['CASHDESK_ID_THIRDPARTY'.$terminal] = GETPOST('CASHDESK_ID_THIRDPARTY'.$terminal.'_id', 'alpha');
|
||||
$_POST['CASHDESK_ID_THIRDPARTY'.$terminal] = GETPOST('CASHDESK_ID_THIRDPARTY'.$terminal.'_id', 'alpha');
|
||||
$_REQUEST['CASHDESK_ID_THIRDPARTY'.$terminal] = GETPOST('CASHDESK_ID_THIRDPARTY'.$terminal.'_id', 'alpha');
|
||||
}
|
||||
|
||||
// Security check
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$langs->loadLangs(array("admin", "cashdesk"));
|
||||
|
||||
global $db;
|
||||
|
||||
$sql = "SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_paiement";
|
||||
$sql.= " WHERE entity IN (".getEntity('c_paiement').")";
|
||||
$sql.= " AND active = 1";
|
||||
$sql.= " ORDER BY libelle";
|
||||
$resql = $db->query($sql);
|
||||
$paiements = array();
|
||||
if($resql){
|
||||
while ($obj = $db->fetch_object($resql)){
|
||||
array_push($paiements, $obj);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
if (GETPOST('action', 'alpha') == 'set')
|
||||
{
|
||||
$db->begin();
|
||||
if (GETPOST('socid', 'int') < 0) $_POST["socid"]='';
|
||||
|
||||
$res = dolibarr_set_const($db, "CASHDESK_ID_THIRDPARTY".$terminal, (GETPOST('socid', 'int') > 0 ? GETPOST('socid', 'int') : ''), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH".$terminal, (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminal, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminal, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CHEQUE".$terminal, (GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminal, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminal, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CB".$terminal, (GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminal, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminal, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
foreach($paiements as $modep) {
|
||||
if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue;
|
||||
$name="CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminal;
|
||||
$res = dolibarr_set_const($db, $name, (GETPOST($name, 'alpha') > 0 ? GETPOST($name, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
$res = dolibarr_set_const($db, "CASHDESK_ID_WAREHOUSE".$terminal, (GETPOST('CASHDESK_ID_WAREHOUSE'.$terminal, 'alpha') > 0 ? GETPOST('CASHDESK_ID_WAREHOUSE'.$terminal, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK".$terminal, GETPOST('CASHDESK_NO_DECREASE_STOCK'.$terminal, 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha'));
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
$formproduct=new FormProduct($db);
|
||||
|
||||
llxHeader('', $langs->trans("CashDeskSetup"));
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
|
||||
$head = takepos_prepare_head();
|
||||
dol_fiche_head($head, 'terminal'.$terminal, 'TakePOS', -1);
|
||||
print '<br>';
|
||||
|
||||
|
||||
// Mode
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?terminal='.$terminal.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="set">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $form->select_company($conf->global->{'CASHDESK_ID_THIRDPARTY'.$terminal}, 'socid', 's.client in (1, 3) AND s.status = 1', 1, 0, 0, array(), 0);
|
||||
print '</td></tr>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForSell").'</td>';
|
||||
print '<td colspan="2">';
|
||||
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$terminal}, 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminal, 0, "courant=2", 1);
|
||||
print '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCheque").'</td>';
|
||||
print '<td colspan="2">';
|
||||
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminal}, 'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminal, 0, "courant=1", 1);
|
||||
print '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCB").'</td>';
|
||||
print '<td colspan="2">';
|
||||
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminal}, 'CASHDESK_ID_BANKACCOUNT_CB'.$terminal, 0, "courant=1", 1);
|
||||
print '</td></tr>';
|
||||
|
||||
foreach($paiements as $modep) {
|
||||
if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue;
|
||||
$name="CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminal;
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountFor").' '.$langs->trans($modep->libelle).'</td>';
|
||||
print '<td colspan="2">';
|
||||
$cour=preg_match('/^LIQ.*/', $modep->code)?2:1;
|
||||
$form->select_comptes($conf->global->$name, $name, 0, "courant=".$cour, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($conf->stock->enabled))
|
||||
{
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>'; // Force warehouse (this is not a default value)
|
||||
print '<td colspan="2">';
|
||||
if (empty($conf->productbatch->enabled)) {
|
||||
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!$conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}) {
|
||||
$res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK".$terminal, 1, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
print $langs->trans("Yes").'<br>';
|
||||
print '<span class="opacitymedium">'.$langs->trans('StockDecreaseForPointOfSaleDisabledbyBatch').'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
$disabled=$conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal};
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskIdWareHouse").'</td>'; // Force warehouse (this is not a default value)
|
||||
print '<td colspan="2">';
|
||||
if (! $disabled)
|
||||
{
|
||||
print $formproduct->selectWarehouses($conf->global->{'CASHDESK_ID_WAREHOUSE'.$terminal}, 'CASHDESK_ID_WAREHOUSE'.$terminal, '', 1, $disabled);
|
||||
print ' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">('.$langs->trans("Create").')</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<span class="opacitymedium">'.$langs->trans("StockDecreaseForPointOfSaleDisabled").'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
print '<br>';
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -90,7 +90,7 @@ if ($invoiceid > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret = $invoice->fetch('', '(PROV-POS-'.$place.')');
|
||||
$ret = $invoice->fetch('', '(PROV-POS'.$_SESSION["takepostermvar"].'-'.$place.')');
|
||||
}
|
||||
if ($ret > 0)
|
||||
{
|
||||
@ -104,12 +104,12 @@ if ($ret > 0)
|
||||
|
||||
if ($action == 'valid' && $user->rights->facture->creer)
|
||||
{
|
||||
if ($pay == "cash") $bankaccount = $conf->global->CASHDESK_ID_BANKACCOUNT_CASH; // For backward compatibility
|
||||
elseif ($pay == "card") $bankaccount = $conf->global->CASHDESK_ID_BANKACCOUNT_CB; // For backward compatibility
|
||||
elseif ($pay == "cheque") $bankaccount = $conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE; // For backward compatibility
|
||||
if ($pay == "cash") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takepostermvar"]}; // For backward compatibility
|
||||
elseif ($pay == "card") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takepostermvar"]}; // For backward compatibility
|
||||
elseif ($pay == "cheque") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takepostermvar"]}; // For backward compatibility
|
||||
else
|
||||
{
|
||||
$accountname="CASHDESK_ID_BANKACCOUNT_".$pay;
|
||||
$accountname="CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takepostermvar"];
|
||||
$bankaccount=$conf->global->$accountname;
|
||||
}
|
||||
$now=dol_now();
|
||||
@ -137,9 +137,9 @@ if ($action == 'valid' && $user->rights->facture->creer)
|
||||
$invoice->update($user);
|
||||
}
|
||||
|
||||
if (! empty($conf->stock->enabled) && $conf->global->CASHDESK_NO_DECREASE_STOCK != "1")
|
||||
if (! empty($conf->stock->enabled) && $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takepostermvar"]} != "1")
|
||||
{
|
||||
$invoice->validate($user, '', $conf->global->CASHDESK_ID_WAREHOUSE);
|
||||
$invoice->validate($user, '', $conf->global->{'CASHDESK_ID_WAREHOUSE'.$_SESSION["takepostermvar"]});
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -180,13 +180,13 @@ if ($action == 'history')
|
||||
|
||||
if (($action=="addline" || $action=="freezone") && $placeid == 0)
|
||||
{
|
||||
$invoice->socid = $conf->global->CASHDESK_ID_THIRDPARTY;
|
||||
$invoice->socid = $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takepostermvar"]};
|
||||
$invoice->date = dol_now();
|
||||
$invoice->module_source = 'takepos';
|
||||
$invoice->pos_source = (string) $posnb;
|
||||
|
||||
$placeid = $invoice->create($user);
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS-".$place.")' where rowid=".$placeid;
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takepostermvar"]."-".$place.")' where rowid=".$placeid;
|
||||
$db->query($sql);
|
||||
}
|
||||
|
||||
@ -559,11 +559,11 @@ else { // No invoice generated yet
|
||||
|
||||
print '</table>';
|
||||
|
||||
if ($invoice->socid != $conf->global->CASHDESK_ID_THIRDPARTY)
|
||||
if ($invoice->socid != $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takepostermvar"]})
|
||||
{
|
||||
$soc = new Societe($db);
|
||||
if ($invoice->socid > 0) $soc->fetch($invoice->socid);
|
||||
else $soc->fetch($conf->global->CASHDESK_ID_THIRDPARTY);
|
||||
else $soc->fetch($conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takepostermvar"]});
|
||||
print '<p style="font-size:120%;" class="right">';
|
||||
print $langs->trans("Customer").': '.$soc->name;
|
||||
print '</p>';
|
||||
|
||||
@ -51,7 +51,7 @@ if ($invoiceid > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS-".$place.")'";
|
||||
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takepostermvar"]."-".$place.")'";
|
||||
$resql = $db->query($sql);
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj)
|
||||
|
||||
@ -44,7 +44,7 @@ top_httphead('text/html');
|
||||
|
||||
if ($place > 0)
|
||||
{
|
||||
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS-".$place.")'";
|
||||
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takepostermvar"]."-".$place.")'";
|
||||
$resql = $db->query($sql);
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj)
|
||||
|
||||
@ -40,8 +40,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
|
||||
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
|
||||
$posnb = (GETPOST('posnb', 'int') > 0 ? GETPOST('posnb', 'int') : 0); // $posnb is id of POS
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$setterminal = GETPOST('setterminal', 'int');
|
||||
|
||||
if ($setterminal>0)
|
||||
{
|
||||
$_SESSION["takeposterminal"]=$setterminal;
|
||||
if ($setterminal==1) $_SESSION["takepostermvar"]="";
|
||||
else $_SESSION["takepostermvar"]=$setterminal;
|
||||
}
|
||||
|
||||
$langs->loadLangs(array("bills","orders","commercial","cashdesk","receiptprinter"));
|
||||
|
||||
@ -538,15 +545,47 @@ function MoreActions(totalactions){
|
||||
}
|
||||
}
|
||||
|
||||
function TerminalsDialog()
|
||||
{
|
||||
jQuery("#dialog-info").dialog({
|
||||
resizable: false,
|
||||
height:200,
|
||||
width:400,
|
||||
modal: true,
|
||||
buttons: {
|
||||
Terminal1: function() {
|
||||
location.href='takepos.php?setterminal=1';
|
||||
}
|
||||
<?php
|
||||
for ($i = 2; $i <= $conf->global->TAKEPOS_NUM_TERMINALS; $i++)
|
||||
{
|
||||
print "
|
||||
,
|
||||
Terminal".$i.": function() {
|
||||
location.href='takepos.php?setterminal=".$i."';
|
||||
}
|
||||
";
|
||||
}
|
||||
?>
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$( document ).ready(function() {
|
||||
PrintCategories(0);
|
||||
LoadProducts(0);
|
||||
Refresh();
|
||||
<?php
|
||||
//IF THERE ARE MORE THAN 1 TERMINAL AND NO SELECTED
|
||||
if ($conf->global->TAKEPOS_NUM_TERMINALS!="1" && $_SESSION["takeposterminal"]=="") print "TerminalsDialog();";
|
||||
?>
|
||||
});
|
||||
</script>
|
||||
|
||||
<body style="overflow: hidden; background-color:#D1D1D1;">
|
||||
|
||||
<?php
|
||||
if ($conf->global->TAKEPOS_NUM_TERMINALS!="1" && $_SESSION["takeposterminal"]=="") print '<div id="dialog-info" title="TakePOS">'.$langs->trans('TerminalSelect').'</div>';
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="row1">
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user