28include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
46 $this->numero = 39000;
48 $this->family =
"products";
49 $this->module_position =
'45';
51 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
52 $this->
description =
"Batch number, eat-by and sell-by date management module";
54 $this->rights_class =
'productbatch';
56 $this->version =
'dolibarr';
58 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
62 $this->module_parts = array();
65 $this->dirs = array();
68 $this->config_page_url = array(
"product_lot.php@product");
71 $this->hidden =
false;
72 $this->depends = array(
"modProduct",
"modStock",
"modExpedition",
"modFournisseur");
73 $this->requiredby = array();
74 $this->conflictwith = array();
75 $this->phpmin = array(7, 0);
76 $this->need_dolibarr_version = array(3, 0);
77 $this->langfiles = array(
"productbatch");
81 $this->
const = array();
84 $this->
const[$r][0] =
"PRODUCTBATCH_LOT_ADDON";
85 $this->
const[$r][1] =
"chaine";
86 $this->
const[$r][2] =
"mod_lot_free";
87 $this->
const[$r][3] =
'Module to control lot number';
88 $this->
const[$r][4] = 0;
91 $this->
const[$r][0] =
"PRODUCTBATCH_SN_ADDON";
92 $this->
const[$r][1] =
"chaine";
93 $this->
const[$r][2] =
"mod_sn_free";
94 $this->
const[$r][3] =
'Module to control serial number';
95 $this->
const[$r][4] = 0;
98 $this->tabs = array();
101 if (!isset($conf->productbatch->enabled)) {
102 $conf->productbatch =
new stdClass();
103 $conf->productbatch->enabled = 0;
105 $this->dictionaries = array();
108 $this->boxes = array();
111 $this->rights = array();
132 public function init($options =
'')
138 if (!empty($conf->cashdesk->enabled)) {
139 if (empty($conf->global->CASHDESK_NO_DECREASE_STOCK)) {
140 include_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
141 $res =
dolibarr_set_const($db,
"CASHDESK_NO_DECREASE_STOCK", 1,
'chaine', 0,
'', $conf->entity);
145 return $this->
_init($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.
Description and activation class for module productdluo.
__construct($db)
Constructor.
init($options='')
Function called when module is enabled.
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.
$conf db name
Only used if Module[ID]Name translation string is not found.