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.
"/core/lib/takepos.lib.php";
49$langs->loadLangs(array(
"admin",
"cashdesk",
"commercial"));
57if (
GETPOST(
'action',
'alpha') ==
'set') {
60 $res =
dolibarr_set_const($db,
"TAKEPOS_HEADER",
GETPOST(
'TAKEPOS_HEADER',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
61 $res =
dolibarr_set_const($db,
"TAKEPOS_FOOTER",
GETPOST(
'TAKEPOS_FOOTER',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
62 $res =
dolibarr_set_const($db,
"TAKEPOS_RECEIPT_NAME",
GETPOST(
'TAKEPOS_RECEIPT_NAME',
'alpha'),
'chaine', 0,
'', $conf->entity);
63 $res =
dolibarr_set_const($db,
"TAKEPOS_PRINT_SERVER",
GETPOST(
'TAKEPOS_PRINT_SERVER',
'alpha'),
'chaine', 0,
'', $conf->entity);
64 $res =
dolibarr_set_const($db,
'TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT',
GETPOST(
'TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT',
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
79} elseif (
GETPOST(
'action',
'alpha') ==
'setmethod') {
83 activateModule(
"modReceiptPrinter");
94llxHeader(
'', $langs->trans(
"CashDeskSetup"),
'',
'', 0, 0,
'',
'',
'',
'mod-takepos page-admin_receipt');
96$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>';
98print
load_fiche_titre($langs->trans(
"CashDeskSetup").
' (TakePOS)', $linkback,
'title_setup');
103print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
104print
'<input type="hidden" name="token" value="'.newToken().
'">';
105print
'<input type="hidden" name="action" value="set">';
109print
'<div class="div-table-responsive-no-min">';
110print
'<table class="noborder centpercent">';
111print
'<tr class="liste_titre">';
112print
'<td>'.$langs->trans(
"Parameters").
'</td><td>'.$langs->trans(
"Value").
'</td>';
116print
'<tr class="oddeven"><td>';
117print $langs->trans(
'TicketVatGrouped');
118print
'<td colspan="2">';
119print ajax_constantonoff(
"TAKEPOS_TICKET_VAT_GROUPPED", array(), $conf->entity, 0, 0, 1, 0);
123 $substitutionarray =
pdf_getSubstitutionArray($langs, array(
'ticket',
'member',
'candidate'),
null, 2, array(
'company',
'user',
'object',
'system'));
124 $substitutionarray[
'__(AnyTranslationKey)__'] = $langs->trans(
"Translation");
126 $htmltext =
'<i class="small">'.$langs->trans(
"AvailableVariables").
':<br>';
127 foreach ($substitutionarray as $key => $val) {
128 $htmltext .= $key.
'<br>';
132 print
'<tr class="oddeven"><td>';
133 print $form->textwithpicto($langs->trans(
"FreeLegalTextOnInvoices").
" - ".$langs->trans(
"Header"), $htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
135 $variablename =
'TAKEPOS_HEADER';
137 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
139 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
141 print $doleditor->Create();
143 print
"</td></tr>\n";
145 print
'<tr class="oddeven"><td>';
146 print $form->textwithpicto($langs->trans(
"FreeLegalTextOnInvoices").
" - ".$langs->trans(
"Footer"), $htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
148 $variablename =
'TAKEPOS_FOOTER';
150 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
152 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
154 print $doleditor->Create();
156 print
"</td></tr>\n";
158 print
'<tr class="oddeven"><td><label for="receipt_name">'.$langs->trans(
"ReceiptName").
'</label></td><td>';
159 print
'<input name="TAKEPOS_RECEIPT_NAME" id="TAKEPOS_RECEIPT_NAME" class="minwidth200" value="'.getDolGlobalString(
'TAKEPOS_RECEIPT_NAME').
'">';
163 print
'<tr class="oddeven"><td>';
164 print $langs->trans(
'PrintCustomerOnReceipts');
165 print
'<td colspan="2">';
166 print ajax_constantonoff(
"TAKEPOS_SHOW_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0);
167 print
"</td></tr>\n";
171 print
'<tr class="oddeven"><td>';
172 print $langs->trans(
'PrintPaymentMethodOnReceipts');
173 print
'<td colspan="2">';
174 include_once DOL_DOCUMENT_ROOT.
'/blockedlog/lib/blockedlog.lib.php';
176 $conf->global->TAKEPOS_PRINT_PAYMENT_METHOD = 1;
177 print ajax_constantonoff(
"TAKEPOS_PRINT_PAYMENT_METHOD", array(), $conf->entity, 0, 0, 1, 0, 0, 0,
'',
'',
'inline-block', 0,
'', 1);
178 print
'<span class="opacitymedium">'.$langs->trans(
"Always").
'</span>';
180 print ajax_constantonoff(
"TAKEPOS_PRINT_PAYMENT_METHOD", array(), $conf->entity, 0, 0, 1, 0);
182 print
"</td></tr>\n";
186print
'<tr class="oddeven"><td>';
187print $langs->trans(
'ShowPriceHTOnReceipt');
188print
'<td colspan="2">';
190 $conf->global->TAKEPOS_PRINT_PAYMENT_METHOD = 1;
191 print ajax_constantonoff(
"TAKEPOS_SHOW_HT_RECEIPT", array(), $conf->entity, 0, 0, 1, 0, 0, 0,
'',
'',
'inline-block', 0,
'', 1);
192 print
'<span class="opacitymedium">'.$langs->trans(
"Always").
'</span>';
194 print ajax_constantonoff(
"TAKEPOS_SHOW_HT_RECEIPT", array(), $conf->entity, 0, 0, 1, 0);
199 print
'<tr class="oddeven"><td>';
200 print $langs->trans(
'WeighingScale');
201 print
'<td colspan="2">';
202 print ajax_constantonoff(
"TAKEPOS_WEIGHING_SCALE", array(), $conf->entity, 0, 0, 1, 0);
203 print
"</td></tr>\n";
207 print
'<tr class="oddeven"><td>';
208 print $langs->trans(
'CustomerDisplay');
209 print
'<td colspan="2">';
210 print ajax_constantonoff(
"TAKEPOS_CUSTOMER_DISPLAY", array(), $conf->entity, 0, 0, 1, 0);
211 print
"</td></tr>\n";
215print
'<tr class="oddeven"><td>';
216print $langs->trans(
'PrintWithoutDetailsButton');
217print
'<td colspan="2">';
218print ajax_constantonoff(
'TAKEPOS_PRINT_WITHOUT_DETAILS', array(), $conf->entity, 0, 0, 1, 0, 0, 0,
'',
'',
'inline-block', 0,
'');
221 print
'<tr class="oddeven"><td>';
222 print $langs->trans(
'PrintWithoutDetailsLabelDefault');
223 print
'<td colspan="2">';
224 print
'<input type="text" name="TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT" value="' .
getDolGlobalString(
'TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT') .
'" />';
225 print
"</td></tr>\n";
229print
'<tr class="oddeven"><td>';
230print $langs->trans(
'GiftReceiptButton');
233 print ajax_constantonoff(
"TAKEPOS_GIFT_RECEIPT", array(), $conf->entity, 0, 0, 1, 0, 0, 0,
'',
'',
'inline-block', 0,
'', 1);
234 print
'<span class="opacitymedium">'.$form->textwithpicto($langs->trans(
"NotAvailable"), $langs->trans(
"NotAvailableForCountryWhenModuleIsOn",
$mysoc->country_code, $langs->transnoentitiesnoconv(
'Module3200Name'))).
'</span>';
236 print ajax_constantonoff(
"TAKEPOS_GIFT_RECEIPT", array(), $conf->entity, 0, 0, 1, 0);
241print
'<tr class="oddeven"><td>';
242print $langs->trans(
"AutoPrintTickets");
243print
'<td colspan="2">';
244print ajax_constantonoff(
"TAKEPOS_AUTO_PRINT_TICKETS", array(), $conf->entity, 0, 0, 1, 0);
251print $form->buttonsSaveCancel(
"Save",
'');
260print
'<div style="width: 50%; float:center;background-color:#606060">';
264print
'<iframe id="iframe" allowtransparency="true" style="background: #FFFFFF;" src="'.DOL_URL_ROOT.
'/takepos/receipt.php?forcenoautoopen=1&specimen=1" width="80%" height="600"></iframe>';
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.
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)
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
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.