Merge branch 'develop' into fix-smtps-FORCE-SENDTO

This commit is contained in:
Tim Otte 2020-08-14 11:52:20 +02:00 committed by GitHub
commit 4e1a66916e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 304 additions and 206 deletions

View File

@ -14,7 +14,7 @@ Architecture: all
Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5 | libapache2-mod-php | libapache2-mod-phpfilter | php-cgi | php-fpm | php,
php5-cli | php-cli,
# Required PHP extensions
php5-mysql | php5-mysqli | php-mysql | php-mysqli, php5-curl | php-curl, php5-gd | php-gd, php5-ldap | php-gd,
php5-mysql | php5-mysqli | php-mysql | php-mysqli, php5-curl | php-curl, php5-gd | php-gd, php5-ldap | php-gd, php5-zip | php-zip,
# Required PHP libraries
php-pear, php-mail-mime,
# php-tcpdf,

View File

@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/dolistore.class.php';
// Load translation files required by the page
$langs->loadLangs(array("errors", "admin", "modulebuilder"));
$mode = GETPOSTISSET('mode') ? GETPOST('mode', 'alpha') : 'commonkanban';
$mode = GETPOSTISSET('mode') ? GETPOST('mode', 'alpha') : (empty($conf->global->MAIN_MODULE_SETUP_ON_LIST_BY_DEFAULT) ? 'commonkanban' : 'common');
if (empty($mode)) $mode = 'common';
$action = GETPOST('action', 'alpha');
//var_dump($_POST);exit;

View File

@ -192,10 +192,10 @@ if (empty($reshook))
$error = 0;
// Set if we used free entry or predefined product
$qty = GETPOST('qty', 'int');
$qty = price2num(GETPOST('qty', 'int'));
$qty_frozen = GETPOST('qty_frozen', 'int');
$disable_stock_change = GETPOST('disable_stock_change', 'int');
$efficiency = GETPOST('efficiency', 'int');
$efficiency = price2num(GETPOST('efficiency', 'int'));
if ($qty == '') {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
@ -219,6 +219,8 @@ if (empty($reshook))
unset($_POST['qty']);
unset($_POST['qty_frozen']);
unset($_POST['disable_stock_change']);
$object->fetchLines();
}
}
}
@ -541,7 +543,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (!empty($object->table_element_line))
{
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '').'" method="POST">
<input type="hidden" name="token" value="' . newToken().'">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
<input type="hidden" name="mode" value="">

View File

@ -113,7 +113,7 @@ if ($conf->global->PRODUCT_USE_UNITS)
{
$coldisplay++;
print '<td class="nobottom linecoluseunit left">';
print $form->selectUnits($line->fk_unit, "units");
print $form->selectUnits(empty($line->fk_unit) ? $conf->global->PRODUCT_USE_UNITS : $line->fk_unit, "units");
print '</td>';
}

View File

@ -5,7 +5,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2020 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
@ -545,6 +545,8 @@ if (!$sall)
$sql .= ' f.paye, f.fk_statut, f.close_code,';
$sql .= ' f.datec, f.tms, f.date_closing,';
$sql .= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final, f.situation_cycle_ref, f.situation_counter,';
$sql .= ' f.fk_user_author, f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva,';
$sql .= ' f.multicurrency_total_tva, f.multicurrency_total_ttc,';
$sql .= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,';
$sql .= ' typent.code,';
$sql .= ' state.code_departement, state.nom,';

View File

@ -38,8 +38,6 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
if (!$user->rights->facture->lire) accessforbidden();
// Load translation files required by the page
$langs->loadLangs(array('bills', 'banks', 'withdrawals', 'companies'));
@ -51,7 +49,6 @@ $type = GETPOST('type', 'aZ09');
$fieldid = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid);
if ($type == 'bank-transfer') {
$object = new FactureFournisseur($db);
@ -63,6 +60,7 @@ if ($type == 'bank-transfer') {
if ($id > 0 || !empty($ref))
{
$ret = $object->fetch($id, $ref);
$isdraft = (($object->statut == FactureFournisseur::STATUS_DRAFT) ? 1 : 0);
if ($ret > 0)
{
$object->fetch_thirdparty();
@ -71,6 +69,13 @@ if ($id > 0 || !empty($ref))
$hookmanager->initHooks(array('directdebitcard', 'globalcard'));
if ($type == 'bank-transfer') {
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture', 'fk_soc', $fieldid, $isdraft);
if (!$user->rights->fournisseur->facture->lire) accessforbidden();
} else {
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft);
if (!$user->rights->facture->lire) accessforbidden();
}
/*

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015-2020 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
@ -161,6 +161,14 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
$reshook = $hookmanager->executeHooks('printFieldListWhereCustomerDraft', $parameters);
$sql .= $hookmanager->resPrint;
$sql.= " GROUP BY f.rowid, f.ref, f.datef, f.total, f.tva, f.total_ttc, f.ref_client, f.type, ";
$sql.= "s.email, s.nom, s.rowid, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur";
// Add Group from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListGroupByCustomerDraft', $parameters);
$sql .= $hookmanager->resPrint;
$resql = $db->query($sql);
if ($resql)
@ -458,7 +466,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
$sql .= $hookmanager->resPrint;
$sql .= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.tms, ff.paye,";
$sql .= " s.nom, s.rowid, s.code_fournisseur, s.code_compta_fournisseur";
$sql .= " s.nom, s.rowid, s.code_fournisseur, s.code_compta_fournisseur, s.email";
$sql .= " ORDER BY ff.tms DESC ";
$sql .= $db->plimit($max, 0);

View File

@ -206,7 +206,13 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val)
{
if (!empty($extrafields->attributes[$object->table_element]['list'][$key]))
$arrayfields["ef.".$key] = array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]));
$arrayfields["ef.".$key] = array(
'label'=>$extrafields->attributes[$object->table_element]['label'][$key],
'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1),
'position'=>$extrafields->attributes[$object->table_element]['pos'][$key],
'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]),
'langfile'=>$extrafields->attributes[$object->table_element]['langfile'][$key],
);
}
}
$object->fields = dol_sort_array($object->fields, 'position');

View File

@ -356,7 +356,7 @@ class CMailFile
$smtps->setSubject($subjecttouse);
$smtps->setTO($this->getValidAddress($this->addr_to, 0, 1));
$smtps->setFrom($this->getValidAddress($this->from, 0, 1));
$smtps->setFrom($this->getValidAddress($this->addr_from, 0, 1));
$smtps->setTrackId($this->trackid);
$smtps->setReplyTo($this->getValidAddress($this->replyto, 0, 1));
@ -402,7 +402,7 @@ class CMailFile
$smtps->setDeliveryReceipt($this->deliveryreceipt);
$host = dol_getprefix('email');
$this->msgid = time().'.SMTPs-dolibarr-'.$trackid.'@'.$host;
$this->msgid = time().'.SMTPs-dolibarr-'.$this->trackid.'@'.$host;
$this->smtps = $smtps;
} elseif ($this->sendmode == 'swiftmailer') {
@ -786,14 +786,14 @@ class CMailFile
$from = $this->smtps->getFrom('org');
if ($res && !$from)
{
$this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."<br>Sender address '$from' invalid";
$this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport." - Sender address '$from' invalid";
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
$res = false;
}
$dest = $this->smtps->getTo();
if ($res && !$dest)
{
$this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."<br>Recipient address '$dest' invalid";
$this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport." - Recipient address '$dest' invalid";
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
$res = false;
}
@ -814,7 +814,7 @@ class CMailFile
$res = true;
} else {
if (empty($this->error)) $this->error = $result;
dol_syslog("CMailFile::sendfile: mail end error with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."<br>".$this->error, LOG_ERR);
dol_syslog("CMailFile::sendfile: mail end error with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport." - ".$this->error, LOG_ERR);
$res = false;
}
}

View File

@ -5830,7 +5830,7 @@ class Form
$urlforajaxcall = DOL_URL_ROOT.'/core/ajax/selectobject.php';
// No immediate load of all database
$urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter).($moreparams ? $moreparams : '');
$urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter);
// Activate the auto complete using ajax call.
$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array());
$out .= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
@ -6496,7 +6496,7 @@ class Form
*/
public static function multiSelectArrayWithCheckbox($htmlname, &$array, $varpage)
{
global $conf, $langs, $user;
global $conf, $langs, $user, $extrafields;
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) return '';
@ -6528,6 +6528,10 @@ class Form
}
if ($val['label'])
{
if (! empty($val['langfile']) && is_object($langs)) {
$langs->load($val['langfile']);
}
$lis .= '<li><input type="checkbox" id="checkbox'.$key.'" value="'.$key.'"'.(empty($val['checked']) ? '' : ' checked="checked"').'/><label for="checkbox'.$key.'">'.dol_escape_htmltag($langs->trans($val['label'])).'</label></li>';
$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
}

View File

@ -25,25 +25,26 @@
/**
* Generic function that return javascript to add to a page to transform a common input field into an autocomplete field by calling an Ajax page (ex: /societe/ajaxcompanies.php).
* The HTML field must be an input text with id=search_$htmlname.
* This use the jQuery "autocomplete" function. If we want to use the select2, we must also convert the input into select on funcntions that call this method.
* Generic function that return javascript to add to a page to transform a common input field into an autocomplete field by calling an Ajax page (ex: /societe/ajaxcompanies.php).
* The HTML field must be an input text with id=search_$htmlname.
* This use the jQuery "autocomplete" function. If we want to use the select2, we must also convert the input into select on funcntions that call this method.
*
* @param string $selected Preselected value
* @param string $htmlname HTML name of input field
* @param string $url Ajax Url to call for request: /path/page.php. Must return a json array ('key'=>id, 'value'=>String shown into input field once selected, 'label'=>String shown into combo list)
* @param string $urloption More parameters on URL request
* @param int $minLength Minimum number of chars to trigger that Ajax search
* @param int $autoselect Automatic selection if just one value
* @param array $ajaxoptions Multiple options array
* @param string $selected Preselected value
* @param string $htmlname HTML name of input field
* @param string $url Ajax Url to call for request: /path/page.php. Must return a json array ('key'=>id, 'value'=>String shown into input field once selected, 'label'=>String shown into combo list)
* @param string $urloption More parameters on URL request
* @param int $minLength Minimum number of chars to trigger that Ajax search
* @param int $autoselect Automatic selection if just one value
* @param array $ajaxoptions Multiple options array
* - Ex: array('update'=>array('field1','field2'...)) will reset field1 and field2 once select done
* - Ex: array('disabled'=> )
* - Ex: array('show'=> )
* - Ex: array('update_textarea'=> )
* - Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax)
* @return string Script
* @param string $moreparams More params provided to ajax call
* @return string Script
*/
function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLength = 2, $autoselect = 0, $ajaxoptions = array())
function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLength = 2, $autoselect = 0, $ajaxoptions = array(), $moreparams = '')
{
if (empty($minLength)) $minLength = 1;
@ -55,7 +56,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
// Input search_htmlname is original field
// Input htmlname is a second input field used when using ajax autocomplete.
$script = '<input type="hidden" name="'.$htmlname.'" id="'.$htmlname.'" value="'.$selected.'" />';
$script = '<input type="hidden" name="'.$htmlname.'" id="'.$htmlname.'" value="'.$selected.'" '.($moreparams ? $moreparams : '').' />';
$script .= '<!-- Javascript code for autocomplete of field '.$htmlname.' -->'."\n";
$script .= '<script>'."\n";

View File

@ -3850,7 +3850,7 @@ function dol_print_error($db = '', $error = '', $errors = null)
{
$out .= "<b>".$langs->trans("OS").":</b> ".php_uname()."<br>\n";
}
$out .= "<b>".$langs->trans("UserAgent").":</b> ".$_SERVER["HTTP_USER_AGENT"]."<br>\n";
$out .= "<b>".$langs->trans("UserAgent").":</b> ".dol_htmlentities($_SERVER["HTTP_USER_AGENT"], ENT_COMPAT, 'UTF-8')."<br>\n";
$out .= "<br>\n";
$out .= "<b>".$langs->trans("RequestedUrl").":</b> ".dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT, 'UTF-8')."<br>\n";
$out .= "<b>".$langs->trans("Referer").":</b> ".(isset($_SERVER["HTTP_REFERER"]) ?dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT, 'UTF-8') : '')."<br>\n";

View File

@ -48,13 +48,10 @@ function takepos_prepare_head()
$head[$h][2] = 'receipt';
$h++;
if ($conf->global->TAKEPOS_BAR_RESTAURANT)
{
$head[$h][0] = DOL_URL_ROOT.'/takepos/admin/bar.php';
$head[$h][1] = $langs->trans("BarRestaurant");
$head[$h][2] = 'bar';
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/takepos/admin/bar.php';
$head[$h][1] = $langs->trans("BarRestaurant");
$head[$h][2] = 'bar';
$h++;
$numterminals = max(1, $conf->global->TAKEPOS_NUM_TERMINALS);
for ($i = 1; $i <= $numterminals; $i++)

View File

@ -1740,7 +1740,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
if (empty($conf->global->PROJECT_HIDE_TASKS))
{
// Project affected to user
$newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->rights->projet->lire);
$newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->rights->projet->lire, '', 'project', 'tasks');
$newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
$newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->rights->projet->lire);
$newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire);

View File

@ -362,7 +362,7 @@ if ($nolinesbefore) {
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
$coldisplay++;
print '<td class="nobottom linecoluseunit left">';
print $form->selectUnits($line->fk_unit, "units");
print $form->selectUnits(empty($line->fk_unit) ? $conf->global->PRODUCT_USE_UNITS : $line->fk_unit, "units");
print '</td>';
}
$remise_percent = $buyer->remise_percent;
@ -423,6 +423,27 @@ if ((!empty($conf->service->enabled) || ($object->element == 'contrat')) && $dat
print '<td colspan="'.($coldisplay - (empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? 0 : 1)).'">';
$date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
$date_end = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
$prefillDates = false;
if(! empty($conf->global->MAIN_FILL_SERVICE_DATES_FROM_LAST_SERVICE_LINE) && ! empty($object->lines))
{
for($i = count($object->lines) - 1; $i >= 0; $i--)
{
$lastline = $object->lines[$i];
if($lastline->product_type == Product::TYPE_SERVICE && (! empty($lastline->date_start) || ! empty($lastline->date_end)))
{
$date_start_prefill = $lastline->date_start;
$date_end_prefill = $lastline->date_end;
$prefillDates = true;
break;
}
}
}
if (!empty($object->element) && $object->element == 'contrat')
{
print $langs->trans("DateStartPlanned").' ';
@ -435,7 +456,33 @@ if ((!empty($conf->service->enabled) || ($object->element == 'contrat')) && $dat
print ' '.$langs->trans('to').' ';
print $form->selectDate($date_end, 'date_end', empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 0 : 1, 1, "addproduct", 1, 0);
};
if($prefillDates)
{
echo ' <span class="small"><a href="#" id="prefill_service_dates">' . $langs->trans('FillWithLastServiceDates') . '</a></span>';
}
print '<script>';
if($prefillDates)
{
?>
function prefill_service_dates()
{
$('#date_start').val("<?php echo dol_escape_js(dol_print_date($date_start_prefill, '%d/%m/%Y')); ?>").trigger('change');
$('#date_end').val("<?php echo dol_escape_js(dol_print_date($date_end_prefill, '%d/%m/%Y')); ?>").trigger('change');
return false; // Prevent default link behaviour (which is go to href URL)
}
$(document).ready(function()
{
$('#prefill_service_dates').click(prefill_service_dates);
});
<?php
}
if (!$date_start) {
if (isset($conf->global->MAIN_DEFAULT_DATE_START_HOUR)) {
print 'jQuery("#date_starthour").val("'.$conf->global->MAIN_DEFAULT_DATE_START_HOUR.'");';

View File

@ -1299,7 +1299,7 @@ if ((empty($id) && empty($ref)) || $action == 'add' || $action == 'request' || $
print '</tr>';
}
// Validator
// Approver
if (!$edit && $action != 'editvalidator') {
print '<tr>';
print '<td class="titlefield">';
@ -1310,7 +1310,7 @@ if ((empty($id) && empty($ref)) || $action == 'add' || $action == 'request' || $
$include_users = $object->fetch_users_approver_holiday();
if (is_array($include_users) && in_array($user->id, $include_users) && $object->statut == Holiday::STATUS_VALIDATED)
{
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editvalidator">'.img_edit($langs->trans("Edit")).'</a>';
print '<a class="editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editvalidator">'.img_edit($langs->trans("Edit")).'</a>';
}
print '</td>';
print '</tr>';

View File

@ -219,3 +219,10 @@ create table llx_c_recruitment_origin
label varchar(64) NOT NULL,
active tinyint DEFAULT 1 NOT NULL
)ENGINE=innodb;
ALTER TABLE llx_product MODIFY COLUMN seuil_stock_alerte float;
ALTER TABLE llx_product MODIFY COLUMN desiredstock float;
ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN seuil_stock_alerte float;
ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN desiredstock float;

View File

@ -60,7 +60,7 @@ create table llx_product
tobatch tinyint DEFAULT 0 NOT NULL, -- Is it a product that need a batch management (eat-by or lot management)
fk_product_type integer DEFAULT 0, -- Type of product: 0 for regular product, 1 for service, 9 for other (used by external module)
duration varchar(6),
seuil_stock_alerte integer DEFAULT NULL,
seuil_stock_alerte float DEFAULT NULL,
url varchar(255),
barcode varchar(180) DEFAULT NULL, -- barcode
fk_barcode_type integer DEFAULT NULL, -- barcode type
@ -96,7 +96,7 @@ create table llx_product
import_key varchar(14), -- Import key
model_pdf varchar(255), -- model save dodument used
fk_price_expression integer, -- Link to the rule for dynamic price calculation
desiredstock integer DEFAULT 0,
desiredstock float DEFAULT 0,
fk_unit integer DEFAULT NULL,
price_autogen tinyint DEFAULT 0,
fk_project integer DEFAULT NULL -- Used when product was generated by a project or is specifif to a project

View File

@ -24,8 +24,8 @@ create table llx_product_warehouse_properties
tms timestamp,
fk_product integer NOT NULL,
fk_entrepot integer NOT NULL,
seuil_stock_alerte integer DEFAULT '0',
desiredstock integer DEFAULT '0',
seuil_stock_alerte float DEFAULT '0',
desiredstock float DEFAULT '0',
import_key varchar(14) -- Import key
)ENGINE=innodb;

View File

@ -77,7 +77,7 @@ POSModule=POS Module
BasicPhoneLayout=Use basic layout for phones
SetupOfTerminalNotComplete=Setup of terminal %s is not complete
DirectPayment=Direct payment
DirectPaymentButton=Direct cash payment button
DirectPaymentButton=Add a "Direct cash payment" button
InvoiceIsAlreadyValidated=Invoice is already validated
NoLinesToBill=No lines to bill
CustomReceipt=Custom Receipt
@ -94,12 +94,12 @@ TakeposConnectorMethodDescription=External module with extra features. Posibilit
PrintMethod=Print method
ReceiptPrinterMethodDescription=Powerful method with a lot of parameters. Full customizable with templates. Cannot print from the cloud.
ByTerminal=By terminal
TakeposNumpadUsePaymentIcon=Use payment icon on numpad
TakeposNumpadUsePaymentIcon=Use icon instead of text on payment buttons of numpad
CashDeskRefNumberingModules=Numbering module for POS sales
CashDeskGenericMaskCodes6 = <br><b>{TN}</b> tag is used to add the terminal number
TakeposGroupSameProduct=Group same products lines
StartAParallelSale=Start a new parallel sale
ControlCashOpening=Control cash box at opening pos
ControlCashOpening=Control cash box at opening POS
CloseCashFence=Close cash fence
CashReport=Cash report
MainPrinterToUse=Main printer to use
@ -117,6 +117,6 @@ HideCategoryImages=Hide Category Images
HideProductImages=Hide Product Images
NumberOfLinesToShow=Number of lines of images to show
DefineTablePlan=Define tables plan
GiftReceiptButton=Gift receipt button
GiftReceiptButton=Add a "Gift receipt" button
GiftReceipt=Gift receipt
ModuleReceiptPrinterMustBeEnabled=Module Receipt printer must have been enabled first

View File

@ -355,8 +355,8 @@ PriceUTTC=U.P. (inc. tax)
Amount=Amount
AmountInvoice=Invoice amount
AmountInvoiced=Amount invoiced
AmountInvoicedHT=Amount invoiced (incl. tax)
AmountInvoicedTTC=Amount invoiced (excl. tax)
AmountInvoicedHT=Amount invoiced (excl. tax)
AmountInvoicedTTC=Amount invoiced (inc. tax)
AmountPayment=Payment amount
AmountHTShort=Amount (excl.)
AmountTTCShort=Amount (inc. tax)

View File

@ -104,6 +104,7 @@ SetDefaultBarcodeType=Set barcode type
BarcodeValue=Barcode value
NoteNotVisibleOnBill=Note (not visible on invoices, proposals...)
ServiceLimitedDuration=If product is a service with limited duration:
FillWithLastServiceDates=Fill with last service line dates
MultiPricesAbility=Multiple price segments per product/service (each customer is in one price segment)
MultiPricesNumPrices=Number of prices
DefaultPriceType=Base of prices per default (with versus without tax) when adding new sale prices

View File

@ -355,8 +355,8 @@ PriceUTTC=P.U TTC
Amount=Montant
AmountInvoice=Montant facture
AmountInvoiced=Montant facturé
AmountInvoicedHT=Montant facturé (TTC)
AmountInvoicedTTC=Montant facturé (HT)
AmountInvoicedHT=Montant facturé (HT)
AmountInvoicedTTC=Montant facturé (TTC)
AmountPayment=Montant paiement
AmountHTShort=Montant HT
AmountTTCShort=Montant TTC

View File

@ -147,7 +147,8 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count
'label'=>$extrafields->attributes[$object->table_element]['label'][$key],
'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1),
'position'=>$extrafields->attributes[$object->table_element]['pos'][$key],
'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key])
'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]),
'langfile'=>$extrafields->attributes[$object->table_element]['langfile'][$key]
);
}
}

View File

@ -1107,7 +1107,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
{
print '<tr><td>'.$langs->trans('DefaultUnitToShow').'</td>';
print '<td colspan="3">';
print $form->selectUnits('', 'units');
print $form->selectUnits(empty($line->fk_unit) ? $conf->global->PRODUCT_USE_UNITS : $line->fk_unit, 'units');
print '</td></tr>';
}

View File

@ -205,7 +205,7 @@ class Product extends CommonObject
/**
* Stock alert
*
* @var int
* @var float
*/
public $seuil_stock_alerte = 0;
@ -995,7 +995,7 @@ class Product extends CommonObject
$sql .= ", volume = ".($this->volume != '' ? "'".$this->db->escape($this->volume)."'" : 'null');
$sql .= ", volume_units = ".($this->volume_units != '' ? "'".$this->db->escape($this->volume_units)."'" : 'null');
$sql .= ", fk_default_warehouse = ".($this->fk_default_warehouse > 0 ? $this->db->escape($this->fk_default_warehouse) : 'null');
$sql .= ", seuil_stock_alerte = ".((isset($this->seuil_stock_alerte) && is_numeric($this->seuil_stock_alerte)) ? (int) $this->seuil_stock_alerte : 'null');
$sql .= ", seuil_stock_alerte = ".((isset($this->seuil_stock_alerte) && is_numeric($this->seuil_stock_alerte)) ? (float) $this->seuil_stock_alerte : 'null');
$sql .= ", description = '".$this->db->escape($this->description)."'";
$sql .= ", url = ".($this->url ? "'".$this->db->escape($this->url)."'" : 'null');
$sql .= ", customcode = '".$this->db->escape($this->customcode)."'";
@ -1008,7 +1008,7 @@ class Product extends CommonObject
$sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'";
$sql .= ", accountancy_code_sell_intra= '".$this->db->escape($this->accountancy_code_sell_intra)."'";
$sql .= ", accountancy_code_sell_export= '".$this->db->escape($this->accountancy_code_sell_export)."'";
$sql .= ", desiredstock = ".((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? (int) $this->desiredstock : "null");
$sql .= ", desiredstock = ".((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? (float) $this->desiredstock : "null");
$sql .= ", cost_price = ".($this->cost_price != '' ? $this->db->escape($this->cost_price) : 'null');
$sql .= ", fk_unit= ".(!$this->fk_unit ? 'NULL' : (int) $this->fk_unit);
$sql .= ", price_autogen = ".(!$this->price_autogen ? 0 : 1);

View File

@ -66,7 +66,7 @@ if ($id > 0 || !empty($ref))
if ($cancel) $action = '';
// Action association d'un sousproduit
// Add subproduct to product
if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->service->creer))
{
$error = 0;

View File

@ -101,7 +101,9 @@ $search_all = trim(GETPOST("search_all", 'alpha'));
$search = array();
foreach ($object->fields as $key => $val)
{
if (GETPOST('search_'.$key, 'alpha') !== '') $search[$key] = GETPOST('search_'.$key, 'alpha');
$search_key = $key;
if ($search_key == 'statut') $search_key = 'status'; // remove this after refactor entrepot.class property statut to status
if (GETPOST('search_'.$search_key, 'alpha') !== '') $search[$search_key] = GETPOST('search_'.$search_key, 'alpha');
}
// Definition of fields for list
@ -225,13 +227,15 @@ if (!empty($conf->categorie->enabled))
}
foreach ($search as $key => $val)
{
$class_key = $key;
if ($class_key == 'status') $class_key = 'statut'; // remove this after refactor entrepot.class property statut to status
if (($key == 'status' && $search[$key] == -1) || $key=='entity') continue;
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
if (strpos($object->fields[$key]['type'], 'integer:') === 0) {
if ($search[$key] == '-1') $search[$key] = '';
$mode_search = 2;
}
if ($search[$key] != '') $sql .= natural_search((($key == 'ref') ? 't.ref' : 't.' . $key), $search[$key], (($key == 'status') ? 2 : $mode_search));
if ($search[$key] != '') $sql .= natural_search((($key == 'ref') ? 't.ref' : 't.' . $class_key), $search[$key], (($key == 'status') ? 2 : $mode_search));
}
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
// Add where from extra fields

View File

@ -61,7 +61,7 @@ $search_agenda_label = GETPOST('search_agenda_label');
$id = GETPOST("id", 'int');
$socid = 0;
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $id, '');
$result = restrictedArea($user, 'projet', $id, 'projet&project');
if (!$user->rights->projet->lire) accessforbidden();

View File

@ -34,7 +34,8 @@ if (!$user->admin) accessforbidden();
$langs->loadLangs(array("admin", "cashdesk", "printing"));
global $db;
$res = 0;
/*
* Actions
@ -44,9 +45,15 @@ if (GETPOST('action', 'alpha') == 'set')
{
$db->begin();
dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha'));
dol_syslog("admin/bar");
if (!$res > 0) $error++;
$suplement_category = GETPOST('TAKEPOS_SUPPLEMENTS_CATEGORY', 'alpha');
if ($suplement_category < 0) $suplement_category= 0;
$res = dolibarr_set_const($db, "TAKEPOS_SUPPLEMENTS_CATEGORY", $suplement_category, 'chaine', 0, '', $conf->entity);
if ($res <= 0) {
$error++;
}
if (!$error)
{
@ -74,7 +81,6 @@ $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackT
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
$head = takepos_prepare_head();
dol_fiche_head($head, 'bar', 'TakePOS', -1, 'cash-register');
print '<br>';
// Mode
@ -93,129 +99,138 @@ function Floors() {
<?php
print '<a href="" onclick="Floors(); return false;"><span class="fa fa-glass-cheers"></span> '.$langs->trans("DefineTablePlan").'</a><br>';
print '<br><br>';
print '<div class="div-table-responsive">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td class="titlefieldcreate">'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOS_PRINT_METHOD != "browser") {
print '<tr class="oddeven value"><td>';
print $langs->trans("OrderPrinters").' (<a href="'.DOL_URL_ROOT.'/takepos/admin/orderprinters.php?leftmenu=setup">'.$langs->trans("Setup").'</a>)';
print '</td>';
print '<td>';
print ajax_constantonoff("TAKEPOS_ORDER_PRINTERS", array(), $conf->entity, 0, 0, 1, 0);
//print $form->selectyesno("TAKEPOS_ORDER_PRINTERS", $conf->global->TAKEPOS_ORDER_PRINTERS, 1);
print '</td></tr>';
print '<tr class="oddeven value"><td>';
print $langs->trans("OrderNotes");
print '</td>';
print '<td>';
print ajax_constantonoff("TAKEPOS_ORDER_NOTES", array(), $conf->entity, 0, 0, 1, 0);
//print $form->selectyesno("TAKEPOS_ORDER_NOTES", $conf->global->TAKEPOS_ORDER_NOTES, 1);
print '</td></tr>';
}
print '<tr class="oddeven value"><td>';
print $langs->trans("BasicPhoneLayout");
print '</td>';
print '<td>';
//print $form->selectyesno("TAKEPOS_PHONE_BASIC_LAYOUT", $conf->global->TAKEPOS_PHONE_BASIC_LAYOUT, 1);
print ajax_constantonoff("TAKEPOS_PHONE_BASIC_LAYOUT", array(), $conf->entity, 0, 0, 1, 0);
print '</td></tr>';
print '<tr class="oddeven value"><td>';
print $langs->trans("ProductSupplements");
print '</td>';
print '<td>';
//print $form->selectyesno("TAKEPOS_SUPPLEMENTS", $conf->global->TAKEPOS_SUPPLEMENTS, 1);
print ajax_constantonoff("TAKEPOS_SUPPLEMENTS", array(), $conf->entity, 0, 0, 1, 0);
print '</td></tr>';
if ($conf->global->TAKEPOS_SUPPLEMENTS)
{
print '<tr class="oddeven"><td>';
print $langs->trans("SupplementCategory");
print '</td>';
print '<td>';
print $form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_SUPPLEMENTS_CATEGORY, 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0);
print ajax_combobox('TAKEPOS_SUPPLEMENTS_CATEGORY');
print "</td></tr>\n";
}
print '<tr class="oddeven value"><td>';
print 'QR - '.$langs->trans("CustomerMenu");
print '</td>';
print '<td>';
print ajax_constantonoff("TAKEPOS_QR_MENU", array(), $conf->entity, 0, 0, 1, 0);
print '</td></tr>';
print '<tr class="oddeven value"><td>';
print 'QR - '.$langs->trans("AutoOrder");
print '</td>';
print '<td>';
print ajax_constantonoff("TAKEPOS_AUTO_ORDER", array(), $conf->entity, 0, 0, 1, 0);
print '</td></tr>';
print '</table>';
if ($conf->global->TAKEPOS_QR_MENU)
{
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
print '<br>';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("URL").'</td><td class="right">'.$langs->trans("QR").'</td>';
print "</tr>\n";
print '<tr class="oddeven value"><td>';
print "<a target='_blank' href='".$urlwithroot."/takepos/public/menu.php'>".$urlwithroot."/takepos/public/menu.php</a>";
print '</td>';
print '<td class="right">';
print "<a target='_blank' href='printqr.php'><img src='".DOL_URL_ROOT."/takepos/genimg/qr.php' height='42' width='42'></a>";
print '</td></tr>';
print '</table>';
}
if ($conf->global->TAKEPOS_AUTO_ORDER)
{
print '<br>';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Table").'</td><td>'.$langs->trans("URL").'</td><td class="right">'.$langs->trans("QR").'</td>';
print "</tr>\n";
//global $dolibarr_main_url_root;
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
$sql = "SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX."takepos_floor_tables";
$resql = $db->query($sql);
$rows = array();
while ($row = $db->fetch_array($resql)) {
print '<tr class="oddeven value"><td>';
print $langs->trans("Table")." ".$row['label'];
print '</td>';
print '<td>';
print "<a target='_blank' href='".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid'])."'>".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid'])."</a>";
print '</td>';
print '<td class="right">';
print "<a target='_blank' href='printqr.php?id=".$row['rowid']."'><img src='".DOL_URL_ROOT."/takepos/genimg/qr.php?key=".dol_encode($row['rowid'])."' height='42' width='42'></a>";
print '</td></tr>';
}
print '</table>';
}
print '</div>';
print $langs->trans("EnableBarOrRestaurantFeatures");
print ajax_constantonoff("TAKEPOS_BAR_RESTAURANT", array(), $conf->entity, 0, 0, 1, 0);
print '<br>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
print '<br>';
print '<a href="" onclick="Floors(); return false;"><span class="fa fa-glass-cheers"></span> '.$langs->trans("DefineTablePlan").'</a><br>';
print '<br><br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td class="titlefieldcreate">'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
if ($conf->global->TAKEPOS_PRINT_METHOD != "browser") {
print '<tr class="oddeven value"><td>';
print $langs->trans("OrderPrinters").' (<a href="'.DOL_URL_ROOT.'/takepos/admin/orderprinters.php?leftmenu=setup">'.$langs->trans("Setup").'</a>)';
print '</td>';
print '<td>';
print ajax_constantonoff("TAKEPOS_ORDER_PRINTERS", array(), $conf->entity, 0, 0, 1, 0);
//print $form->selectyesno("TAKEPOS_ORDER_PRINTERS", $conf->global->TAKEPOS_ORDER_PRINTERS, 1);
print '</td></tr>';
print '<tr class="oddeven value"><td>';
print $langs->trans("OrderNotes");
print '</td>';
print '<td>';
print ajax_constantonoff("TAKEPOS_ORDER_NOTES", array(), $conf->entity, 0, 0, 1, 0);
//print $form->selectyesno("TAKEPOS_ORDER_NOTES", $conf->global->TAKEPOS_ORDER_NOTES, 1);
print '</td></tr>';
}
print '<tr class="oddeven value"><td>';
print $langs->trans("BasicPhoneLayout");
print '</td>';
print '<td>';
//print $form->selectyesno("TAKEPOS_PHONE_BASIC_LAYOUT", $conf->global->TAKEPOS_PHONE_BASIC_LAYOUT, 1);
print ajax_constantonoff("TAKEPOS_PHONE_BASIC_LAYOUT", array(), $conf->entity, 0, 0, 1, 0);
print '</td></tr>';
print '<tr class="oddeven value"><td>';
print $langs->trans("ProductSupplements");
print '</td>';
print '<td>';
//print $form->selectyesno("TAKEPOS_SUPPLEMENTS", $conf->global->TAKEPOS_SUPPLEMENTS, 1);
print ajax_constantonoff("TAKEPOS_SUPPLEMENTS", array(), $conf->entity, 0, 0, 1, 0);
print '</td></tr>';
if ($conf->global->TAKEPOS_SUPPLEMENTS)
{
print '<tr class="oddeven"><td>';
print $langs->trans("SupplementCategory");
print '</td>';
print '<td>';
print $form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_SUPPLEMENTS_CATEGORY, 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0);
print ajax_combobox('TAKEPOS_SUPPLEMENTS_CATEGORY');
print "</td></tr>\n";
}
print '<tr class="oddeven value"><td>';
print 'QR - '.$langs->trans("CustomerMenu");
print '</td>';
print '<td>';
print ajax_constantonoff("TAKEPOS_QR_MENU", array(), $conf->entity, 0, 0, 1, 0);
print '</td></tr>';
print '<tr class="oddeven value"><td>';
print 'QR - '.$langs->trans("AutoOrder");
print '</td>';
print '<td>';
print ajax_constantonoff("TAKEPOS_AUTO_ORDER", array(), $conf->entity, 0, 0, 1, 0);
print '</td></tr>';
print '</table>';
print '</div>';
print '<br>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
}
if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
if ($conf->global->TAKEPOS_QR_MENU)
{
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
print '<br>';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("URL").'</td><td class="right">'.$langs->trans("QR").'</td>';
print "</tr>\n";
print '<tr class="oddeven value"><td>';
print "<a target='_blank' href='".$urlwithroot."/takepos/public/menu.php'>".$urlwithroot."/takepos/public/menu.php</a>";
print '</td>';
print '<td class="right">';
print "<a target='_blank' href='printqr.php'><img src='".DOL_URL_ROOT."/takepos/genimg/qr.php' height='42' width='42'></a>";
print '</td></tr>';
print '</table>';
}
if ($conf->global->TAKEPOS_AUTO_ORDER)
{
print '<br>';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Table").'</td><td>'.$langs->trans("URL").'</td><td class="right">'.$langs->trans("QR").'</td>';
print "</tr>\n";
//global $dolibarr_main_url_root;
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
$sql = "SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX."takepos_floor_tables";
$resql = $db->query($sql);
$rows = array();
while ($row = $db->fetch_array($resql)) {
print '<tr class="oddeven value"><td>';
print $langs->trans("Table")." ".$row['label'];
print '</td>';
print '<td>';
print "<a target='_blank' href='".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid'])."'>".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid'])."</a>";
print '</td>';
print '<td class="right">';
print "<a target='_blank' href='printqr.php?id=".$row['rowid']."'><img src='".DOL_URL_ROOT."/takepos/genimg/qr.php?key=".dol_encode($row['rowid'])."' height='42' width='42'></a>";
print '</td></tr>';
}
print '</table>';
}
}
print "</form>\n";

View File

@ -87,6 +87,7 @@ print '<input type="hidden" name="action" value="set">';
print load_fiche_titre($langs->trans("PrintMethod"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td><td>'.$langs->trans("Description").'</td><td class="right">'.$langs->trans("Status").'</td>';
@ -143,14 +144,25 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector")
}
print "</td></tr>\n";
print '</table>';
print '</div>';
print load_fiche_titre($langs->trans("Setup"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
// VAT Grouped on ticket
print '<tr class="oddeven"><td>';
print $langs->trans('TicketVatGrouped');
print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_TICKET_VAT_GROUPPED", array(), $conf->entity, 0, 0, 1, 0);
//print $form->selectyesno("TAKEPOS_TICKET_VAT_GROUPPED", $conf->global->TAKEPOS_TICKET_VAT_GROUPPED, 1);
print "</td></tr>\n";
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") {
print '<tr class="oddeven value"><td>';
print $langs->trans("URL")." / ".$langs->trans("IPAddress").' (<a href="http://en.takepos.com/connector" target="_blank">'.$langs->trans("TakeposConnectorNecesary").'</a>)';
@ -214,6 +226,7 @@ print $form->selectyesno("TAKEPOS_AUTO_PRINT_TICKETS", $conf->global->TAKEPOS_AU
print "</td></tr>\n";
print '</table>';
print '</div>';
print '<br>';

View File

@ -274,14 +274,6 @@ print img_object('', 'category', 'class="paddingright"').$form->select_all_categ
print ajax_combobox('TAKEPOS_ROOT_CATEGORY_ID');
print "</td></tr>\n";
// VAT Grouped on ticket
print '<tr class="oddeven"><td>';
print $langs->trans('TicketVatGrouped');
print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_TICKET_VAT_GROUPPED", array(), $conf->entity, 0, 0, 1, 0);
//print $form->selectyesno("TAKEPOS_TICKET_VAT_GROUPPED", $conf->global->TAKEPOS_TICKET_VAT_GROUPPED, 1);
print "</td></tr>\n";
// Sort product
print '<tr class="oddeven"><td>';
print $langs->trans("SortProductField");
@ -429,14 +421,6 @@ print "</td></tr>\n";
//print $form->selectarray('TAKEPOS_ADDON', $array, (empty($conf->global->TAKEPOS_ADDON) ? '0' : $conf->global->TAKEPOS_ADDON), 0);
//print "</td></tr>\n";
print '<tr class="oddeven"><td>';
print $langs->trans("EnableBarOrRestaurantFeatures");
print '</td>';
print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_BAR_RESTAURANT", array(), $conf->entity, 0, 0, 1, 0);
//print $form->selectyesno("TAKEPOS_BAR_RESTAURANT", $conf->global->TAKEPOS_BAR_RESTAURANT, 1);
print "</td></tr>\n";
print '</table>';
print '</div>';

View File

@ -398,6 +398,7 @@ if ($action == "deleteline") {
$invoice->deleteline($deletelineid);
$invoice->fetch($placeid);
}
if (count($invoice->lines)==0) $invoice->delete($user);
}
if ($action == "delete") {