28require
'../../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
33require_once DOL_DOCUMENT_ROOT.
"/core/lib/takepos.lib.php";
34require_once DOL_DOCUMENT_ROOT.
'/stripe/class/stripe.class.php';
36$terminal =
GETPOST(
'terminal',
'int');
38if (!empty($_REQUEST[
'CASHDESK_ID_THIRDPARTY'.$terminal.
'_id'])) {
39 $_GET[
'CASHDESK_ID_THIRDPARTY'.$terminal] =
GETPOST(
'CASHDESK_ID_THIRDPARTY'.$terminal.
'_id',
'alpha');
40 $_POST[
'CASHDESK_ID_THIRDPARTY'.$terminal] =
GETPOST(
'CASHDESK_ID_THIRDPARTY'.$terminal.
'_id',
'alpha');
41 $_REQUEST[
'CASHDESK_ID_THIRDPARTY'.$terminal] =
GETPOST(
'CASHDESK_ID_THIRDPARTY'.$terminal.
'_id',
'alpha');
49$langs->loadLangs(array(
"admin",
"cashdesk",
"printing",
"receiptprinter"));
53$sql =
"SELECT code, libelle as label FROM ".MAIN_DB_PREFIX.
"c_paiement";
54$sql .=
" WHERE entity IN (".getEntity(
'c_paiement').
")";
55$sql .=
" AND active = 1";
56$sql .=
" ORDER BY libelle";
57$resql = $db->query($sql);
60 while ($obj = $db->fetch_object($resql)) {
61 array_push($paiements, $obj);
65$terminaltouse = $terminal;
72if (
GETPOST(
'action',
'alpha') ==
'set') {
75 $res =
dolibarr_set_const($db,
"TAKEPOS_TERMINAL_NAME_".$terminaltouse, (!empty(
GETPOST(
'terminalname'.$terminaltouse,
'restricthtml')) ?
GETPOST(
'terminalname'.$terminaltouse,
'restricthtml') : $langs->trans(
"TerminalName", $terminaltouse)),
'chaine', 0,
'', $conf->entity);
77 $res =
dolibarr_set_const($db,
"CASHDESK_ID_THIRDPARTY".$terminaltouse, (
GETPOST(
'socid',
'int') > 0 ?
GETPOST(
'socid',
'int') :
''),
'chaine', 0,
'', $conf->entity);
79 $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);
80 $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);
81 $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);
82 if (isModEnabled(
'stripe') && !empty($conf->global->STRIPE_CARD_PRESENT)) {
83 $res =
dolibarr_set_const($db,
"CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL".$terminaltouse,
GETPOST(
'CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL'.$terminaltouse,
'alpha'),
'chaine', 0,
'', $conf->entity);
86 $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);
88 foreach ($paiements as $modep) {
89 if (in_array($modep->code, array(
'LIQ',
'CB',
'CHQ'))) {
92 $name =
"CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminaltouse;
95 $res =
dolibarr_set_const($db,
"CASHDESK_ID_WAREHOUSE".$terminaltouse, (
GETPOST(
'CASHDESK_ID_WAREHOUSE'.$terminaltouse,
'alpha') > 0 ?
GETPOST(
'CASHDESK_ID_WAREHOUSE'.$terminaltouse,
'alpha') :
''),
'chaine', 0,
'', $conf->entity);
96 $res =
dolibarr_set_const($db,
"CASHDESK_NO_DECREASE_STOCK".$terminaltouse,
GETPOST(
'CASHDESK_NO_DECREASE_STOCK'.$terminaltouse,
'alpha'),
'chaine', 0,
'', $conf->entity);
97 $res =
dolibarr_set_const($db,
"TAKEPOS_PRINTER_TO_USE".$terminaltouse,
GETPOST(
'TAKEPOS_PRINTER_TO_USE'.$terminaltouse,
'alpha'),
'chaine', 0,
'', $conf->entity);
98 $res =
dolibarr_set_const($db,
"TAKEPOS_ORDER_PRINTER1_TO_USE".$terminaltouse,
GETPOST(
'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminaltouse,
'alpha'),
'chaine', 0,
'', $conf->entity);
99 $res =
dolibarr_set_const($db,
"TAKEPOS_ORDER_PRINTER2_TO_USE".$terminaltouse,
GETPOST(
'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminaltouse,
'alpha'),
'chaine', 0,
'', $conf->entity);
100 $res =
dolibarr_set_const($db,
"TAKEPOS_ORDER_PRINTER3_TO_USE".$terminaltouse,
GETPOST(
'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminaltouse,
'alpha'),
'chaine', 0,
'', $conf->entity);
101 $res =
dolibarr_set_const($db,
"TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES".$terminaltouse,
GETPOST(
'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminaltouse,
'alpha'),
'chaine', 0,
'', $conf->entity);
102 $res =
dolibarr_set_const($db,
"TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS".$terminaltouse,
GETPOST(
'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminaltouse,
'alpha'),
'chaine', 0,
'', $conf->entity);
104 $res =
dolibarr_set_const($db,
'CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse, (
GETPOST(
'CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse,
'int') > 0 ?
GETPOST(
'CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse,
'int') :
''),
'chaine', 0,
'', $conf->entity);
106 $res =
dolibarr_set_const($db,
"TAKEPOS_ADDON".$terminaltouse,
GETPOST(
'TAKEPOS_ADDON'.$terminaltouse,
'alpha'),
'chaine', 0,
'', $conf->entity);
109 $res =
dolibarr_set_const($db,
'TAKEPOS_HEADER'.$terminaltouse,
GETPOST(
'TAKEPOS_HEADER'.$terminaltouse,
'restricthtml'),
'chaine', 0,
'', $conf->entity);
110 $res =
dolibarr_set_const($db,
'TAKEPOS_FOOTER'.$terminaltouse,
GETPOST(
'TAKEPOS_FOOTER'.$terminaltouse,
'restricthtml'),
'chaine', 0,
'', $conf->entity);
132$form =
new Form($db);
135llxHeader(
'', $langs->trans(
"CashDeskSetup"));
137$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php">'.$langs->trans(
"BackToModuleList").
'</a>';
138print
load_fiche_titre($langs->trans(
"CashDeskSetup").
' (TakePOS)', $linkback,
'title_setup');
145print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?terminal='.(empty($terminal) ? 1 : $terminal).
'" method="post">';
146print
'<input type="hidden" name="token" value="'.newToken().
'">';
147print
'<input type="hidden" name="action" value="set">';
149print
'<div class="div-table-responsive">';
150print
'<table class="noborder centpercent">';
151print
'<tr class="liste_titre">';
152print
'<td>'.$langs->trans(
"Parameters").
'</td><td>'.$langs->trans(
"Value").
'</td>';
155print
'<tr class="oddeven"><td class="fieldrequired">'.$langs->trans(
"TerminalNameDesc").
'</td>';
157print
'<input type="text" name="terminalname'.$terminal.
'" value="'.
getDolGlobalString(
"TAKEPOS_TERMINAL_NAME_".$terminal, $langs->trans(
"TerminalName", $terminal)).
'" >';
160print
'<tr class="oddeven"><td class="fieldrequired">'.$langs->trans(
"CashDeskThirdPartyForSell").
'</td>';
162$filter =
'((s.client:IN:1,2,3) AND (s.status:=:1))';
163print $form->select_company(
getDolGlobalInt(
'CASHDESK_ID_THIRDPARTY'.$terminaltouse),
'socid', $filter, 1, 0, 0, array(), 0);
167if (isModEnabled(
"banque")) {
168 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskBankAccountForSell").
'</td>';
170 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
171 print $form->select_comptes(
getDolGlobalInt(
'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse),
'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 0,
"courant=2", 1,
'', 0,
'', 1);
172 print
' <a href="'.DOL_URL_ROOT.
'/compta/bank/card.php?action=create&type=2&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?terminal='.$terminal).
'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"NewBankAccount").
'"></span></a>';
177 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskBankAccountForCheque").
'</td>';
179 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
180 print $form->select_comptes(
getDolGlobalInt(
'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse),
'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 0,
"courant=1", 1,
'', 0,
'', 1);
181 print
' <a href="'.DOL_URL_ROOT.
'/compta/bank/card.php?action=create&type=1&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?terminal='.$terminal).
'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"NewBankAccount").
'"></span></a>';
182 if (
getDolGlobalInt(
'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse)) {
186 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskBankAccountForCB").
'</td>';
188 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
189 print $form->select_comptes(
getDolGlobalInt(
'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse),
'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 0,
"courant=1", 1,
'', 0,
'', 1);
190 print
' <a href="'.DOL_URL_ROOT.
'/compta/bank/card.php?action=create&type=1&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?terminal='.$terminal).
'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"NewBankAccount").
'"></span></a>';
196 if (isModEnabled(
'stripe') && !empty($conf->global->STRIPE_CARD_PRESENT)) {
197 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskBankAccountForStripeTerminal").
'</td>';
199 $service =
'StripeTest';
201 if (!empty($conf->global->STRIPE_LIVE) && !
GETPOST(
'forcesandbox',
'alpha')) {
202 $service =
'StripeLive';
205 global $stripearrayofkeysbyenv;
206 $site_account = $stripearrayofkeysbyenv[$servicestatus][
'secret_key'];
207 \Stripe\Stripe::setApiKey($site_account);
208 if (isModEnabled(
'stripe') && (empty($conf->global->STRIPE_LIVE) ||
GETPOST(
'forcesandbox',
'alpha'))) {
209 $service =
'StripeTest';
210 $servicestatus =
'0';
211 dol_htmloutput_mesg($langs->trans(
'YouAreCurrentlyInSandboxMode',
'Stripe'),
'',
'warning');
213 $service =
'StripeLive';
214 $servicestatus =
'1';
216 $stripe =
new Stripe($db);
217 $stripeacc = $stripe->getStripeAccount($service);
219 $readers = \Stripe\Terminal\Reader::all(
'', array(
"location" => $conf->global->STRIPE_LOCATION,
"stripe_account" => $stripeacc));
221 $readers = \Stripe\Terminal\Reader::all(
'', array(
"location" => $conf->global->STRIPE_LOCATION));
225 $reader[
""] = $langs->trans(
"NoReader");
226 foreach ($readers as $tmpreader) {
227 $reader[$tmpreader->id] = $tmpreader->label.
' ('.$tmpreader->status.
')';
229 print $form->selectarray(
'CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL'.$terminaltouse, $reader, $conf->global->{
'CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL'.$terminaltouse});
234 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskBankAccountForSumup").
'</td>';
236 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
237 print $form->select_comptes(
getDolGlobalInt(
'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse),
'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 0,
"courant=1", 1,
'', 0,
'', 1);
238 print
' <a href="'.DOL_URL_ROOT.
'/compta/bank/card.php?action=create&type=1&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?terminal='.$terminal).
'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"NewBankAccount").
'"></span></a>';
245 foreach ($paiements as $modep) {
246 if (in_array($modep->code, array(
'LIQ',
'CB',
'CHQ'))) {
249 $name =
"CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminaltouse;
250 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskBankAccountFor").
' '.$langs->trans($modep->label).
'</td>';
252 if (!empty($conf->global->$name)) {
255 $cour = preg_match(
'/^LIQ.*/', $modep->code) ? 2 : 1;
256 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
257 print $form->select_comptes(
getDolGlobalInt($name), $name, 0,
"courant=".$cour, 1,
'', 0,
'', 1);
258 print
' <a href="'.DOL_URL_ROOT.
'/compta/bank/card.php?action=create&type=1&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?terminal='.$terminal).
'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans(
"NewBankAccount").
'"></span></a>';
263if (isModEnabled(
'stock')) {
264 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskDoNotDecreaseStock").
'</td>';
266 if (!isModEnabled(
'productbatch') ||
getDolGlobalInt(
'CASHDESK_FORCE_DECREASE_STOCK')) {
267 print $form->selectyesno(
'CASHDESK_NO_DECREASE_STOCK'.$terminal,
getDolGlobalInt(
'CASHDESK_NO_DECREASE_STOCK'.$terminal), 1);
270 $res =
dolibarr_set_const($db,
"CASHDESK_NO_DECREASE_STOCK".$terminal, 1,
'chaine', 0,
'', $conf->entity);
272 print $langs->trans(
"Yes").
'<br>';
273 print
'<span class="opacitymedium">'.$langs->trans(
'StockDecreaseForPointOfSaleDisabledbyBatch').
'</span>';
280 print
'<tr class="oddeven"><td>';
281 if (!$disabled) { print
'<span class="fieldrequired">'; }
282 print $langs->trans(
"CashDeskIdWareHouse");
283 if (!$disabled) { print
'</span>'; }
285 print
img_warning($langs->trans(
"DisableStockChange").
' - '.$langs->trans(
"NoWarehouseDefinedForTerminal"));
288 print
'<td class="minwidth300">';
290 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
291 print $formproduct->selectWarehouses(
getDolGlobalString(
'CASHDESK_ID_WAREHOUSE'.$terminal),
'CASHDESK_ID_WAREHOUSE'.$terminal,
'', 1, $disabled, 0,
'', 0, 0, array(),
'maxwidth250');
292 print
' <a href="'.DOL_URL_ROOT.
'/product/stock/card.php?action=create&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?&terminal='.$terminal).
'"><span class="fa fa-plus-circle valignmiddle"></span></a>';
294 print
'<span class="opacitymedium">'.$langs->trans(
"StockDecreaseForPointOfSaleDisabled").
'</span>';
298 if (isModEnabled(
'productbatch') && !empty($conf->global->CASHDESK_FORCE_DECREASE_STOCK) && !$conf->global->{
'CASHDESK_NO_DECREASE_STOCK'.$terminal}) {
299 print
'<tr class="oddeven"><td>'.$langs->trans(
'CashDeskForceDecreaseStockLabel').
'</td>';
301 print
'<span class="opacitymedium">'.$langs->trans(
'CashDeskForceDecreaseStockDesc').
'</span>';
308 require_once DOL_DOCUMENT_ROOT.
'/core/class/dolreceiptprinter.class.php';
311 $printer->listprinters();
313 foreach ($printer->listprinters as $key => $value) {
314 $printers[$value[
'rowid']] = $value[
'name'];
316 print
'<tr class="oddeven"><td>'.$langs->trans(
"MainPrinterToUse").
'</td>';
318 print $form->selectarray(
'TAKEPOS_PRINTER_TO_USE'.$terminal, $printers,
getDolGlobalInt(
'TAKEPOS_PRINTER_TO_USE'.$terminal), 1);
321 print
'<tr class="oddeven"><td>'.$langs->trans(
"OrderPrinterToUse").
' - '.$langs->trans(
"Printer").
' 1</td>';
323 print $form->selectarray(
'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal, $printers,
getDolGlobalInt(
'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal), 1);
325 print
'<tr class="oddeven"><td>'.$langs->trans(
"OrderPrinterToUse").
' - '.$langs->trans(
"Printer").
' 2</td>';
327 print $form->selectarray(
'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal, $printers,
getDolGlobalInt(
'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal), 1);
329 print
'<tr class="oddeven"><td>'.$langs->trans(
"OrderPrinterToUse").
' - '.$langs->trans(
"Printer").
' 3</td>';
331 print $form->selectarray(
'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal, $printers,
getDolGlobalInt(
'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal), 1);
335 $printer->listPrintersTemplates();
336 $templates = array();
337 foreach ($printer->listprinterstemplates as $key => $value) {
338 $templates[$value[
'rowid']] = $value[
'name'];
340 print
'<tr class="oddeven"><td>'.$langs->trans(
"MainTemplateToUse").
' (<a href="'.DOL_URL_ROOT.
'/admin/receiptprinter.php?mode=template">'.$langs->trans(
"SetupReceiptTemplate").
'</a>)</td>';
342 print $form->selectarray(
'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal, $templates,
getDolGlobalInt(
'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal), 1);
345 print
'<tr class="oddeven"><td>'.$langs->trans(
"OrderTemplateToUse").
'</td>';
347 print $form->selectarray(
'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal, $templates,
getDolGlobalInt(
'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal), 1);
352print
'<tr class="oddeven"><td>'.$langs->trans(
'CashDeskReaderKeyCodeForEnter').
'</td>';
354print
'<input type="text" class="width50" name="CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse.
'" value="'.
getDolGlobalString(
'CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse).
'" />';
359 print
'<tr class="oddeven"><td>';
360 print $langs->trans(
"BillsNumberingModule");
361 print
'<td colspan="2">';
362 $array = array(0=>$langs->trans(
"Default"));
363 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
364 foreach ($dirmodels as $reldir) {
367 $handle = opendir($dir);
368 if (is_resource($handle)) {
369 while (($file = readdir($handle)) !==
false) {
370 if (!is_dir($dir.$file) || (substr($file, 0, 1) <>
'.' && substr($file, 0, 3) <>
'CVS')) {
372 $classname = preg_replace(
'/\.php$/',
'', $file);
374 if (!is_file($dir.$filebis)) {
375 $filebis = $file.
"/".$file.
".modules.php";
376 $classname =
"mod_facture_".$file;
379 preg_match(
'/\-(.*)_(.*)$/', $classname, $reg);
380 if (!empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) {
384 $classname = preg_replace(
'/\-.*$/',
'', $classname);
385 if (!class_exists($classname) && is_readable($dir.$filebis) && (preg_match(
'/mod_/', $filebis) || preg_match(
'/mod_/', $classname)) && substr($filebis,
dol_strlen($filebis) - 3, 3) ==
'php') {
387 require_once $dir.$filebis;
389 $module =
new $classname($db);
392 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
395 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
399 if ($module->isEnabled()) {
400 $array[preg_replace(
'/\-.*$/',
'', preg_replace(
'/\.php$/',
'', $file))] = preg_replace(
'/\-.*$/',
'', preg_replace(
'/mod_facture_/',
'', preg_replace(
'/\.php$/',
'', $file)));
409 print $form->selectarray(
'TAKEPOS_ADDON'.$terminaltouse, $array, (empty($conf->global->{
'TAKEPOS_ADDON'.$terminaltouse}) ?
'0' : $conf->global->{
'TAKEPOS_ADDON'.$terminaltouse}), 0);
410 print
"</td></tr>\n";
420$substitutionarray[
'__(AnyTranslationKey)__'] = $langs->trans(
'Translation');
421$htmltext =
'<i>'.$langs->trans(
'AvailableVariables').
':<br>';
422foreach ($substitutionarray as $key => $val) {
423 $htmltext .= $key.
'<br>';
430print
'<div class="div-table-responsive-no-min">';
431print
'<table class="noborder centpercent">';
432print
'<tr class="liste_titre">';
433print
'<td>'.$langs->trans(
"Parameters").
'</td><td>'.$langs->trans(
'Value').
'</td>';
437print
'<tr class="oddeven">';
439print $form->textwithpicto($langs->trans(
'Header'), $htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
442$variablename =
'TAKEPOS_HEADER'.$terminaltouse;
444 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.$conf->global->{$variablename}.
'</textarea>';
446 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
448 print $doleditor->Create();
453print
'<tr class="oddeven">';
455print $form->textwithpicto($langs->trans(
'Footer'), $htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
458$variablename =
'TAKEPOS_FOOTER'.$terminaltouse;
460 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.$conf->global->{$variablename}.
'</textarea>';
462 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
464 print $doleditor->Create();
471if ($atleastonefound == 0 && isModEnabled(
"banque")) {
472 print
info_admin($langs->trans(
"AtLeastOneDefaultBankAccountMandatory"), 0, 0,
'error');
477print $form->buttonsSaveCancel(
"Save",
'');
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage a WYSIWYG editor.
Class to manage Receipt Printers.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_htmloutput_mesg($mesgstring='', $mesgarray=array(), $style='ok', $keepembedded=0)
Print formated messages to output (Used to show messages on html output).
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0, $include=null)
Return array of possible substitutions for PDF content (without external module substitutions).
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
takepos_admin_prepare_head()
Prepare array with list of tabs.