Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2020-03-22 20:22:41 +01:00
commit f20e0efe06
9 changed files with 33 additions and 12 deletions

View File

@ -228,7 +228,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
if ($action == "change") // Change customer for TakePOS
{
$idcustomer = GETPOST('idcustomer', 'int');
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
$place = (GETPOST('place', 'alpha') ? GETPOST('place', 'alpha') : 0); // $place is id of table for Ba or Restaurant
// Check if draft invoice already exists, if not create it
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' AND entity IN (".getEntity('invoice').")";
@ -1031,7 +1031,7 @@ while ($i < min($num, $limit))
print '<tr class="oddeven"';
if ($contextpage == 'poslist')
{
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Bar or Restaurant
$place = (GETPOST('place', 'alpha') > 0 ? GETPOST('place', 'alpha') : 0); // $place is id of table for Bar or Restaurant
print ' onclick="location.href=\'list.php?action=change&contextpage=poslist&idcustomer='.$obj->rowid.'&place='.$place.'\'"';
}
print '>';

View File

@ -42,7 +42,7 @@ $action = GETPOST('action', 'alpha');
$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
$place = (GETPOST('place', 'alpha') ? GETPOST('place', 'alpha') : 0); // $place is id of table for Ba or Restaurant
$newname = GETPOST('newname', 'alpha');
$mode = GETPOST('mode', 'alpha');

View File

@ -40,7 +40,7 @@ global $mysoc;
$langs->loadLangs(array("bills", "cashdesk"));
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
$place = (GETPOST('place', 'alpha') > 0 ? GETPOST('place', 'alpha') : 0); // $place is id of table for Ba or Restaurant
$idline = GETPOST('idline', 'int');
$action = GETPOST('action', 'alpha');

View File

@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
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 Bar or Restaurant
$place = (GETPOST('place', 'alpha') ? GETPOST('place', 'alpha') : 0); // $place is id of table for Bar or Restaurant or multiple sales
$action = GETPOST('action', 'alpha');
$setterminal = GETPOST('setterminal', 'int');
@ -732,7 +732,9 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
echo '<span class="hideonsmartphone"> - '.dol_print_date(dol_now(), "day").'</span>';
?>
</a></div>
<div class="inline-block valignmiddle"><a class="valignmiddle" id="customer" onclick="Customer();"></a></div>
<div class="inline-block valignmiddle" id="customerandsales">
<a class="valignmiddle" id="customer" onclick="Customer();"></a>
</div>
<div class="inline-block valignmiddle" id="moreinfo"></div>
<div class="inline-block valignmiddle" id="infowarehouse"></div>
</div>

View File

@ -44,7 +44,7 @@ $langs->loadLangs(array("companies", "commercial", "bills", "cashdesk", "stocks"
$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 Bar or Restaurant
$place = (GETPOST('place', 'alpha') ? GETPOST('place', 'alpha') : 0); // $place is id of table for Bar or Restaurant
$placeid = 0; // $placeid is ID of invoice
if (empty($user->rights->takepos->run)) {
@ -713,9 +713,28 @@ $( document ).ready(function() {
}
?>
$("a#customer").html('<?php print dol_escape_js($s); ?>');
$("#customerandsales").html('<a class="valignmiddle" id="customer" onclick="Customer();"><?php print dol_escape_js($s); ?></a>');
<?php
$sql = "SELECT rowid, datec, ref FROM ".MAIN_DB_PREFIX."facture where ref LIKE '(PROV-POS".$_SESSION["takeposterminal"]."-0%'";
$resql = $db->query($sql);
if ($resql) {
while ($obj = $db->fetch_object($resql)) {
echo '$("#customerandsales").append(\'';
if ($placeid==$obj->rowid) echo "<b>";
echo '<a class="valignmiddle" onclick="location.href=\\\'index.php?place=';
$num_sale=str_replace(")", "", str_replace("(PROV-POS".$_SESSION["takeposterminal"]."-", "", $obj->ref));
echo $num_sale;
if (str_replace("-", "", $num_sale)>$max_sale) $max_sale=str_replace("-", "", $num_sale);
echo '\\\'">'.date('H:i', strtotime($obj->datec));
if ($placeid==$obj->rowid) echo "</b>";
echo '</a>\');';
}
echo '$("#customerandsales").append(\'<a onclick="location.href=\\\'index.php?place=0-';
echo $max_sale+1;
echo '\\\'"><span class="fa fa-plus-square"></a>\');';
}
$s = '';
$constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"];

View File

@ -34,7 +34,7 @@ if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
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
$place = (GETPOST('place', 'alpha') ? GETPOST('place', 'alpha') : 0); // $place is id of table for Ba or Restaurant
$invoiceid = GETPOST('invoiceid', 'int');

View File

@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
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
$place = (GETPOST('place', 'alpha') ? GETPOST('place', 'alpha') : 0); // $place is id of table for Ba or Restaurant
$action = GETPOST('action', 'alpha');
$setterminal = GETPOST('setterminal', 'int');

View File

@ -30,7 +30,7 @@ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$langs->loadLangs(array("main", "cashdesk", "companies"));
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
$place = (GETPOST('place', 'alpha') ? GETPOST('place', 'alpha') : 0); // $place is id of table for Ba or Restaurant
$facid = GETPOST('facid', 'int');

View File

@ -34,7 +34,7 @@ if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
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
$place = (GETPOST('place', 'alpha') ? GETPOST('place', 'alpha') : 0); // $place is id of table for Ba or Restaurant
$invoiceid = GETPOST('invoiceid', 'int');