30require
'../../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
41require_once DOL_DOCUMENT_ROOT.
"/core/lib/takepos.lib.php";
42require_once DOL_DOCUMENT_ROOT.
"/blockedlog/lib/blockedlog.lib.php";
43require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
50$langs->loadLangs(array(
"admin",
"cashdesk",
"commercial"));
58if (
GETPOST(
'action',
'alpha') ==
'set') {
65 $res =
dolibarr_set_const(
$db,
'TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT',
GETPOST(
'TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT',
'alphanohtml'),
'chaine', 0,
'',
$conf->entity);
80} elseif (
GETPOST(
'action',
'alpha') ==
'setmethod') {
84 activateModule(
"modReceiptPrinter", 1, 0);
95llxHeader(
'', $langs->trans(
"CashDeskSetup"),
'',
'', 0, 0,
'',
'',
'',
'mod-takepos page-admin_receipt');
97$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>';
99print
load_fiche_titre($langs->trans(
"CashDeskSetup").
' (TakePOS)', $linkback,
'title_setup');
104print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
105print
'<input type="hidden" name="token" value="'.newToken().
'">';
106print
'<input type="hidden" name="action" value="set">';
110print
'<div class="div-table-responsive-no-min">';
111print
'<table class="noborder centpercent">';
112print
'<tr class="liste_titre">';
113print
'<td>'.$langs->trans(
"Parameters").
'</td><td>'.$langs->trans(
"Value").
'</td>';
117print
'<tr class="oddeven"><td>';
118print $langs->trans(
'TicketVatGrouped');
119print
'<td colspan="2">';
122 $conf->global->TAKEPOS_TICKET_VAT_GROUPPED = 1;
123 print
img_picto($langs->trans(
"Enabled"),
'switch_on',
'class="opacitymedium valignmiddle"');
124 print
' <span class="opacitymedium valignmiddle">'.$langs->trans(
"Always").
'</span>';
126 print ajax_constantonoff(
"TAKEPOS_TICKET_VAT_GROUPPED", array(),
$conf->entity, 0, 0, 1, 0);
131 $substitutionarray =
pdf_getSubstitutionArray($langs, array(
'ticket',
'member',
'candidate',
'shipping'),
null, 2, array(
'mycompany',
'company',
'user',
'object',
'system'));
132 $substitutionarray[
'__(AnyTranslationKey)__'] = $langs->trans(
"Translation");
134 $htmltext =
'<i class="small">'.$langs->trans(
"AvailableVariables").
':<br>';
135 foreach ($substitutionarray as $key => $val) {
136 $htmltext .= $key.
'<br>';
140 print
'<tr class="oddeven"><td>';
141 print $form->textwithpicto($langs->trans(
"FreeLegalTextOnInvoices").
" - ".$langs->trans(
"Header"), $htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
143 $variablename =
'TAKEPOS_HEADER';
145 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
147 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
149 print $doleditor->Create();
151 print
"</td></tr>\n";
153 print
'<tr class="oddeven"><td>';
154 print $form->textwithpicto($langs->trans(
"FreeLegalTextOnInvoices").
" - ".$langs->trans(
"Footer"), $htmltext, 1,
'help',
'', 0, 2,
'freetexttooltip').
'<br>';
156 $variablename =
'TAKEPOS_FOOTER';
158 print
'<textarea name="'.$variablename.
'" class="flat" cols="120">'.
getDolGlobalString($variablename).
'</textarea>';
160 include_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
162 print $doleditor->Create();
164 print
"</td></tr>\n";
166 print
'<tr class="oddeven"><td><label for="receipt_name">'.$langs->trans(
"ReceiptName").
'</label></td><td>';
167 print
'<input name="TAKEPOS_RECEIPT_NAME" id="TAKEPOS_RECEIPT_NAME" class="minwidth200" value="'.getDolGlobalString(
'TAKEPOS_RECEIPT_NAME').
'">';
171 print
'<tr class="oddeven"><td>';
172 print $langs->trans(
'PrintCustomerOnReceipts');
173 print
'<td colspan="2">';
174 print ajax_constantonoff(
"TAKEPOS_SHOW_CUSTOMER", array(),
$conf->entity, 0, 0, 1, 0);
175 print
"</td></tr>\n";
179 print
'<tr class="oddeven"><td>';
180 print $langs->trans(
'PrintPaymentMethodOnReceipts');
181 print
'<td colspan="2">';
182 include_once DOL_DOCUMENT_ROOT.
'/blockedlog/lib/blockedlog.lib.php';
184 $conf->global->TAKEPOS_PRINT_PAYMENT_METHOD = 1;
185 print ajax_constantonoff(
"TAKEPOS_PRINT_PAYMENT_METHOD", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'',
'',
'inline-block', 0,
'', 1);
186 print
'<span class="opacitymedium">'.$langs->trans(
"Always").
'</span>';
188 print ajax_constantonoff(
"TAKEPOS_PRINT_PAYMENT_METHOD", array(),
$conf->entity, 0, 0, 1, 0);
190 print
"</td></tr>\n";
194print
'<tr class="oddeven"><td>';
195print $langs->trans(
'ShowPriceHTOnReceipt');
196print
'<td colspan="2">';
198 $conf->global->TAKEPOS_SHOW_HT_RECEIPT = 1;
199 print ajax_constantonoff(
"TAKEPOS_SHOW_HT_RECEIPT", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'',
'',
'inline-block', 0,
'', 1);
200 print
'<span class="opacitymedium">'.$langs->trans(
"Always").
'</span>';
202 print ajax_constantonoff(
"TAKEPOS_SHOW_HT_RECEIPT", array(),
$conf->entity, 0, 0, 1, 0);
207 print
'<tr class="oddeven"><td>';
208 print $langs->trans(
'WeighingScale');
209 print
'<td colspan="2">';
210 print ajax_constantonoff(
"TAKEPOS_WEIGHING_SCALE", array(),
$conf->entity, 0, 0, 1, 0);
211 print
"</td></tr>\n";
215 print
'<tr class="oddeven"><td>';
216 print $langs->trans(
'CustomerDisplay');
217 print
'<td colspan="2">';
218 print ajax_constantonoff(
"TAKEPOS_CUSTOMER_DISPLAY", array(),
$conf->entity, 0, 0, 1, 0);
219 print
"</td></tr>\n";
224 print
'<tr class="oddeven"><td>';
225 print $langs->trans(
'PrintWithoutDetailsButton');
226 print
'<td colspan="2">';
229 $conf->global->TAKEPOS_PRINT_WITHOUT_DETAILS = 1;
230 print
img_picto($langs->trans(
"Disabled"),
'switch_off',
'class="opacitymedium valignmiddle"');
231 print
' <span class="opacitymedium valignmiddle">'.$form->textwithpicto($langs->trans(
"NotAvailable"), $langs->trans(
"NotAvailableForCountryWhenModuleIsOn",
$mysoc->country_code, $langs->transnoentitiesnoconv(
'Module3200Name'))).
'</span>';
233 print ajax_constantonoff(
'TAKEPOS_PRINT_WITHOUT_DETAILS', array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'',
'',
'inline-block', 0,
'');
235 print
"</td></tr>\n";
238 print
'<tr class="oddeven"><td>';
239 print $langs->trans(
'PrintWithoutDetailsLabelDefault');
240 print
'<td colspan="2">';
241 print
'<input type="text" name="TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT" value="' .
getDolGlobalString(
'TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT') .
'" />';
242 print
"</td></tr>\n";
247print
'<tr class="oddeven"><td>';
248print $langs->trans(
'GiftReceiptButton');
251 print ajax_constantonoff(
"TAKEPOS_GIFT_RECEIPT", array(),
$conf->entity, 0, 0, 1, 0, 0, 0,
'',
'',
'inline-block', 0,
'', 1);
252 print
'<span class="opacitymedium">'.$form->textwithpicto($langs->trans(
"NotAvailable"), $langs->trans(
"NotAvailableForCountryWhenModuleIsOn",
$mysoc->country_code, $langs->transnoentitiesnoconv(
'Module3200Name'))).
'</span>';
254 print ajax_constantonoff(
"TAKEPOS_GIFT_RECEIPT", array(),
$conf->entity, 0, 0, 1, 0);
259print
'<tr class="oddeven"><td>';
260print $langs->trans(
"AutoPrintTickets");
261print
'<td colspan="2">';
262print ajax_constantonoff(
"TAKEPOS_AUTO_PRINT_TICKETS", array(),
$conf->entity, 0, 0, 1, 0);
269print $form->buttonsSaveCancel(
"Save",
'');
278print
'<div style="width: 50%; float:center;background-color:#606060">';
282print
'<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, $blockedlogmodulealreadydone=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.