dolibarr  9.0.0
dolreceiptprinter.class.php
Go to the documentation of this file.
1 <?php
2 /*
3  * Copyright (C) 2015-2018 Frédéric France <frederic.france@free.fr>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  * or see http://www.gnu.org/
18  */
19 
25 /*
26  * Tags for ticket template
27  *
28  * <dol_align_left> Left align text
29  * <dol_align_center> Center text
30  * <dol_align_right> Right align text
31  * <dol_use_font_a> Use font A of printer
32  * <dol_use_font_b> Use font B of printer
33  * <dol_use_font_c> Use font C of printer
34  * <dol_bold> </dol_bold> Text Bold
35  * <dol_double_height> </dol_double_height> Text double height
36  * <dol_double_width> </dol_double_width> Text double width
37  * <dol_underline> </dol_underline> Underline text
38  * <dol_underline_2dots> </dol_underline_2dots> Underline with double line
39  * <dol_emphasized> </dol_emphasized> Emphasized text
40  * <dol_switch_colors> </dol_switch_colors> Print in white on black
41  * <dol_print_barcode> Print barcode
42  * <dol_print_barcode_customer_id> Print barcode customer id
43  * <dol_set_print_width_57> Ticket print width of 57mm
44  * <dol_cut_paper_full> Cut ticket completely
45  * <dol_cut_paper_partial> Cut ticket partially
46  * <dol_open_drawer> Open cash drawer
47  * <dol_activate_buzzer> Activate buzzer
48  *
49  * Code which can be placed everywhere
50  * <dol_print_qrcode> Print QR Code
51  * <dol_print_date> Print date AAAA-MM-DD
52  * <dol_print_date_time> Print date and time AAAA-MM-DD HH:MM:SS
53  * <dol_print_year> Print Year
54  * <dol_print_month_letters> Print month in letters (example : november)
55  * <dol_print_month> Print month number
56  * <dol_print_day> Print day number
57  * <dol_print_day_letters> Print day number
58  * <dol_print_table> Print table number (for restaurant, bar...)
59  * <dol_print_cutlery> Print number of cutlery (for restaurant)
60  * <dol_print_payment> Print payment method
61  * <dol_print_logo> Print logo stored on printer. Example : <print_logo>32|32
62  * <dol_print_logo_old> Print logo stored on printer. Must be followed by logo code. For old printers.
63  * <dol_print_order_lines> Print order lines
64  * <dol_print_order_tax> Print order total tax
65  * <dol_print_order_local_tax> Print order local tax
66  * <dol_print_order_total> Print order total
67  * <dol_print_order_number> Print order number
68  * <dol_print_order_number_unique> Print order number after validation
69  * <dol_print_customer_firstname> Print customer firstname
70  * <dol_print_customer_lastname> Print customer name
71  * <dol_print_customer_mail> Print customer mail
72  * <dol_print_customer_phone> Print customer phone
73  * <dol_print_customer_mobile> Print customer mobile
74  * <dol_print_customer_skype> Print customer skype
75  * <dol_print_customer_tax_number> Print customer VAT number
76  * <dol_print_customer_account_balance> Print customer account balance
77  * <dol_print_vendor_lastname> Print vendor name
78  * <dol_print_vendor_firstname> Print vendor firstname
79  * <dol_print_vendor_mail> Print vendor mail
80  * <dol_print_customer_points> Print customer points
81  * <dol_print_order_points> Print number of points for this order
82  *
83  * Conditional code at line start (if�then Print)
84  * <dol_print_if_customer> Print the line IF a customer is affected to the order
85  * <dol_print_if_vendor> Print the line IF a vendor is affected to the order
86  * <dol_print_if_happy_hour> Print the line IF Happy Hour
87  * <dol_print_if_num_order_unique> Print the line IF order is validated
88  * <dol_print_if_customer_points> Print the line IF customer points > 0
89  * <dol_print_if_order_points> Print the line IF points of the order > 0
90  * <dol_print_if_customer_tax_number> Print the line IF customer has vat number
91  * <dol_print_if_customer_account_balance_positive> Print the line IF customer balance > 0
92  *
93  */
94 
95 require_once DOL_DOCUMENT_ROOT .'/includes/mike42/escpos-php/Escpos.php';
96 
97 
102 {
103  const CONNECTOR_DUMMY = 1;
104  const CONNECTOR_FILE_PRINT = 2;
105  const CONNECTOR_NETWORK_PRINT = 3;
106  const CONNECTOR_WINDOWS_PRINT = 4;
107  //const CONNECTOR_JAVA = 5;
108 
112  public $db;
113 
114  var $tags;
115  var $printer;
116  var $template;
117 
121  public $error='';
122 
126  public $errors = array();
127 
128 
129 
135  function __construct($db)
136  {
137  $this->db=$db;
138  $this->tags = array(
139  'dol_align_left',
140  'dol_align_center',
141  'dol_align_right',
142  'dol_use_font_a',
143  'dol_use_font_b',
144  'dol_use_font_c',
145  'dol_bold',
146  '/dol_bold',
147  'dol_double_height',
148  '/dol_double_height',
149  'dol_double_width',
150  '/dol_double_width',
151  'dol_underline',
152  '/dol_underline',
153  'dol_underline_2dots',
154  '/dol_underline',
155  'dol_emphasized',
156  '/dol_emphasized',
157  'dol_switch_colors',
158  '/dol_switch_colors',
159  'dol_print_barcode',
160  'dol_print_barcode_customer_id',
161  'dol_set_print_width_57',
162  'dol_cut_paper_full',
163  'dol_cut_paper_partial',
164  'dol_open_drawer',
165  'dol_activate_buzzer',
166  'dol_print_qrcode',
167  'dol_print_date',
168  'dol_print_date_time',
169  'dol_print_year',
170  'dol_print_month_letters',
171  'dol_print_month',
172  'dol_print_day',
173  'dol_print_day_letters',
174  'dol_print_table',
175  'dol_print_cutlery',
176  'dol_print_payment',
177  'dol_print_logo',
178  'dol_print_logo_old',
179  'dol_print_order_lines',
180  'dol_print_order_tax',
181  'dol_print_order_local_tax',
182  'dol_print_order_total',
183  'dol_print_order_number',
184  'dol_print_order_number_unique',
185  'dol_print_customer_firstname',
186  'dol_print_customer_lastname',
187  'dol_print_customer_mail',
188  'dol_print_customer_phone',
189  'dol_print_customer_mobile',
190  'dol_print_customer_skype',
191  'dol_print_customer_tax_number',
192  'dol_print_customer_account_balance',
193  'dol_print_vendor_lastname',
194  'dol_print_vendor_firstname',
195  'dol_print_vendor_mail',
196  'dol_print_customer_points',
197  'dol_print_order_points',
198  'dol_print_if_customer',
199  'dol_print_if_vendor',
200  'dol_print_if_happy_hour',
201  'dol_print_if_num_order_unique',
202  'dol_print_if_customer_points',
203  'dol_print_if_order_points',
204  'dol_print_if_customer_tax_number',
205  'dol_print_if_customer_account_balance_positive',
206  );
207  }
208 
214  function listPrinters()
215  {
216  global $conf;
217  $error = 0;
218  $line = 0;
219  $obj = array();
220  $sql = 'SELECT rowid, name, fk_type, fk_profile, parameter';
221  $sql.= ' FROM '.MAIN_DB_PREFIX.'printer_receipt';
222  $sql.= ' WHERE entity = '.$conf->entity;
223  $resql = $this->db->query($sql);
224  if ($resql) {
225  $num = $this->db->num_rows($resql);
226  while ($line < $num) {
227  $row = $this->db->fetch_array($resql);
228  switch ($row['fk_type']) {
229  case 1:
230  $row['fk_type_name'] = 'CONNECTOR_DUMMY';
231  break;
232  case 2:
233  $row['fk_type_name'] = 'CONNECTOR_FILE_PRINT';
234  break;
235  case 3:
236  $row['fk_type_name'] = 'CONNECTOR_NETWORK_PRINT';
237  break;
238  case 4:
239  $row['fk_type_name'] = 'CONNECTOR_WINDOWS_PRINT';
240  break;
241  case 5:
242  $row['fk_type_name'] = 'CONNECTOR_JAVA';
243  break;
244  default:
245  $row['fk_type_name'] = 'CONNECTOR_UNKNOWN';
246  break;
247  }
248  switch ($row['fk_profile']) {
249  case 0:
250  $row['fk_profile_name'] = 'PROFILE_DEFAULT';
251  break;
252  case 1:
253  $row['fk_profile_name'] = 'PROFILE_SIMPLE';
254  break;
255  case 2:
256  $row['fk_profile_name'] = 'PROFILE_EPOSTEP';
257  break;
258  case 3:
259  $row['fk_profile_name'] = 'PROFILE_P822D';
260  break;
261  default:
262  $row['fk_profile_name'] = 'PROFILE_STAR';
263  break;
264  }
265  $obj[] = $row;
266  $line++;
267  }
268  } else {
269  $error++;
270  $this->errors[] = $this->db->lasterror;
271  }
272  $this->listprinters = $obj;
273  return $error;
274  }
275 
276 
283  {
284  global $conf;
285  $error = 0;
286  $line = 0;
287  $obj = array();
288  $sql = 'SELECT rowid, name, template';
289  $sql.= ' FROM '.MAIN_DB_PREFIX.'printer_receipt_template';
290  $sql.= ' WHERE entity = '.$conf->entity;
291  $resql = $this->db->query($sql);
292  if ($resql) {
293  $num = $this->db->num_rows($resql);
294  while ($line < $num) {
295  $obj[] = $this->db->fetch_array($resql);
296  $line++;
297  }
298  } else {
299  $error++;
300  $this->errors[] = $this->db->lasterror;
301  }
302  $this->listprinterstemplates = $obj;
303  return $error;
304  }
305 
306 
314  function selectTypePrinter($selected='', $htmlname='printertypeid')
315  {
316  global $langs;
317 
318  $options = array(
319  1 => $langs->trans('CONNECTOR_DUMMY'),
320  2 => $langs->trans('CONNECTOR_FILE_PRINT'),
321  3 => $langs->trans('CONNECTOR_NETWORK_PRINT'),
322  4 => $langs->trans('CONNECTOR_WINDOWS_PRINT')
323  );
324 
325  $this->resprint = Form::selectarray($htmlname, $options, $selected);
326 
327  return 0;
328  }
329 
330 
338  function selectProfilePrinter($selected='', $htmlname='printerprofileid')
339  {
340  global $langs;
341 
342  $options = array(
343  0 => $langs->trans('PROFILE_DEFAULT'),
344  1 => $langs->trans('PROFILE_SIMPLE'),
345  2 => $langs->trans('PROFILE_EPOSTEP'),
346  3 => $langs->trans('PROFILE_P822D'),
347  4 => $langs->trans('PROFILE_STAR')
348  );
349 
350  $this->profileresprint = Form::selectarray($htmlname, $options, $selected);
351  return 0;
352  }
353 
354 
355  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
365  function AddPrinter($name, $type, $profile, $parameter)
366  {
367  // phpcs:enable
368  global $conf;
369  $error = 0;
370  $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt';
371  $sql.= ' (name, fk_type, fk_profile, parameter, entity)';
372  $sql.= ' VALUES ("'.$this->db->escape($name).'", '.$type.', '.$profile.', "'.$this->db->escape($parameter).'", '.$conf->entity.')';
373  $resql = $this->db->query($sql);
374  if (! $resql) {
375  $error++;
376  $this->errors[] = $this->db->lasterror;
377  }
378  return $error;
379  }
380 
381  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
392  function UpdatePrinter($name, $type, $profile, $parameter, $printerid)
393  {
394  // phpcs:enable
395  global $conf;
396  $error = 0;
397  $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt';
398  $sql.= ' SET name="'.$this->db->escape($name).'"';
399  $sql.= ', fk_type='.$type;
400  $sql.= ', fk_profile='.$profile;
401  $sql.= ', parameter="'.$this->db->escape($parameter).'"';
402  $sql.= ' WHERE rowid='.$printerid;
403  $resql = $this->db->query($sql);
404  if (! $resql) {
405  $error++;
406  $this->errors[] = $this->db->lasterror;
407  }
408  return $error;
409  }
410 
411  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
418  function DeletePrinter($printerid)
419  {
420  // phpcs:enable
421  global $conf;
422  $error = 0;
423  $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'printer_receipt';
424  $sql.= ' WHERE rowid='.$printerid;
425  $resql = $this->db->query($sql);
426  if (! $resql) {
427  $error++;
428  $this->errors[] = $this->db->lasterror;
429  }
430  return $error;
431  }
432 
433  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
442  function UpdateTemplate($name, $template, $templateid)
443  {
444  // phpcs:enable
445  global $conf;
446  $error = 0;
447  $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt_template';
448  $sql.= ' SET name="'.$this->db->escape($name).'"';
449  $sql.= ', template="'.$this->db->escape($template).'"';
450  $sql.= ' WHERE rowid='.$templateid;
451  $resql = $this->db->query($sql);
452  if (! $resql) {
453  $error++;
454  $this->errors[] = $this->db->lasterror;
455  }
456  return $error;
457  }
458 
459 
460  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
467  function SendTestToPrinter($printerid)
468  {
469  // phpcs:enable
470  global $conf;
471  $error = 0;
472  $img = new EscposImage(DOL_DOCUMENT_ROOT .'/theme/common/dolibarr_logo_bw.png');
473  $ret = $this->InitPrinter($printerid);
474  if ($ret>0) {
475  setEventMessages($this->error, $this->errors, 'errors');
476  } else {
477  try {
478  $this->printer->graphics($img);
479  $this->printer->text("Hello World!\n");
480  $testStr = "Testing 123";
481  $this->printer->qrCode($testStr);
482  $this->printer->text("Most simple example\n");
483  $this->printer->feed();
484  $this->printer->cut();
485  //print '<pre>'.print_r($this->connector, true).'</pre>';
486  $this->printer->close();
487  } catch (Exception $e) {
488  $this->errors[] = $e->getMessage();
489  $error++;
490  }
491  }
492  return $error;
493  }
494 
495  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
504  function SendToPrinter($object, $templateid, $printerid)
505  {
506  // phpcs:enable
507  global $conf;
508  $error = 0;
509  $ret = $this->loadTemplate($templateid);
510 
511  // tags a remplacer par leur valeur avant de parser
512  $this->template = str_replace('<dol_print_num_order>', $object->id, $this->template);
513  $this->template = str_replace('<dol_print_customer_firstname>', $object->customer_firstname, $this->template);
514  $this->template = str_replace('<dol_print_customer_lastname>', $object->customer_lastname, $this->template);
515  $this->template = str_replace('<dol_print_customer_mail>', $object->customer_mail, $this->template);
516  $this->template = str_replace('<dol_print_customer_phone>', $object->customer_phone, $this->template);
517  $this->template = str_replace('<dol_print_customer_mobile>', $object->customer_mobile, $this->template);
518  $this->template = str_replace('<dol_print_customer_skype>', $object->customer_skype, $this->template);
519  $this->template = str_replace('<dol_print_customer_tax_number>', $object->customer_tax_number, $this->template);
520  $this->template = str_replace('<dol_print_customer_account_balance>', $object->customer_account_balance, $this->template);
521  $this->template = str_replace('<dol_print_customer_points>', $object->customer_points, $this->template);
522  $this->template = str_replace('<dol_print_order_points>', $object->order_points, $this->template);
523  $this->template = str_replace('<dol_print_vendor_firstname>', $object->vendor_firstname, $this->template);
524  $this->template = str_replace('<dol_print_vendor_lastname>', $object->vendor_lastname, $this->template);
525  $this->template = str_replace('<dol_print_vendor_mail>', $object->vendor_mail, $this->template);
526  $this->template = str_replace('<dol_print_date>', $object->date, $this->template);
527  $this->template = str_replace('<dol_print_date_time>', $object->date_time, $this->template);
528  $this->template = str_replace('<dol_print_year>', $object->date_time, $this->template);
529  $this->template = str_replace('<dol_print_month_letters>', $object->date_time, $this->template);
530  $this->template = str_replace('<dol_print_month>', $object->date_time, $this->template);
531  $this->template = str_replace('<dol_print_day>', $object->date_time, $this->template);
532  $this->template = str_replace('<dol_print_day_letters>', $object->date_time, $this->template);
533  $this->template = str_replace('<dol_print_table>', $object->table, $this->template);
534  $this->template = str_replace('<dol_print_cutlery>', $object->cutlery, $this->template);
535 
536  // parse template
537  $p = xml_parser_create();
538  xml_parse_into_struct($p, $this->template, $vals, $index);
539  xml_parser_free($p);
540  //print '<pre>'.print_r($index, true).'</pre>';
541  //print '<pre>'.print_r($vals, true).'</pre>';
542  // print ticket
543  $level = 0;
544  $html = '<table border="1" style="width:210px"><pre>';
545  $ret = $this->InitPrinter($printerid);
546  if ($ret>0) {
547  setEventMessages($this->error, $this->errors, 'errors');
548  }
549  else
550  {
551  $nboflines = count($vals);
552  for ($line=0; $line < $nboflines; $line++)
553  {
554  switch ($vals[$line]['tag']) {
555  case 'DOL_ALIGN_CENTER':
556  $this->printer->setJustification(Escpos::JUSTIFY_CENTER);
557  $html.='<center>';
558  $this->printer->text($vals[$line]['value']);
559  break;
560  case 'DOL_ALIGN_RIGHT':
561  $this->printer->setJustification(Escpos::JUSTIFY_RIGHT);
562  $html.='<right>';
563  break;
564  case 'DOL_ALIGN_LEFT':
565  $this->printer->setJustification(Escpos::JUSTIFY_LEFT);
566  $html.='<left>';
567  break;
568  case 'DOL_OPEN_DRAWER':
569  $this->printer->pulse();
570  $html.= ' &#991;'.nl2br($vals[$line]['value']);
571  break;
572  case 'DOL_ACTIVATE_BUZZER':
573  //$this->printer->buzzer();
574  $html.= ' &#x266b;'.nl2br($vals[$line]['value']);
575  break;
576  case 'DOL_PRINT_BARCODE':
577  // $vals[$line]['value'] -> barcode($content, $type)
578  $this->printer->barcode($object->barcode);
579  break;
580  case 'DOL_PRINT_BARCODE_CUSTOMER_ID':
581  // $vals[$line]['value'] -> barcode($content, $type)
582  $this->printer->barcode($object->customer_id);
583  break;
584  case 'DOL_PRINT_QRCODE':
585  // $vals[$line]['value'] -> qrCode($content, $ec, $size, $model)
586  $this->printer->qrcode($vals[$line]['value']);
587  $html.='QRCODE: '.$vals[$line]['value'];
588  break;
589  case 'DOL_CUT_PAPER_FULL':
590  $this->printer->cut(Escpos::CUT_FULL);
591  $html.= ' &#9986;'.nl2br($vals[$line]['value']);
592  break;
593  case 'DOL_CUT_PAPER_PARTIAL':
594  $this->printer->cut(Escpos::CUT_PARTIAL);
595  $html.= ' &#9986;'.nl2br($vals[$line]['value']);
596  break;
597  case 'DOL_USE_FONT_A':
598  $this->printer->setFont(Escpos::FONT_A);
599  $this->printer->text($vals[$line]['value']);
600  break;
601  case 'DOL_USE_FONT_B':
602  $this->printer->setFont(Escpos::FONT_B);
603  $this->printer->text($vals[$line]['value']);
604  break;
605  case 'DOL_USE_FONT_C':
606  $this->printer->setFont(Escpos::FONT_C);
607  $this->printer->text($vals[$line]['value']);
608  break;
609  default:
610  $this->printer->text($vals[$line]['value']);
611  $html.= nl2br($vals[$line]['value']);
612  $this->errors[] = 'UnknowTag: &lt;'.strtolower($vals[$line]['tag']).'&gt;';
613  $error++;
614  break;
615  }
616  }
617  $html.= '</pre></table>';
618  print $html;
619  // Close and print
620  // uncomment next line to see content sent to printer
621  //print '<pre>'.print_r($this->connector, true).'</pre>';
622  $this->printer->close();
623  }
624  return $error;
625  }
626 
633  function loadTemplate($templateid)
634  {
635  global $conf;
636  $error = 0;
637  $sql = 'SELECT template';
638  $sql.= ' FROM '.MAIN_DB_PREFIX.'printer_receipt_template';
639  $sql.= ' WHERE rowid='.$templateid;
640  $sql.= ' AND entity = '.$conf->entity;
641  $resql = $this->db->query($sql);
642  if ($resql) {
643  $obj = $this->db->fetch_array($resql);
644  } else {
645  $error++;
646  $this->errors[] = $this->db->lasterror;
647  }
648  if (empty($obj)) {
649  $error++;
650  $this->errors[] = 'TemplateDontExist';
651  } else {
652  $this->template = $obj['0'];
653  }
654 
655  return $error;
656  }
657 
658 
659  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
666  function InitPrinter($printerid)
667  {
668  // phpcs:enable
669  global $conf;
670  $error=0;
671  $sql = 'SELECT rowid, name, fk_type, fk_profile, parameter';
672  $sql.= ' FROM '.MAIN_DB_PREFIX.'printer_receipt';
673  $sql.= ' WHERE rowid = '.$printerid;
674  $sql.= ' AND entity = '.$conf->entity;
675  $resql = $this->db->query($sql);
676  if ($resql) {
677  $obj = $this->db->fetch_array($resql);
678  } else {
679  $error++;
680  $this->errors[] = $this->db->lasterror;
681  }
682  if (empty($obj)) {
683  $error++;
684  $this->errors[] = 'PrinterDontExist';
685  }
686  if (! $error) {
687  $parameter = $obj['parameter'];
688  try {
689  switch ($obj['fk_type']) {
690  case 1:
691  require_once DOL_DOCUMENT_ROOT .'/includes/mike42/escpos-php/src/DummyPrintConnector.php';
692  $this->connector = new DummyPrintConnector();
693  break;
694  case 2:
695  $this->connector = new FilePrintConnector($parameter);
696  break;
697  case 3:
698  $parameters = explode(':', $parameter);
699  $this->connector = new NetworkPrintConnector($parameters[0], $parameters[1]);
700  break;
701  case 4:
702  $this->connector = new WindowsPrintConnector($parameter);
703  break;
704  default:
705  $this->connector = 'CONNECTOR_UNKNOWN';
706  break;
707  }
708  $this->printer = new Escpos($this->connector);
709  } catch (Exception $e) {
710  $this->errors[] = $e->getMessage();
711  $error++;
712  }
713  }
714  return $error;
715  }
716 }
DeletePrinter($printerid)
Function to Delete a printer from db.
UpdateTemplate($name, $template, $templateid)
Function to Update a printer template in db.
print
Draft customers invoices.
Definition: index.php:91
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
if(! empty($conf->facture->enabled) && $user->rights->facture->lire) if(! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) if(! empty($conf->don->enabled) && $user->rights->societe->lire) if(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) if(! empty($conf->facture->enabled) &&! empty($conf->commande->enabled) && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(! empty($conf->facture->enabled) && $user->rights->facture->lire) if(! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1053
listPrintersTemplates()
List printers templates.
selectTypePrinter($selected='', $htmlname='printertypeid')
Form to Select type printer.
loadTemplate($templateid)
Function to load Template.
AddPrinter($name, $type, $profile, $parameter)
Function to Add a printer in db.
static selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0, $moreparamonempty='', $disablebademail=0, $nohtmlescape=0)
Return a HTML select string, built from an array of key+value.
InitPrinter($printerid)
Function Init Printer.
Class to manage Receipt Printers.
SendTestToPrinter($printerid)
Function to Send Test page to Printer.
UpdatePrinter($name, $type, $profile, $parameter, $printerid)
Function to Update a printer in db.
selectProfilePrinter($selected='', $htmlname='printerprofileid')
Form to Select Profile printer.
__construct($db)
Constructor.
SendToPrinter($object, $templateid, $printerid)
Function to Print Receipt Ticket.