diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index c4a9ebf1b94..42584c5621b 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -227,7 +227,6 @@ if ($action=="change") { $idcustomer = GETPOST('idcustomer', 'int'); $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 $sql="UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$idcustomer." where ref='(PROV-POS-".$place.")'"; $resql = $db->query($sql); diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 7085d904891..66a8a90f528 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -58,7 +58,6 @@ if($resql){ } $terminaltouse = $terminal; -if ($terminaltouse == '1') $terminaltouse = ''; /* diff --git a/htdocs/takepos/floors.php b/htdocs/takepos/floors.php index 9401d61b9a0..a2a0f0bc4c0 100644 --- a/htdocs/takepos/floors.php +++ b/htdocs/takepos/floors.php @@ -43,7 +43,6 @@ $left = GETPOST('left', 'alpha'); $top = GETPOST('top', 'alpha'); $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 $newname = GETPOST('newname', 'alpha'); $mode = GETPOST('mode', 'alpha'); diff --git a/htdocs/takepos/freezone.php b/htdocs/takepos/freezone.php index 64c21a30304..b47d7114528 100644 --- a/htdocs/takepos/freezone.php +++ b/htdocs/takepos/freezone.php @@ -36,7 +36,6 @@ require '../main.inc.php'; // Load $user and permissions $langs->loadLangs(array("bills", "cashdesk")); $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 $idline = GETPOST('idline', 'int'); $action = GETPOST('action', 'alpha'); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 7645ef176c5..510b949b92b 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -43,7 +43,6 @@ $id = GETPOST('id', 'int'); $action = GETPOST('action', 'alpha'); $idproduct = GETPOST('idproduct', 'int'); $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 /** * Abort invoice creationg with a given error message @@ -90,7 +89,7 @@ if ($invoiceid > 0) } else { - $ret = $invoice->fetch('', '(PROV-POS'.$_SESSION["takepostermvar"].'-'.$place.')'); + $ret = $invoice->fetch('', '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')'); } if ($ret > 0) { @@ -104,12 +103,12 @@ if ($ret > 0) if ($action == 'valid' && $user->rights->facture->creer) { - 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 + if ($pay == "cash") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]}; // For backward compatibility + elseif ($pay == "card") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takeposterminal"]}; // For backward compatibility + elseif ($pay == "cheque") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]}; // For backward compatibility else { - $accountname="CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takepostermvar"]; + $accountname="CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"]; $bankaccount=$conf->global->$accountname; } $now=dol_now(); @@ -137,9 +136,9 @@ if ($action == 'valid' && $user->rights->facture->creer) $invoice->update($user); } - if (! empty($conf->stock->enabled) && $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takepostermvar"]} != "1") + if (! empty($conf->stock->enabled) && $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]} != "1") { - $invoice->validate($user, '', $conf->global->{'CASHDESK_ID_WAREHOUSE'.$_SESSION["takepostermvar"]}); + $invoice->validate($user, '', $conf->global->{'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]}); } else { @@ -180,13 +179,13 @@ if ($action == 'history') if (($action=="addline" || $action=="freezone") && $placeid == 0) { - $invoice->socid = $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takepostermvar"]}; + $invoice->socid = $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}; $invoice->date = dol_now(); $invoice->module_source = 'takepos'; - $invoice->pos_source = (string) $posnb; + $invoice->pos_source = $_SESSION["takeposterminal"]; $placeid = $invoice->create($user); - $sql="UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takepostermvar"]."-".$place.")' where rowid=".$placeid; + $sql="UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid=".$placeid; $db->query($sql); } @@ -559,11 +558,11 @@ else { // No invoice generated yet print ''; -if ($invoice->socid != $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takepostermvar"]}) +if ($invoice->socid != $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}) { $soc = new Societe($db); if ($invoice->socid > 0) $soc->fetch($invoice->socid); - else $soc->fetch($conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takepostermvar"]}); + else $soc->fetch($conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}); print '

'; print $langs->trans("Customer").': '.$soc->name; print '

'; diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 74af8f62ae9..37676f1b1e1 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -35,7 +35,6 @@ require '../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.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 $invoiceid = GETPOST('invoiceid', 'int'); @@ -51,7 +50,7 @@ if ($invoiceid > 0) } else { - $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takepostermvar"]."-".$place.")'"; + $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; $resql = $db->query($sql); $obj = $db->fetch_object($resql); if ($obj) diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index c80b3b5b932..5905592607c 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -31,7 +31,6 @@ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $langs->loadLangs(array("main", "cashdesk")); $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 $facid=GETPOST('facid', 'int'); @@ -44,7 +43,7 @@ top_httphead('text/html'); if ($place > 0) { - $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takepostermvar"]."-".$place.")'"; + $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; $resql = $db->query($sql); $obj = $db->fetch_object($resql); if ($obj) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index f5de960223d..9601c6d0f36 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -39,15 +39,12 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; 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"));