Go to the documentation of this file.
27 require
'../../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
32 require_once DOL_DOCUMENT_ROOT.
"/core/lib/takepos.lib.php";
33 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
36 if (!empty($_REQUEST[
'CASHDESK_ID_THIRDPARTY_id'])) {
37 $_GET[
'CASHDESK_ID_THIRDPARTY'] =
GETPOST(
'CASHDESK_ID_THIRDPARTY_id',
'alpha');
38 $_POST[
'CASHDESK_ID_THIRDPARTY'] =
GETPOST(
'CASHDESK_ID_THIRDPARTY_id',
'alpha');
39 $_REQUEST[
'CASHDESK_ID_THIRDPARTY'] =
GETPOST(
'CASHDESK_ID_THIRDPARTY_id',
'alpha');
47 $langs->loadLangs(array(
"admin",
"cashdesk"));
51 $sql =
"SELECT code, libelle FROM ".MAIN_DB_PREFIX.
"c_paiement";
52 $sql .=
" WHERE entity IN (".getEntity(
'c_paiement').
")";
53 $sql .=
" AND active = 1";
54 $sql .=
" ORDER BY libelle";
58 while ($obj = $db->fetch_object(
$resql)) {
59 array_push($paiements, $obj);
63 $action =
GETPOST(
'action',
'aZ09');
72 if ($action ==
'set') {
75 $res =
dolibarr_set_const($db,
"TAKEPOS_ROOT_CATEGORY_ID",
GETPOST(
'TAKEPOS_ROOT_CATEGORY_ID',
'alpha'),
'chaine', 0,
'', $conf->entity);
76 $res =
dolibarr_set_const($db,
"TAKEPOS_SUPPLEMENTS_CATEGORY",
GETPOST(
'TAKEPOS_SUPPLEMENTS_CATEGORY',
'alpha'),
'chaine', 0,
'', $conf->entity);
78 $res =
dolibarr_set_const($db,
"TAKEPOS_SORTPRODUCTFIELD",
GETPOST(
'TAKEPOS_SORTPRODUCTFIELD',
'alpha'),
'chaine', 0,
'', $conf->entity);
79 $res =
dolibarr_set_const($db,
"TAKEPOS_NUM_TERMINALS",
GETPOST(
'TAKEPOS_NUM_TERMINALS',
'alpha'),
'chaine', 0,
'', $conf->entity);
81 $res =
dolibarr_set_const($db,
"TAKEPOS_EMAIL_TEMPLATE_INVOICE",
GETPOST(
'TAKEPOS_EMAIL_TEMPLATE_INVOICE',
'alpha'),
'chaine', 0,
'', $conf->entity);
83 $res =
dolibarr_set_const($db,
"TAKEPOS_SUMUP_AFFILIATE",
GETPOST(
'TAKEPOS_SUMUP_AFFILIATE',
'alpha'),
'chaine', 0,
'', $conf->entity);
84 $res =
dolibarr_set_const($db,
"TAKEPOS_SUMUP_APPID",
GETPOST(
'TAKEPOS_SUMUP_APPID',
'alpha'),
'chaine', 0,
'', $conf->entity);
87 $res =
dolibarr_set_const($db,
'TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT',
GETPOST(
'TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT',
'alpha'),
'chaine', 0,
'', $conf->entity);
101 } elseif ($action ==
'updateMask') {
102 $maskconst =
GETPOST(
'maskconst',
'alpha');
103 $maskvalue =
GETPOST(
'maskvalue',
'alpha');
105 $res =
dolibarr_set_const($db, $maskconst, $maskvalue,
'chaine', 0,
'', $conf->entity);
110 } elseif ($action ==
'setrefmod') {
111 $value =
GETPOST(
'value',
'alpha');
131 $help_url =
'EN:Module_Point_of_sale_(TakePOS)';
135 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php">'.$langs->trans(
"BackToModuleList").
'</a>';
136 print
load_fiche_titre($langs->trans(
"CashDeskSetup").
' (TakePOS)', $linkback,
'title_setup');
142 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
144 print
load_fiche_titre($langs->trans(
'CashDeskRefNumberingModules'),
'',
'');
146 print
'<table class="noborder centpercent">';
147 print
'<tr class="liste_titre">';
148 print
'<td>'.$langs->trans(
"Name").
"</td>\n";
149 print
'<td>'.$langs->trans(
"Description").
"</td>\n";
150 print
'<td class="nowrap">'.$langs->trans(
"Example").
"</td>\n";
151 print
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
152 print
'<td class="center" width="16">'.$langs->trans(
"ShortInfo").
'</td>';
157 foreach ($dirmodels as $reldir) {
161 $handle = opendir($dir);
162 if (is_resource($handle)) {
165 while (($file = readdir($handle)) !==
false) {
166 if (substr($file, 0, 16) ==
'mod_takepos_ref_' && substr($file,
dol_strlen($file) - 3, 3) ==
'php') {
167 $file = substr($file, 0,
dol_strlen($file) - 4);
169 require_once $dir.$file.
'.php';
174 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
177 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
181 if ($module->isEnabled()) {
182 print
'<tr class="oddeven"><td>'.$module->nom.
"</td><td>\n";
183 print $module->info();
187 print
'<td class="nowrap">';
188 $tmp = $module->getExample();
189 if (preg_match(
'/^Error/', $tmp)) {
190 $langs->load(
"errors");
191 print
'<div class="error">'.$langs->trans($tmp).
'</div>';
192 } elseif ($tmp ==
'NotConfigured') {
193 print $langs->trans($tmp);
199 print
'<td class="center">';
201 print
img_picto($langs->trans(
"Activated"),
'switch_on');
203 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=setrefmod&token='.
newToken().
'&value='.urlencode($file).
'">';
204 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
211 $invoice->date = $now;
212 $invoice->module_source =
'takepos';
213 $invoice->pos_source = 1;
217 $htmltooltip .=
''.$langs->trans(
"Version").
': <b>'.$module->getVersion().
'</b><br>';
218 $nextval = $module->getNextValue($mysoc, $invoice);
219 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
220 $htmltooltip .=
''.$langs->trans(
"NextValue").
': ';
222 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
223 $nextval = $langs->trans($nextval);
225 $htmltooltip .= $nextval.
'<br>';
227 $htmltooltip .= $langs->trans($module->error).
'<br>';
231 print
'<td align="center">';
232 print
$form->textwithpicto(
'', $htmltooltip, 1, 0);
243 print
"</table><br>\n";
248 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
249 print
'<input type="hidden" name="token" value="'.newToken().
'">';
250 print
'<input type="hidden" name="action" value="set">';
252 print
'<div class="div-table-responsive-no-min">';
253 print
'<table class="noborder centpercent">';
255 print
'<tr class="liste_titre">';
256 print
'<td class="notitlefield">'.$langs->trans(
"Parameters").
'</td><td>'.$langs->trans(
"Value").
'</td>';
260 print
'<tr class="oddeven"><td>';
261 print $langs->trans(
"NumberOfTerminals");
262 print
'<td colspan="2">';
263 print
'<input type="number" name="TAKEPOS_NUM_TERMINALS" min="1" value="' . (empty($conf->global->TAKEPOS_NUM_TERMINALS) ?
'1' : $conf->global->TAKEPOS_NUM_TERMINALS) .
'">';
264 print
"</td></tr>\n";
268 print
'<tr class="oddeven"><td>';
269 print $langs->trans(
"CashdeskShowServices");
270 print
'<td colspan="2">';
273 print
"</td></tr>\n";
277 print
'<tr class="oddeven"><td>';
278 print
$form->textwithpicto($langs->trans(
"RootCategoryForProductsToSell"), $langs->trans(
"RootCategoryForProductsToSellDesc"));
279 print
'<td colspan="2">';
280 print
img_object(
'',
'category',
'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT,
getDolGlobalInt(
'TAKEPOS_ROOT_CATEGORY_ID'),
'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0);
282 print
"</td></tr>\n";
285 print
'<tr class="oddeven"><td>';
286 print $langs->trans(
"SortProductField");
287 print
'<td colspan="2">';
289 $array = array(
'rowid' =>
'ID',
'ref' =>
'Ref',
'label' =>
'Label',
'datec' =>
'DateCreation',
'tms' =>
'DateModification');
290 print
$form->selectarray(
'TAKEPOS_SORTPRODUCTFIELD', $array, (empty($conf->global->TAKEPOS_SORTPRODUCTFIELD) ?
'rowid' : $conf->global->TAKEPOS_SORTPRODUCTFIELD), 0, 0, 0,
'', 1);
291 print
"</td></tr>\n";
293 print
'<tr class="oddeven"><td>';
294 print $langs->trans(
'TakeposGroupSameProduct');
295 print
'<td colspan="2">';
296 print
ajax_constantonoff(
"TAKEPOS_GROUP_SAME_PRODUCT", array(), $conf->entity, 0, 0, 1, 0);
297 print
"</td></tr>\n";
300 $substitutionarray[
'__(AnyTranslationKey)__'] = $langs->trans(
"Translation");
301 $htmltext =
'<i>'.$langs->trans(
"AvailableVariables").
':<br>';
302 foreach ($substitutionarray as $key => $val) {
303 $htmltext .= $key.
'<br>';
308 print
'<tr class="oddeven"><td>';
309 print $langs->trans(
"Paymentnumpad");
310 print
'<td colspan="2">';
311 $array = array(0=>$langs->trans(
"Numberspad"), 1=>$langs->trans(
"BillsCoinsPad"));
312 print
$form->selectarray(
'TAKEPOS_NUMPAD', $array, (empty($conf->global->TAKEPOS_NUMPAD) ?
'0' : $conf->global->TAKEPOS_NUMPAD), 0);
313 print
"</td></tr>\n";
324 print
'<tr class="oddeven"><td>';
325 print $langs->trans(
'DirectPaymentButton');
326 print
'<td colspan="2">';
327 print
ajax_constantonoff(
"TAKEPOS_DIRECT_PAYMENT", array(), $conf->entity, 0, 0, 1, 0);
329 print
"</td></tr>\n";
340 print
'<tr class="oddeven"><td>';
341 print $langs->trans(
'EmailTemplate');
342 print
'<td colspan="2">';
343 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
345 $nboftemplates = $formmail->fetchAllEMailTemplate(
'facture_send', $user,
null, -1);
347 $arrayofmessagename = array();
348 if (is_array($formmail->lines_model)) {
349 foreach ($formmail->lines_model as $modelmail) {
352 if (!empty($arrayofmessagename[$modelmail->label])) {
353 $moreonlabel =
' <span class="opacitymedium">('.$langs->trans(
"SeveralLangugeVariatFound").
')</span>';
355 $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace(
'/\(|\)/',
'', $modelmail->topic)).$moreonlabel;
360 print
$form->selectarray(
'TAKEPOS_EMAIL_TEMPLATE_INVOICE', $arrayofmessagename, $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE,
'None', 1, 0,
'', 0, 0, 0,
'',
'', 1);
361 print
"</td></tr>\n";
364 print
'<tr class="oddeven"><td>';
365 print $langs->trans(
'ControlCashOpening');
366 print
'<td colspan="2">';
367 print
ajax_constantonoff(
"TAKEPOS_CONTROL_CASH_OPENING", array(), $conf->entity, 0, 0, 1, 0);
368 print
"</td></tr>\n";
371 print
'<tr class="oddeven"><td>';
372 print $langs->trans(
'GiftReceiptButton');
373 print
'<td colspan="2">';
375 print
"</td></tr>\n";
378 print
'<tr class="oddeven"><td>';
379 print $langs->trans(
'AllowDelayedPayment');
380 print
'<td colspan="2">';
381 print
ajax_constantonoff(
"TAKEPOS_DELAYED_PAYMENT", array(), $conf->entity, 0, 0, 1, 0);
382 print
"</td></tr>\n";
385 print
'<tr class="oddeven"><td>';
386 print $langs->trans(
'ShowPriceHT');
387 print
'<td colspan="2">';
389 print
"</td></tr>\n";
393 print
'<tr class="oddeven"><td>';
394 print
$form->textwithpicto($langs->trans(
"TakeposBarcodeRuleToInsertProduct"), $langs->trans(
"TakeposBarcodeRuleToInsertProductDesc"));
395 print
'<td colspan="2">';
396 print
'<input type="text" name="TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT" value="' . (
getDolGlobalString(
'TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT')) .
'">';
397 print
"</td></tr>\n";
465 print
'<div class="div-table-responsive-no-min">';
466 print
'<table class="noborder centpercent">';
468 print
'<tr class="liste_titre">';
469 print
'<td class="titlefield">'.$langs->trans(
"Sumup").
'</td><td>'.$langs->trans(
"Value").
'</td>';
472 print
'<tr class="oddeven"><td>';
473 print $langs->trans(
"SumupAffiliate");
474 print
'<td colspan="2">';
475 print
'<input type="text" name="TAKEPOS_SUMUP_AFFILIATE" value="'.$conf->global->TAKEPOS_SUMUP_AFFILIATE.
'"></input>';
476 print
"</td></tr>\n";
477 print
'<tr class="oddeven"><td>';
478 print $langs->trans(
"SumupAppId");
479 print
'<td colspan="2">';
480 print
'<input type="text" name="TAKEPOS_SUMUP_APPID" value="'.$conf->global->TAKEPOS_SUMUP_APPID.
'"></input>';
481 print
"</td></tr>\n";
489 print
$form->buttonsSaveCancel(
"Save",
'');
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1')
Convert a html select field into an ajax combobox.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Class to manage invoices.
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
takepos_admin_prepare_head()
Prepare array with list of tabs.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
setEventMessage($mesgs, $style='mesgs')
Set event message in dol_events session object.
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='')
On/off button for constant.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
isModEnabled($module)
Is Dolibarr module enabled.
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).
Class to manage products or services.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_now($mode='auto')
Return date for now.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0)
Return array of possible substitutions for PDF content (without external module substitutions).
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.