forked from Wavyzz/dolibarr
Merge pull request #21914 from aspangaro/16p3
TakePos - PHP8 Warnings & review
This commit is contained in:
@@ -57,11 +57,11 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos
|
||||
*/
|
||||
public function info()
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $db, $langs;
|
||||
|
||||
$langs->load('cashdesk@cashdesk');
|
||||
|
||||
$form = new Form($this->db);
|
||||
$form = new Form($db);
|
||||
|
||||
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
|
||||
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
@@ -79,9 +79,9 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos
|
||||
|
||||
// Parametrage du prefix
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||
$texte .= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskvalue" value="'.$conf->global->TAKEPOS_REF_UNIVERSAL_MASK.'">', $tooltip, 1, 1).'</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskvalue" value="'.getDolGlobalString('TAKEPOS_REF_UNIVERSAL_MASK').'">', $tooltip, 1, 1).'</td>';
|
||||
|
||||
$texte .= '<td align="left" rowspan="2"> <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"></td>';
|
||||
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"></td>';
|
||||
|
||||
$texte .= '</tr>';
|
||||
|
||||
@@ -121,12 +121,12 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos
|
||||
*/
|
||||
public function getNextValue($objsoc = null, $invoice = null, $mode = 'next')
|
||||
{
|
||||
global $db, $conf;
|
||||
global $db;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
// On defini critere recherche compteur
|
||||
$mask = $conf->global->TAKEPOS_REF_UNIVERSAL_MASK;
|
||||
$mask = getDolGlobalString('TAKEPOS_REF_UNIVERSAL_MASK');
|
||||
|
||||
if (!$mask) {
|
||||
$this->error = 'NotConfigured';
|
||||
@@ -136,9 +136,10 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos
|
||||
// Get entities
|
||||
$entity = getEntity('invoicenumber', 1, $invoice);
|
||||
|
||||
$date = (empty($invoice->date) ? dol_now() : $invoice->date);
|
||||
$pos_source = is_object($invoice) && $invoice->pos_source > 0 ? $invoice->pos_source : 0;
|
||||
$mask = str_replace('{TN}', $pos_source, $mask);
|
||||
$numFinal = get_next_value($db, $mask, 'facture', 'ref', '', $objsoc, $invoice->date, $mode, false, null, $entity);
|
||||
$numFinal = get_next_value($db, $mask, 'facture', 'ref', '', $objsoc, $date, $mode, false, null, $entity);
|
||||
|
||||
return $numFinal;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -67,7 +68,7 @@ if (GETPOST('action', 'alpha') == 'set') {
|
||||
}
|
||||
}
|
||||
|
||||
if ($conf->global->TAKEPOS_ORDER_NOTES == 1) {
|
||||
if (getDolGlobalInt('TAKEPOS_ORDER_NOTES') == 1) {
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extrafields->addExtraField('order_notes', 'Order notes', 'varchar', 0, 255, 'facturedet', 0, 0, '', '', 0, '', 0, 1);
|
||||
}
|
||||
@@ -79,6 +80,7 @@ if ($conf->global->TAKEPOS_ORDER_NOTES == 1) {
|
||||
$form = new Form($db);
|
||||
$formproduct = new FormProduct($db);
|
||||
|
||||
$arrayofjs = array();
|
||||
$arrayofcss = array("/takepos/css/colorbox.css");
|
||||
|
||||
llxHeader('', $langs->trans("CashDeskSetup"), '', '', 0, 0, $arrayofjs, $arrayofcss);
|
||||
@@ -112,7 +114,7 @@ print '</center>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
|
||||
if (getDolGlobalInt('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>';
|
||||
@@ -171,12 +173,12 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
|
||||
print ajax_constantonoff("TAKEPOS_SUPPLEMENTS", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print '</td></tr>';
|
||||
|
||||
if ($conf->global->TAKEPOS_SUPPLEMENTS) {
|
||||
if (getDolGlobalInt('TAKEPOS_SUPPLEMENTS')) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("SupplementCategory");
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print $form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_SUPPLEMENTS_CATEGORY, 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0);
|
||||
print $form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalString('TAKEPOS_SUPPLEMENTS_CATEGORY'), 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0);
|
||||
print ajax_combobox('TAKEPOS_SUPPLEMENTS_CATEGORY');
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
@@ -203,8 +205,8 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) {
|
||||
print $form->buttonsSaveCancel("Save", '');
|
||||
}
|
||||
|
||||
if (!empty($conf->global->TAKEPOS_BAR_RESTAURANT)) {
|
||||
if ($conf->global->TAKEPOS_QR_MENU) {
|
||||
if (getDolGlobalInt('TAKEPOS_BAR_RESTAURANT')) {
|
||||
if (getDolGlobalInt('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>';
|
||||
@@ -221,7 +223,7 @@ if (!empty($conf->global->TAKEPOS_BAR_RESTAURANT)) {
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
if ($conf->global->TAKEPOS_AUTO_ORDER) {
|
||||
if (getDolGlobalInt('TAKEPOS_AUTO_ORDER')) {
|
||||
print '<br>';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2019 Andreu Bisquerra Gaya <jove@bisquerra.com>
|
||||
* Copyright (C) 2021 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2019 Andreu Bisquerra Gaya <jove@bisquerra.com>
|
||||
* Copyright (C) 2021 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -47,10 +48,7 @@ if (GETPOST('action', 'alpha') == 'set') {
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'restricthtml'), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'restricthtml'), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_RECEIPT_NAME", GETPOST('TAKEPOS_RECEIPT_NAME', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_SHOW_CUSTOMER", GETPOST('TAKEPOS_SHOW_CUSTOMER', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_AUTO_PRINT_TICKETS", GETPOST('TAKEPOS_AUTO_PRINT_TICKETS', 'int'), 'int', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_PRINT_PAYMENT_METHOD", GETPOST('TAKEPOS_PRINT_PAYMENT_METHOD', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT', GETPOST('TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT', 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha'));
|
||||
@@ -120,14 +118,14 @@ print $langs->trans('DolibarrReceiptPrinter');
|
||||
print '<td>';
|
||||
print $langs->trans('ReceiptPrinterMethodDescription');
|
||||
if ($conf->receiptprinter->enabled) {
|
||||
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") {
|
||||
if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
|
||||
print '<br>';
|
||||
print img_picto('', 'printer', 'class="paddingright"').'<a href="'.DOL_URL_ROOT.'/admin/receiptprinter.php">'.$langs->trans("Setup").'</a>';
|
||||
}
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
if ($conf->receiptprinter->enabled) {
|
||||
if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") {
|
||||
if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "receiptprinter") {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmethod&token='.newToken().'&value=receiptprinter">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
@@ -148,7 +146,7 @@ print $langs->trans('TakeposConnectorMethodDescription');
|
||||
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") {
|
||||
print '<br>';
|
||||
print $langs->trans("URL")." / ".$langs->trans("IPAddress").' (<a href="http://en.takepos.com/connector" target="_blank" rel="noopener noreferrer external">'.$langs->trans("TakeposConnectorNecesary").'</a>)';
|
||||
print ' <input type="text" class="minwidth200" id="TAKEPOS_PRINT_SERVER" name="TAKEPOS_PRINT_SERVER" value="'.$conf->global->TAKEPOS_PRINT_SERVER.'">';
|
||||
print ' <input type="text" class="minwidth200" id="TAKEPOS_PRINT_SERVER" name="TAKEPOS_PRINT_SERVER" value="'.getDolGlobalString('TAKEPOS_PRINT_SERVER').'">';
|
||||
}
|
||||
|
||||
print '</td><td class="right">';
|
||||
@@ -221,14 +219,14 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans('PrintCustomerOnReceipts');
|
||||
print '<td colspan="2">';
|
||||
print $form->selectyesno("TAKEPOS_SHOW_CUSTOMER", $conf->global->TAKEPOS_SHOW_CUSTOMER, 1);
|
||||
print ajax_constantonoff("TAKEPOS_SHOW_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Print payment method
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans('PrintPaymentMethodOnReceipts');
|
||||
print '<td colspan="2">';
|
||||
print $form->selectyesno("TAKEPOS_PRINT_PAYMENT_METHOD", $conf->global->TAKEPOS_PRINT_PAYMENT_METHOD, 1);
|
||||
print ajax_constantonoff("TAKEPOS_PRINT_PAYMENT_METHOD", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
@@ -236,7 +234,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("AutoPrintTickets");
|
||||
print '<td colspan="2">';
|
||||
print $form->selectyesno("TAKEPOS_AUTO_PRINT_TICKETS", $conf->global->TAKEPOS_AUTO_PRINT_TICKETS, 1);
|
||||
print ajax_constantonoff("TAKEPOS_AUTO_PRINT_TICKETS", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
@@ -247,7 +245,7 @@ print '<td colspan="2">';
|
||||
print ajax_constantonoff("TAKEPOS_SHOW_HT_RECEIPT", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print "</td></tr>\n";
|
||||
|
||||
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
|
||||
if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector" && filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans('WeighingScale');
|
||||
print '<td colspan="2">';
|
||||
@@ -255,7 +253,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($con
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) {
|
||||
if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector" && filter_var(getDolGlobalString('TAKEPOS_PRINT_SERVER'), FILTER_VALIDATE_URL) == true) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans('CustomerDisplay');
|
||||
print '<td colspan="2">';
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2021 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2021 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -78,7 +79,7 @@ if ($action == 'set') {
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_NUM_TERMINALS", GETPOST('TAKEPOS_NUM_TERMINALS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_ADDON", GETPOST('TAKEPOS_ADDON', 'alpha'), 'int', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_EMAIL_TEMPLATE_INVOICE", GETPOST('TAKEPOS_EMAIL_TEMPLATE_INVOICE', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
if (!empty($conf->global->TAKEPOS_ENABLE_SUMUP)) {
|
||||
if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_SUMUP_AFFILIATE", GETPOST('TAKEPOS_SUMUP_AFFILIATE', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "TAKEPOS_SUMUP_APPID", GETPOST('TAKEPOS_SUMUP_APPID', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
@@ -142,13 +143,13 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
||||
print load_fiche_titre($langs->trans('CashDeskRefNumberingModules'), '', '');
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name")."</td>\n";
|
||||
print '<td>'.$langs->trans("Description")."</td>\n";
|
||||
print '<td class="nowrap">'.$langs->trans("Example")."</td>\n";
|
||||
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
|
||||
print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
|
||||
print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
|
||||
print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
clearstatcache();
|
||||
@@ -195,8 +196,8 @@ foreach ($dirmodels as $reldir) {
|
||||
}
|
||||
print '</td>'."\n";
|
||||
|
||||
print '<td align="center">';
|
||||
if ($conf->global->TAKEPOS_REF_ADDON == "$file") {
|
||||
print '<td class="center">';
|
||||
if (getDolGlobalString('TAKEPOS_REF_ADDON') == "$file") {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setrefmod&token='.newToken().'&value='.urlencode($file).'">';
|
||||
@@ -276,7 +277,7 @@ if (!empty($conf->service->enabled)) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc"));
|
||||
print '<td colspan="2">';
|
||||
print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_ROOT_CATEGORY_ID, 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0);
|
||||
print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalInt('TAKEPOS_ROOT_CATEGORY_ID'), 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0);
|
||||
print ajax_combobox('TAKEPOS_ROOT_CATEGORY_ID');
|
||||
print "</td></tr>\n";
|
||||
|
||||
@@ -458,7 +459,7 @@ print '</div>';
|
||||
|
||||
|
||||
// Sumup options
|
||||
if ($conf->global->TAKEPOS_ENABLE_SUMUP) {
|
||||
if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
|
||||
print '<br>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -73,7 +74,7 @@ if (GETPOST('action', 'alpha') == 'set') {
|
||||
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CHEQUE".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CB".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
if (!empty($conf->global->TAKEPOS_ENABLE_SUMUP)) {
|
||||
if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
|
||||
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_SUMUP".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
foreach ($paiements as $modep) {
|
||||
@@ -145,7 +146,7 @@ print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
||||
print '<td>';
|
||||
print $form->select_company($conf->global->{'CASHDESK_ID_THIRDPARTY'.$terminaltouse}, 'socid', '(s.client IN (1, 3) AND s.status = 1)', 1, 0, 0, array(), 0);
|
||||
print $form->select_company(getDolGlobalInt('CASHDESK_ID_THIRDPARTY'.$terminaltouse), 'socid', '(s.client IN (1, 3) AND s.status = 1)', 1, 0, 0, array(), 0);
|
||||
print '</td></tr>';
|
||||
|
||||
$atleastonefound = 0;
|
||||
@@ -153,33 +154,33 @@ if (!empty($conf->banque->enabled)) {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForSell").'</td>';
|
||||
print '<td>';
|
||||
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
|
||||
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 0, "courant=2", 1);
|
||||
if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse})) {
|
||||
$form->select_comptes(getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse), 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 0, "courant=2", 1);
|
||||
if (getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse)) {
|
||||
$atleastonefound++;
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCheque").'</td>';
|
||||
print '<td>';
|
||||
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
|
||||
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 0, "courant=1", 1);
|
||||
if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse})) {
|
||||
$form->select_comptes(getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse), 'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 0, "courant=1", 1);
|
||||
if (getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse)) {
|
||||
$atleastonefound++;
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCB").'</td>';
|
||||
print '<td>';
|
||||
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
|
||||
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 0, "courant=1", 1);
|
||||
if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse})) {
|
||||
$form->select_comptes(getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse), 'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 0, "courant=1", 1);
|
||||
if (getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse)) {
|
||||
$atleastonefound++;
|
||||
}
|
||||
print '</td></tr>';
|
||||
if ($conf->global->TAKEPOS_ENABLE_SUMUP) {
|
||||
if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForSumup").'</td>';
|
||||
print '<td>';
|
||||
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
|
||||
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 0, "courant=1", 1);
|
||||
if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse})) {
|
||||
$form->select_comptes(getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse), 'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 0, "courant=1", 1);
|
||||
if (getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse)) {
|
||||
$atleastonefound++;
|
||||
}
|
||||
print '</td></tr>';
|
||||
@@ -197,7 +198,7 @@ if (!empty($conf->banque->enabled)) {
|
||||
}
|
||||
$cour = preg_match('/^LIQ.*/', $modep->code) ? 2 : 1;
|
||||
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
|
||||
$form->select_comptes($conf->global->$name, $name, 0, "courant=".$cour, 1);
|
||||
$form->select_comptes(getDolGlobalInt($name), $name, 0, "courant=".$cour, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
@@ -205,10 +206,10 @@ if (!empty($conf->banque->enabled)) {
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>'; // Force warehouse (this is not a default value)
|
||||
print '<td>';
|
||||
if (empty($conf->productbatch->enabled) || !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK)) {
|
||||
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}, 1);
|
||||
if (empty($conf->productbatch->enabled) || getDolGlobalInt('CASHDESK_FORCE_DECREASE_STOCK')) {
|
||||
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, getDolGlobalInt('CASHDESK_NO_DECREASE_STOCK'.$terminal), 1);
|
||||
} else {
|
||||
if (!$conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$terminal}) {
|
||||
if (getDolGlobalInt('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>';
|
||||
@@ -286,11 +287,11 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter" || $conf->global->TA
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans('CashDeskReaderKeyCodeForEnter').'</td>';
|
||||
print '<td>';
|
||||
print '<input type="text" name="CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse.'" value="'.$conf->global->{'CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse}.'" />';
|
||||
print '<input type="text" name="CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse.'" value="'.getDolGlobalString('CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse).'" />';
|
||||
print '</td></tr>';
|
||||
|
||||
// Numbering module
|
||||
if ($conf->global->TAKEPOS_ADDON == "terminal") {
|
||||
if (getDolGlobalString('TAKEPOS_ADDON') == "terminal") {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("BillsNumberingModule");
|
||||
print '<td colspan="2">';
|
||||
@@ -379,7 +380,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->{$variablename}.'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->{$variablename}, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td></tr>';
|
||||
@@ -395,7 +396,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->{$variablename}.'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->{$variablename}, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@@ -425,7 +425,7 @@ while ($i < count($arrayOfValidPaymentModes)) {
|
||||
}
|
||||
|
||||
$keyforsumupbank = "CASHDESK_ID_BANKACCOUNT_SUMUP".$_SESSION["takeposterminal"];
|
||||
if ($conf->global->TAKEPOS_ENABLE_SUMUP) {
|
||||
if (getDolGlobalInt('TAKEPOS_ENABLE_SUMUP')) {
|
||||
if (!empty($conf->global->$keyforsumupbank)) {
|
||||
print '<button type="button" class="calcbutton2" onclick="ValidateSumup();">Sumup</button>';
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user