29require
'../../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
33require_once DOL_DOCUMENT_ROOT.
"/core/lib/takepos.lib.php";
40$langs->loadLangs(array(
"admin",
"cashdesk",
"commercial"));
47if (
GETPOST(
'action',
'alpha') ==
'set') {
50 $res =
dolibarr_set_const($db,
"TAKEPOS_HEADER",
GETPOST(
'TAKEPOS_HEADER',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
51 $res =
dolibarr_set_const($db,
"TAKEPOS_FOOTER",
GETPOST(
'TAKEPOS_FOOTER',
'restricthtml'),
'chaine', 0,
'', $conf->entity);
52 $res =
dolibarr_set_const($db,
"TAKEPOS_RECEIPT_NAME",
GETPOST(
'TAKEPOS_RECEIPT_NAME',
'alpha'),
'chaine', 0,
'', $conf->entity);
53 $res =
dolibarr_set_const($db,
"TAKEPOS_PRINT_SERVER",
GETPOST(
'TAKEPOS_PRINT_SERVER',
'alpha'),
'chaine', 0,
'', $conf->entity);
54 $res =
dolibarr_set_const($db,
'TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT',
GETPOST(
'TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT',
'alphanohtml'),
'chaine', 0,
'', $conf->entity);
69} elseif (
GETPOST(
'action',
'alpha') ==
'setmethod') {
72 if (
getDolGlobalString(
'TAKEPOS_PRINT_METHOD') ==
"takeposconnector" && !isModEnabled(
'receiptprinter')) {
85llxHeader(
'', $langs->trans(
"CashDeskSetup"),
'',
'', 0, 0,
'',
'',
'',
'mod-takepos page-admin_receipt');
87$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php">'.$langs->trans(
"BackToModuleList").
'</a>';
88print
load_fiche_titre($langs->trans(
"CashDeskSetup").
' (TakePOS)', $linkback,
'title_setup');
92print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?terminal='.(empty($terminal) ? 1 : $terminal).
'" method="post">';
93print
'<input type="hidden" name="token" value="'.newToken().
'">';
94print
'<input type="hidden" name="action" value="set">';
98print
'<div class="div-table-responsive-no-min">';
99print
'<table class="noborder centpercent">';
100print
'<tr class="liste_titre">';
101print
'<td>'.$langs->trans(
"Parameters").
'</td><td>'.$langs->trans(
"Value").
'</td>';
105print
'<tr class="oddeven"><td>';
106print $langs->trans(
'TicketVatGrouped');
107print
'<td colspan="2">';
108print ajax_constantonoff(
"TAKEPOS_TICKET_VAT_GROUPPED", array(), $conf->entity, 0, 0, 1, 0);
112 $substitutionarray =
pdf_getSubstitutionArray($langs, array(
'ticket',
'member',
'candidate'),
null, 2, array(
'company',
'user',
'object',
'system'));
113 $substitutionarray[
'__(AnyTranslationKey)__'] = $langs->trans(
"Translation");
115 $htmltext =
'<i>'.$langs->trans(
"AvailableVariables").
':<br>';
116 foreach ($substitutionarray as $key => $val) {
117 $htmltext .= $key.
'<br>';
121 print
'<tr class="oddeven"><td>';
122 print $form->textwithpicto($langs->trans(
"FreeLegalTextOnInvoices").
" - ".$langs->trans(
"Header"), $htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
124 $variablename =
'TAKEPOS_HEADER';
126 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
128 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
130 print $doleditor->Create();
132 print
"</td></tr>\n";
134 print
'<tr class="oddeven"><td>';
135 print $form->textwithpicto($langs->trans(
"FreeLegalTextOnInvoices").
" - ".$langs->trans(
"Footer"), $htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
137 $variablename =
'TAKEPOS_FOOTER';
139 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
141 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
143 print $doleditor->Create();
145 print
"</td></tr>\n";
147 print
'<tr class="oddeven"><td><label for="receipt_name">'.$langs->trans(
"ReceiptName").
'</label></td><td>';
148 print
'<input name="TAKEPOS_RECEIPT_NAME" id="TAKEPOS_RECEIPT_NAME" class="minwidth200" value="'.getDolGlobalString(
'TAKEPOS_RECEIPT_NAME').
'">';
152 print
'<tr class="oddeven"><td>';
153 print $langs->trans(
'PrintCustomerOnReceipts');
154 print
'<td colspan="2">';
155 print ajax_constantonoff(
"TAKEPOS_SHOW_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0);
156 print
"</td></tr>\n";
159 print
'<tr class="oddeven"><td>';
160 print $langs->trans(
'PrintPaymentMethodOnReceipts');
161 print
'<td colspan="2">';
162 print ajax_constantonoff(
"TAKEPOS_PRINT_PAYMENT_METHOD", array(), $conf->entity, 0, 0, 1, 0);
163 print
"</td></tr>\n";
167print
'<tr class="oddeven"><td>';
168print $langs->trans(
'ShowPriceHTOnReceipt');
169print
'<td colspan="2">';
170print ajax_constantonoff(
"TAKEPOS_SHOW_HT_RECEIPT", array(), $conf->entity, 0, 0, 1, 0);
174 print
'<tr class="oddeven"><td>';
175 print $langs->trans(
'WeighingScale');
176 print
'<td colspan="2">';
177 print ajax_constantonoff(
"TAKEPOS_WEIGHING_SCALE", array(), $conf->entity, 0, 0, 1, 0);
178 print
"</td></tr>\n";
182 print
'<tr class="oddeven"><td>';
183 print $langs->trans(
'CustomerDisplay');
184 print
'<td colspan="2">';
185 print ajax_constantonoff(
"TAKEPOS_CUSTOMER_DISPLAY", array(), $conf->entity, 0, 0, 1, 0);
186 print
"</td></tr>\n";
190print
'<tr class="oddeven"><td>';
191print $langs->trans(
'PrintWithoutDetailsButton');
192print
'<td colspan="2">';
193print ajax_constantonoff(
'TAKEPOS_PRINT_WITHOUT_DETAILS', array(), $conf->entity, 0, 0, 1, 0);
196 print
'<tr class="oddeven"><td>';
197 print $langs->trans(
'PrintWithoutDetailsLabelDefault');
198 print
'<td colspan="2">';
199 print
'<input type="text" name="TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT" value="' .
getDolGlobalString(
'TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT') .
'" />';
200 print
"</td></tr>\n";
204print
'<tr class="oddeven"><td>';
205print $langs->trans(
"AutoPrintTickets");
206print
'<td colspan="2">';
207print ajax_constantonoff(
"TAKEPOS_AUTO_PRINT_TICKETS", array(), $conf->entity, 0, 0, 1, 0);
214print $form->buttonsSaveCancel(
"Save",
'');
223print
'<div style="width: 50%; float:center;background-color:#606060">';
225print
'<iframe id="iframe" allowtransparency="true" style="background: #FFFFFF;" src="../receipt.php" 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).
activateModule($value, $withdeps=1, $noconfverification=0)
Enable a module.
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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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.