28 include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
46 $this->numero = 67000;
49 $this->family =
"interface";
50 $this->module_position =
'53';
52 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
56 $this->version =
'dolibarr';
57 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
61 $this->picto =
'printer';
64 $this->dirs = array();
67 $this->config_page_url = array(
"receiptprinter.php");
70 $this->hidden =
false;
71 $this->depends = array();
72 $this->requiredby = array();
73 $this->conflictwith = array();
74 $this->phpmin = array(7, 0);
75 $this->need_dolibarr_version = array(3, 9, -2);
76 $this->conflictwith = array();
77 $this->langfiles = array(
"receiptprinter");
80 $this->
const = array();
83 $this->boxes = array();
86 $this->rights = array();
87 $this->rights_class =
'receiptprinter';
98 $this->rights[$r][0] = 67001;
99 $this->rights[$r][1] =
'ReceiptPrinter';
100 $this->rights[$r][2] =
'r';
101 $this->rights[$r][3] = 0;
102 $this->rights[$r][4] =
'read';
105 $this->menus = array();
133 public function init($options =
'')
135 global $conf, $langs;
138 $this->
remove($options);
140 $templateexample =
'{dol_align_center}\r\n{dol_print_text}{dol_value_mysoc_name}\r\n{dol_print_text}{dol_value_mysoc_address}\r\n{dol_print_text}{dol_value_mysoc_zip}{dol_value_mysoc_town}\r\n{dol_line_feed}\r\n{dol_print_text}Facture {dol_value_object_ref}\r\n{dol_line_feed}\r\n{dol_align_left}\r\n{dol_print_object_lines}\r\n{dol_line_feed}\r\n{dol_print_object_tax}\r\n{dol_line_feed}\r\n{dol_print_object_total}\r\n{dol_line_feed}\r\n{dol_cut_paper_full}';
142 "CREATE TABLE IF NOT EXISTS ".MAIN_DB_PREFIX.
"printer_receipt (rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(128), fk_type integer, fk_profile integer, parameter varchar(128), entity integer) ENGINE=innodb;",
143 "CREATE TABLE IF NOT EXISTS ".MAIN_DB_PREFIX.
"printer_receipt_template (rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(128), template text, entity integer) ENGINE=innodb;",
144 "DELETE FROM ".MAIN_DB_PREFIX.
"printer_receipt_template WHERE name = '".$this->db->escape($langs->trans(
'Example')).
"';",
145 "INSERT INTO ".MAIN_DB_PREFIX.
"printer_receipt_template (name,template,entity) VALUES ('".$this->db->escape($langs->trans(
'Example')).
"', '".$this->db->escape($templateexample).
"', 1);",
147 return $this->
_init($sql, $options);
_init($array_sql, $options='')
Enables a module.
Class to describe and activate module Receipt Printer.
__construct($db)
Constructor.
init($options='')
Function called when module is enabled.
print *****$script_file(".$version.") pid 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.
$conf db
API class for accounts.