27include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
48 $this->numero = 50150;
50 $this->rights_class =
'takepos';
54 $this->family =
"portal";
56 $this->module_position =
'60';
61 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
63 $this->
description =
"Point of sales module (Touch Screen POS)";
65 $this->descriptionlong =
"Point Of Sales (compliant with touch screen)";
68 $this->version =
'dolibarr';
70 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
74 $this->picto =
'cash-register';
80 $this->module_parts = array(
94 $this->dirs = array();
97 $this->config_page_url = array(
"setup.php@takepos");
100 $this->hidden =
false;
102 $this->depends = array(
'always'=>array(
"modBanque",
"modFacture",
"modProduct",
"modCategorie"),
'FR'=>array(
'modBlockedLog'));
103 $this->requiredby = array();
104 $this->conflictwith = array();
105 $this->langfiles = array(
"cashdesk");
106 $this->phpmin = array(7, 0);
107 $this->need_dolibarr_version = array(4, 0);
108 $this->warnings_activation = array(
'FR'=>
'WarningNoteModulePOSForFrenchLaw');
109 $this->warnings_activation_ext = array();
118 $this->
const = array(
123 if (!isset($conf->takepos) || !isset($conf->takepos->enabled)) {
124 $conf->takepos =
new stdClass();
125 $conf->takepos->enabled = 0;
130 $this->tabs = array();
159 $this->dictionaries = array();
164 $this->boxes = array(
173 $this->cronjobs = array(
182 $this->rights = array();
187 $this->rights[$r][0] = 50151;
188 $this->rights[$r][1] =
'Use Point Of Sale (record a sale, add products, record payment)';
189 $this->rights[$r][2] =
'a';
190 $this->rights[$r][3] = 0;
191 $this->rights[$r][4] =
'run';
194 $this->rights[$r][0] = 50152;
195 $this->rights[$r][1] =
'Can modify added sales lines (prices, discount)';
196 $this->rights[$r][2] =
'a';
197 $this->rights[$r][3] = 0;
198 $this->rights[$r][4] =
'editlines';
201 $this->rights[$r][0] = 50153;
202 $this->rights[$r][1] =
'Edit ordered sales lines (useful only when option "Order printers" has been enabled). Allow to edit sales lines even after the order has been printed';
203 $this->rights[$r][2] =
'a';
204 $this->rights[$r][3] = 0;
205 $this->rights[$r][4] =
'editorderedlines';
209 $this->menu = array();
215 $this->menu[$r++] = array(
'fk_menu'=>
'',
217 'titre'=>
'PointOfSaleShort',
218 'mainmenu'=>
'takepos',
220 'prefix' =>
img_picto(
'', $this->picto,
'class="paddingright pictofixedwidth"'),
221 'url'=>
'/takepos/index.php',
223 'position'=>1000 + $r,
224 'enabled'=>
'$conf->takepos->enabled',
225 'perms'=>
'$user->rights->takepos->run',
267 public function init($options =
'')
271 dolibarr_set_const($db,
"TAKEPOS_PRINT_METHOD",
"browser",
'chaine', 0,
'', $conf->entity);
273 $result = $this->
_load_tables(
'/install/mysql/',
'takepos');
279 $this->
remove($options);
283 return $this->
_init($sql, $options);
294 public function remove($options =
'')
298 return $this->
_remove($sql, $options);
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).
_init($array_sql, $options='')
Enables a module.
_remove($array_sql, $options='')
Disable function.
_load_tables($reldir, $onlywithsuffix='')
Create tables and keys required by module:
Class to describe and enable module TakePos.
init($options='')
Function called when module is enabled.
__construct($db)
Constructor.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
$conf db name
Only used if Module[ID]Name translation string is not found.