29 require
'../../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
"/core/lib/takepos.lib.php";
40 $langs->loadLangs(array(
"admin",
"cashdesk",
"commercial"));
47 if (
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') {
85 llxHeader(
'', $langs->trans(
"CashDeskSetup"));
87 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php">'.$langs->trans(
"BackToModuleList").
'</a>';
88 print
load_fiche_titre($langs->trans(
"CashDeskSetup").
' (TakePOS)', $linkback,
'title_setup');
92 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?terminal='.(empty($terminal) ? 1 : $terminal).
'" method="post">';
93 print
'<input type="hidden" name="token" value="'.newToken().
'">';
94 print
'<input type="hidden" name="action" value="set">';
98 print
'<div class="div-table-responsive-no-min">';
99 print
'<table class="noborder centpercent">';
100 print
'<tr class="liste_titre">';
101 print
'<td>'.$langs->trans(
"Parameters").
'</td><td>'.$langs->trans(
"Value").
'</td>';
105 print
'<tr class="oddeven"><td>';
106 print $langs->trans(
'TicketVatGrouped');
107 print
'<td colspan="2">';
108 print
ajax_constantonoff(
"TAKEPOS_TICKET_VAT_GROUPPED", array(), $conf->entity, 0, 0, 1, 0);
109 print
"</td></tr>\n";
113 $substitutionarray[
'__(AnyTranslationKey)__'] = $langs->trans(
"Translation");
114 $htmltext =
'<i>'.$langs->trans(
"AvailableVariables").
':<br>';
115 foreach ($substitutionarray as $key => $val) {
116 $htmltext .= $key.
'<br>';
120 print
'<tr class="oddeven"><td>';
121 print
$form->textwithpicto($langs->trans(
"FreeLegalTextOnInvoices").
" - ".$langs->trans(
"Header"), $htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
123 $variablename =
'TAKEPOS_HEADER';
125 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
127 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
129 print $doleditor->Create();
131 print
"</td></tr>\n";
133 print
'<tr class="oddeven"><td>';
134 print
$form->textwithpicto($langs->trans(
"FreeLegalTextOnInvoices").
" - ".$langs->trans(
"Footer"), $htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
136 $variablename =
'TAKEPOS_FOOTER';
138 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
140 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
142 print $doleditor->Create();
144 print
"</td></tr>\n";
146 print
'<tr class="oddeven"><td><label for="receipt_name">'.$langs->trans(
"ReceiptName").
'</label></td><td>';
147 print
'<input name="TAKEPOS_RECEIPT_NAME" id="TAKEPOS_RECEIPT_NAME" class="minwidth200" value="'.getDolGlobalString(
'TAKEPOS_RECEIPT_NAME').
'">';
151 print
'<tr class="oddeven"><td>';
152 print $langs->trans(
'PrintCustomerOnReceipts');
153 print
'<td colspan="2">';
154 print
ajax_constantonoff(
"TAKEPOS_SHOW_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0);
155 print
"</td></tr>\n";
158 print
'<tr class="oddeven"><td>';
159 print $langs->trans(
'PrintPaymentMethodOnReceipts');
160 print
'<td colspan="2">';
161 print
ajax_constantonoff(
"TAKEPOS_PRINT_PAYMENT_METHOD", array(), $conf->entity, 0, 0, 1, 0);
162 print
"</td></tr>\n";
166 print
'<tr class="oddeven"><td>';
167 print $langs->trans(
"AutoPrintTickets");
168 print
'<td colspan="2">';
169 print
ajax_constantonoff(
"TAKEPOS_AUTO_PRINT_TICKETS", array(), $conf->entity, 0, 0, 1, 0);
170 print
"</td></tr>\n";
174 print
'<tr class="oddeven"><td>';
175 print $langs->trans(
'ShowPriceHTOnReceipt');
176 print
'<td colspan="2">';
177 print
ajax_constantonoff(
"TAKEPOS_SHOW_HT_RECEIPT", array(), $conf->entity, 0, 0, 1, 0);
178 print
"</td></tr>\n";
181 print
'<tr class="oddeven"><td>';
182 print $langs->trans(
'WeighingScale');
183 print
'<td colspan="2">';
184 print
ajax_constantonoff(
"TAKEPOS_WEIGHING_SCALE", array(), $conf->entity, 0, 0, 1, 0);
185 print
"</td></tr>\n";
189 print
'<tr class="oddeven"><td>';
190 print $langs->trans(
'CustomerDisplay');
191 print
'<td colspan="2">';
192 print
ajax_constantonoff(
"TAKEPOS_CUSTOMER_DISPLAY", array(), $conf->entity, 0, 0, 1, 0);
193 print
"</td></tr>\n";
197 print
'<tr class="oddeven"><td>';
198 print $langs->trans(
'PrintWithoutDetailsButton');
199 print
'<td colspan="2">';
200 print
ajax_constantonoff(
'TAKEPOS_PRINT_WITHOUT_DETAILS', array(), $conf->entity, 0, 0, 1, 0);
201 print
"</td></tr>\n";
203 print
'<tr class="oddeven"><td>';
204 print $langs->trans(
'PrintWithoutDetailsLabelDefault');
205 print
'<td colspan="2">';
206 print
'<input type="text" name="TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT" value="' .
getDolGlobalString(
'TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT') .
'" />';
207 print
"</td></tr>\n";
215 print
$form->buttonsSaveCancel(
"Save",
'');
220 print
'<div style="width: 50%; float:center;background-color:#606060">';
222 print
'<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)
Enable a module.
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='', $morecss='')
On/off button for constant.
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.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
load_fiche_titre($titre, $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='')
Show tabs of a record.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return 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)
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.