30require
'../../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/blockedlog/lib/blockedlog.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
44require_once DOL_DOCUMENT_ROOT.
"/core/lib/takepos.lib.php";
45require_once DOL_DOCUMENT_ROOT.
'/stripe/class/stripe.class.php';
49if (
GETPOST(
'CASHDESK_ID_THIRDPARTY'.$terminal.
'_id',
'alpha')) {
50 $_GET[
'CASHDESK_ID_THIRDPARTY'.$terminal] =
GETPOST(
'CASHDESK_ID_THIRDPARTY'.$terminal.
'_id',
'alpha');
51 $_POST[
'CASHDESK_ID_THIRDPARTY'.$terminal] =
GETPOST(
'CASHDESK_ID_THIRDPARTY'.$terminal.
'_id',
'alpha');
52 $_REQUEST[
'CASHDESK_ID_THIRDPARTY'.$terminal] =
GETPOST(
'CASHDESK_ID_THIRDPARTY'.$terminal.
'_id',
'alpha');
60$langs->loadLangs(array(
"admin",
"cashdesk",
"printing",
"receiptprinter"));
62$sql =
"SELECT code, libelle as label FROM ".MAIN_DB_PREFIX.
"c_paiement";
63$sql .=
" WHERE entity IN (".getEntity(
'c_paiement').
")";
64$sql .=
" AND active = 1";
65$sql .=
" ORDER BY libelle";
66$resql = $db->query($sql);
69 while ($obj = $db->fetch_object($resql)) {
70 array_push($paiements, $obj);
74$terminaltouse = $terminal;
83if (
GETPOST(
'action',
'alpha') ==
'set') {
86 $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);
90 if (GETPOSTISSET(
'socid')) {
94 if (GETPOSTISSET(
'projectid')) {
97 if (GETPOSTISSET(
'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse)) {
98 $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);
100 if (GETPOSTISSET(
'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse)) {
101 $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);
103 if (GETPOSTISSET(
'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse)) {
104 $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);
106 if (GETPOSTISSET(
'CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL'.$terminaltouse)) {
107 $res =
dolibarr_set_const($db,
"CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL".$terminaltouse,
GETPOST(
'CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL'.$terminaltouse,
'alpha'),
'chaine', 0,
'', $conf->entity);
109 if (GETPOSTISSET(
'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse)) {
110 $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);
112 foreach ($paiements as $modep) {
113 if (in_array($modep->code, array(
'LIQ',
'CB',
'CHQ'))) {
116 $name =
"CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminaltouse;
117 if (GETPOSTISSET($name)) {
121 if (GETPOSTISSET(
'CASHDESK_ID_WAREHOUSE'.$terminaltouse)) {
122 $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);
124 if (GETPOSTISSET(
'CASHDESK_NO_DECREASE_STOCK'.$terminaltouse)) {
125 $res =
dolibarr_set_const($db,
"CASHDESK_NO_DECREASE_STOCK".$terminaltouse,
GETPOST(
'CASHDESK_NO_DECREASE_STOCK'.$terminaltouse,
'alpha'),
'chaine', 0,
'', $conf->entity);
127 if (GETPOSTISSET(
'TAKEPOS_PRINTER_TO_USE'.$terminaltouse)) {
128 $res =
dolibarr_set_const($db,
"TAKEPOS_PRINTER_TO_USE".$terminaltouse,
GETPOST(
'TAKEPOS_PRINTER_TO_USE'.$terminaltouse,
'alpha'),
'chaine', 0,
'', $conf->entity);
130 if (GETPOSTISSET(
'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminaltouse)) {
131 $res =
dolibarr_set_const($db,
"TAKEPOS_ORDER_PRINTER1_TO_USE".$terminaltouse,
GETPOST(
'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminaltouse,
'alpha'),
'chaine', 0,
'', $conf->entity);
133 if (GETPOSTISSET(
'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminaltouse)) {
134 $res =
dolibarr_set_const($db,
"TAKEPOS_ORDER_PRINTER2_TO_USE".$terminaltouse,
GETPOST(
'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminaltouse,
'alpha'),
'chaine', 0,
'', $conf->entity);
136 if (GETPOSTISSET(
'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminaltouse)) {
137 $res =
dolibarr_set_const($db,
"TAKEPOS_ORDER_PRINTER3_TO_USE".$terminaltouse,
GETPOST(
'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminaltouse,
'alpha'),
'chaine', 0,
'', $conf->entity);
139 if (GETPOSTISSET(
'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminaltouse)) {
140 $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);
142 if (GETPOSTISSET(
'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminaltouse)) {
143 $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);
146 if (GETPOSTISSET(
'CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse)) {
147 $res =
dolibarr_set_const($db,
'CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse, (
GETPOSTINT(
'CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse) > 0 ?
GETPOSTINT(
'CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse) :
''),
'chaine', 0,
'', $conf->entity);
150 if (GETPOSTISSET(
'TAKEPOS_ADDON'.$terminaltouse)) {
151 $res =
dolibarr_set_const($db,
"TAKEPOS_ADDON".$terminaltouse,
GETPOST(
'TAKEPOS_ADDON'.$terminaltouse,
'alpha'),
'chaine', 0,
'', $conf->entity);
155 if (GETPOSTISSET(
'TAKEPOS_HEADER'.$terminaltouse)) {
156 $res =
dolibarr_set_const($db,
'TAKEPOS_HEADER'.$terminaltouse,
GETPOST(
'TAKEPOS_HEADER'.$terminaltouse,
'restricthtml'),
'chaine', 0,
'', $conf->entity);
158 if (GETPOSTISSET(
'TAKEPOS_FOOTER'.$terminaltouse)) {
159 $res =
dolibarr_set_const($db,
'TAKEPOS_FOOTER'.$terminaltouse,
GETPOST(
'TAKEPOS_FOOTER'.$terminaltouse,
'restricthtml'),
'chaine', 0,
'', $conf->entity);
182$form =
new Form($db);
185llxHeader(
'', $langs->trans(
"CashDeskSetup"),
'',
'', 0, 0,
'',
'',
'',
'mod-takepos page-admin_terminal');
187$linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.
img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
189print
load_fiche_titre($langs->trans(
"CashDeskSetup").
' (TakePOS)', $linkback,
'title_setup');
196print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?terminal='.(empty($terminal) ? 1 : $terminal).
'" method="post">';
197print
'<input type="hidden" name="token" value="'.newToken().
'">';
198print
'<input type="hidden" name="action" value="set">';
200print
'<div class="div-table-responsive">';
201print
'<table class="noborder centpercent">';
202print
'<tr class="liste_titre">';
203print
'<td>'.$langs->trans(
"Parameters").
'</td><td></td>';
206print
'<tr class="oddeven"><td class="fieldrequired">'.$langs->trans(
"TerminalNameDesc").
'</td>';
208print
'<input type="text" name="terminalname'.$terminal.
'" value="'.
getDolGlobalString(
"TAKEPOS_TERMINAL_NAME_".$terminal, $langs->trans(
"TerminalName", $terminal)).
'" >';
211print
'<tr class="oddeven"><td>'.$langs->trans(
"ForbidSalesToTheDefaultCustomer").
'</td>';
213print ajax_constantonoff(
"TAKEPOS_FORBID_SALES_TO_DEFAULT_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0);
216print
'<tr class="oddeven"><td class="fieldrequired">'.$langs->trans(
"CashDeskThirdPartyForSell").
'</td>';
218print
img_picto(
'',
'company',
'class="pictofixedwidth"');
219$filter =
'((s.client:IN:1,2,3) AND (s.status:=:1))';
220print $form->select_company(
getDolGlobalInt(
'CASHDESK_ID_THIRDPARTY'.$terminaltouse),
'socid', $filter, 1, 0, 0, array(), 0,
'maxwidth500 widthcentpercentminusx');
225 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskBankAccountForSell").
'</td>';
227 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
228 print $form->select_comptes(
getDolGlobalInt(
'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse),
'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 0,
"courant=2", 1,
'', 0,
'maxwidth500 widthcentpercentminusxx', 1);
229 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>';
234 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskBankAccountForCheque").
'</td>';
236 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
237 print $form->select_comptes(
getDolGlobalInt(
'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse),
'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 0,
"courant=1", 1,
'', 0,
'maxwidth500 widthcentpercentminusxx', 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>';
239 if (
getDolGlobalInt(
'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse)) {
243 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskBankAccountForCB").
'</td>';
245 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
246 print $form->select_comptes(
getDolGlobalInt(
'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse),
'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 0,
"courant=1", 1,
'', 0,
'maxwidth500 widthcentpercentminusxx', 1);
247 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>';
254 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskBankAccountForStripeTerminal").
'</td>';
256 $service =
'StripeTest';
259 $service =
'StripeLive';
262 global $stripearrayofkeysbyenv;
263 $site_account = $stripearrayofkeysbyenv[$servicestatus][
'secret_key'];
264 \Stripe\Stripe::setApiKey($site_account);
266 $service =
'StripeTest';
267 $servicestatus =
'0';
268 dol_htmloutput_mesg($langs->trans(
'YouAreCurrentlyInSandboxMode',
'Stripe'), [],
'warning');
270 $service =
'StripeLive';
271 $servicestatus =
'1';
273 $stripe =
new Stripe($db);
274 $stripeacc = $stripe->getStripeAccount($service);
276 $readers = \Stripe\Terminal\Reader::all(
null, array(
"location" =>
getDolGlobalString(
'STRIPE_LOCATION'),
"stripe_account" => $stripeacc));
278 $readers = \Stripe\Terminal\Reader::all(
null, array(
"location" =>
getDolGlobalString(
'STRIPE_LOCATION')));
282 $reader[
""] = $langs->trans(
"NoReader");
283 foreach ($readers as $tmpreader) {
284 $reader[$tmpreader->id] = $tmpreader->label.
' ('.$tmpreader->status.
')';
286 print $form->selectarray(
'CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL'.$terminaltouse, $reader,
getDolGlobalString(
'CASHDESK_ID_BANKACCOUNT_STRIPETERMINAL'.$terminaltouse));
291 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskBankAccountForSumup").
'</td>';
293 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
294 print $form->select_comptes(
getDolGlobalInt(
'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse),
'CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 0,
"courant=1", 1,
'', 0,
'maxwidth500 widthcentpercentminusxx', 1);
295 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>';
303 foreach ($paiements as $modep) {
304 if (in_array($modep->code, array(
'LIQ',
'CB',
'CHQ'))) {
307 $name =
"CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminaltouse;
308 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskBankAccountFor").
' '.$langs->trans($modep->label).
'</td>';
313 $cour = preg_match(
'/^LIQ.*/', $modep->code) ? 2 : 1;
315 print
'<span class="opacitymedium">'.$form->textwithpicto($langs->trans(
"NotAvailable"), $langs->trans(
"NotAvailableForCountryWhenModuleIsOn",
$mysoc->country_code, $langs->transnoentitiesnoconv(
'Module3200Name'))).
'</span>';
317 print
img_picto(
'',
'bank_account',
'class="pictofixedwidth"');
318 print $form->select_comptes(
getDolGlobalInt($name), $name, 0,
"courant=".$cour, 1,
'', 0,
'maxwidth500 widthcentpercentminusxx', 1);
319 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>';
326 print
'<tr class="oddeven"><td>';
327 print $form->textwithpicto($langs->trans(
"CashDeskDoNotDecreaseStock"), $langs->trans(
"CashDeskDoNotDecreaseStockHelp"));
331 print ajax_constantonoff(
'CASHDESK_NO_DECREASE_STOCK'.$terminal, array(), $conf->entity, 0, 0, 1, 0);
338 print
'<tr class="oddeven"><td>';
340 print
'<span class="fieldrequired">';
342 print $langs->trans(
"CashDeskIdWareHouse");
347 print
img_warning($langs->trans(
"DisableStockChange").
' - '.$langs->trans(
"NoWarehouseDefinedForTerminal"));
350 print
'<td class="minwidth300">';
352 print
img_picto(
'',
'stock',
'class="pictofixedwidth"');
353 print $formproduct->selectWarehouses(
getDolGlobalString(
'CASHDESK_ID_WAREHOUSE'.$terminal),
'CASHDESK_ID_WAREHOUSE'.$terminal,
'', 1, $disabled, 0,
'', 0, 0, array(),
'maxwidth500 widthcentpercentminusxx');
354 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>';
356 print
'<span class="opacitymedium">'.$langs->trans(
"StockDecreaseForPointOfSaleDisabled").
'</span>';
362 print
'<tr class="oddeven"><td>'.$langs->trans(
'CashDeskForceDecreaseStockLabel').
'</td>';
364 print
'<span class="opacitymedium">'.$langs->trans(
'CashDeskForceDecreaseStockDesc').
'</span>';
370 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
372 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskDefaultProject").
'</td><td>';
373 print
img_picto(
'',
'project',
'class="pictofixedwidth"');
376 print $formproject->select_projects(-1, (
string) $projectid,
'projectid', 0, 0, 1, 1, 0, 0, 0,
'', 1, 1,
'maxwidth500 widthcentpercentminusxx');
380print
'<tr class="oddeven"><td>'.$langs->trans(
'CashDeskReaderKeyCodeForEnter').
'</td>';
382print
'<input type="text" class="width50" name="CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse.
'" value="'.
getDolGlobalString(
'CASHDESK_READER_KEYCODE_FOR_ENTER'.$terminaltouse).
'" />';
387 print
'<tr class="oddeven"><td>';
388 print $langs->trans(
"BillsNumberingModule");
389 print
'<td colspan="2">';
390 $array = array(0 => $langs->trans(
"Default"));
391 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
392 foreach ($dirmodels as $reldir) {
395 $handle = opendir($dir);
396 if (is_resource($handle)) {
397 while (($file = readdir($handle)) !==
false) {
398 if (!is_dir($dir.$file) || (substr($file, 0, 1) !=
'.' && substr($file, 0, 3) !=
'CVS')) {
400 $classname = preg_replace(
'/\.php$/',
'', $file);
402 if (!is_file($dir.$filebis)) {
403 $filebis = $file.
"/".$file.
".modules.php";
404 $classname =
"mod_facture_".$file;
408 preg_match(
'/\-(.*)_(.*)$/', $classname, $reg);
409 if (!empty($reg[2]) && $reg[2] != strtoupper(
$mysoc->country_code)) {
413 $classname = preg_replace(
'/\-.*$/',
'', $classname);
414 if (!class_exists($classname) && is_readable($dir.$filebis) && (preg_match(
'/mod_/', $filebis) || preg_match(
'/mod_/', $classname)) && substr($filebis,
dol_strlen($filebis) - 3, 3) ==
'php') {
416 require_once $dir.$filebis;
418 $module =
new $classname($db);
419 '@phan-var-force ModeleNumRefFactures $module';
422 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
425 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
429 if ($module->isEnabled()) {
430 $array[preg_replace(
'/\-.*$/',
'', preg_replace(
'/\.php$/',
'', $file))] = preg_replace(
'/\-.*$/',
'', preg_replace(
'/mod_facture_/',
'', preg_replace(
'/\.php$/',
'', $file)));
439 print $form->selectarray(
'TAKEPOS_ADDON'.$terminaltouse, $array,
getDolGlobalString(
'TAKEPOS_ADDON'.$terminaltouse,
'0'), 0);
440 print
"</td></tr>\n";
445$customprinterallowed =
true;
447$customprinttemplateallowed =
true;
448include_once DOL_DOCUMENT_ROOT.
'/blockedlog/lib/blockedlog.lib.php';
450 $customprinttemplateallowed =
false;
455 require_once DOL_DOCUMENT_ROOT.
'/core/class/dolreceiptprinter.class.php';
458 $printer->listprinters();
460 foreach ($printer->listprinters as $key => $value) {
461 $printers[$value[
'rowid']] = $value[
'name'];
463 print
'<tr class="oddeven"><td>'.$langs->trans(
"MainPrinterToUse");
464 print
' <span class="opacitymedium">('.$langs->trans(
"MainPrinterToUseMore").
')</span>';
467 if (!$customprinterallowed) {
468 print
'<span class="opacitymedium">'.$form->textwithpicto($langs->trans(
"NotAvailable"), $langs->trans(
"NotAvailableForCountryWhenModuleIsOn",
$mysoc->country_code, $langs->transnoentitiesnoconv(
'Module3200Name'))).
'</span>';
470 print $form->selectarray(
'TAKEPOS_PRINTER_TO_USE'.$terminal, $printers,
getDolGlobalInt(
'TAKEPOS_PRINTER_TO_USE'.$terminal), 1);
475 print
'<tr class="oddeven"><td>'.$langs->trans(
"OrderPrinterToUse").
' - '.$langs->trans(
"KitchenPrinter").
' 1</td>';
477 print $form->selectarray(
'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal, $printers,
getDolGlobalInt(
'TAKEPOS_ORDER_PRINTER1_TO_USE'.$terminal), 1);
479 print
'<tr class="oddeven"><td>'.$langs->trans(
"OrderPrinterToUse").
' - '.$langs->trans(
"KitchenPrinter").
' 2</td>';
481 print $form->selectarray(
'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal, $printers,
getDolGlobalInt(
'TAKEPOS_ORDER_PRINTER2_TO_USE'.$terminal), 1);
483 print
'<tr class="oddeven"><td>'.$langs->trans(
"OrderPrinterToUse").
' - '.$langs->trans(
"KitchenPrinter").
' 3</td>';
485 print $form->selectarray(
'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal, $printers,
getDolGlobalInt(
'TAKEPOS_ORDER_PRINTER3_TO_USE'.$terminal), 1);
492 require_once DOL_DOCUMENT_ROOT.
'/core/class/dolreceiptprinter.class.php';
494 $printer->listPrintersTemplates();
495 $templates = array();
496 foreach ($printer->listprinterstemplates as $key => $value) {
497 $templates[$value[
'rowid']] = $value[
'name'];
499 print
'<tr class="oddeven"><td>'.$langs->trans(
"MainTemplateToUse");
500 print
' <span class="opacitymedium">('.$langs->trans(
"MainTemplateToUseMore").
')</span>';
501 if ($customprinttemplateallowed) {
502 print
' (<a href="'.DOL_URL_ROOT.
'/admin/receiptprinter.php?mode=template">'.$langs->trans(
"SetupReceiptTemplate").
'</a>)</td>';
505 if (!$customprinttemplateallowed) {
506 print
'<span class="opacitymedium">'.$form->textwithpicto($langs->trans(
"NotAvailable"), $langs->trans(
"NotAvailableForCountryWhenModuleIsOn",
$mysoc->country_code, $langs->transnoentitiesnoconv(
'Module3200Name'))).
'</span>';
508 print $form->selectarray(
'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal, $templates,
getDolGlobalInt(
'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$terminal), 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth150');
512 if (
getDolGlobalInt(
'TAKEPOS_ORDER_PRINTERS') && $orderprinterallowed) {
513 print
'<tr class="oddeven"><td>'.$langs->trans(
"OrderTemplateToUse").
'</td>';
515 print $form->selectarray(
'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal, $templates,
getDolGlobalInt(
'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$terminal), 1, 0, 0,
'', 0, 0, 0,
'',
'minwidth150');
523print $form->buttonsSaveCancel(
"Save",
'');
530$substitutionarray[
'__(AnyTranslationKey)__'] = $langs->trans(
'Translation');
531$htmltext =
'<i>'.$langs->trans(
'AvailableVariables').
':<br>';
532foreach ($substitutionarray as $key => $val) {
533 $htmltext .= $key.
'<br>';
540print
'<div class="div-table-responsive-no-min">';
541print
'<table class="noborder centpercent">';
542print
'<tr class="liste_titre">';
543print
'<td>'.$langs->trans(
"Parameters").
'</td><td>'.$langs->trans(
'Value').
'</td>';
547print
'<tr class="oddeven">';
549print $form->textwithpicto($langs->trans(
'Header'), $htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
552$variablename =
'TAKEPOS_HEADER'.$terminaltouse;
554 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
556 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
558 print $doleditor->Create();
563print
'<tr class="oddeven">';
565print $form->textwithpicto($langs->trans(
'Footer'), $htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
568$variablename =
'TAKEPOS_FOOTER'.$terminaltouse;
570 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
572 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
574 print $doleditor->Create();
582 print
info_admin($langs->trans(
"AtLeastOneDefaultBankAccountMandatory"), 0, 0,
'error');
585print $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).
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
isALNERunningVersion($blockedlogtestalreadydone=0)
Return if the application is executed with the LNE requirements on.
Class to manage a WYSIWYG editor.
Stripe class @TODO No reason to extend CommonObject.
Class to manage Receipt Printers.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_htmloutput_mesg($mesgstring='', $mesgarray=array(), $style='ok', $keepembedded=0)
Print formatted messages to output (Used to show messages on html output).
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
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.