dolibarr  13.0.2
Public Member Functions | List of all members
dolReceiptPrinter Class Reference

Class to manage Receipt Printers. More...

+ Inheritance diagram for dolReceiptPrinter:
+ Collaboration diagram for dolReceiptPrinter:

Public Member Functions

 __construct ($db)
 Constructor. More...
 
 listPrinters ()
 list printers More...
 
 listPrintersTemplates ()
 List printers templates. More...
 
 selectTypePrinter ($selected= '', $htmlname= 'printertypeid')
 Form to Select type printer. More...
 
 selectProfilePrinter ($selected= '', $htmlname= 'printerprofileid')
 Form to Select Profile printer. More...
 
 addPrinter ($name, $type, $profile, $parameter)
 Function to Add a printer in db. More...
 
 updatePrinter ($name, $type, $profile, $parameter, $printerid)
 Function to Update a printer in db. More...
 
 deletePrinter ($printerid)
 Function to Delete a printer from db. More...
 
 addTemplate ($name, $template)
 Function to add a printer template in db. More...
 
 deleteTemplate ($templateid)
 Function to delete a printer template in db. More...
 
 updateTemplate ($name, $template, $templateid)
 Function to Update a printer template in db. More...
 
 sendTestToPrinter ($printerid)
 Function to Send Test page to Printer. More...
 
 sendToPrinter ($object, $templateid, $printerid)
 Function to Print Receipt Ticket. More...
 
 loadTemplate ($templateid)
 Function to load Template. More...
 
 initPrinter ($printerid)
 Function Init Printer. More...
 

Detailed Description

Class to manage Receipt Printers.

Definition at line 116 of file dolreceiptprinter.class.php.

Constructor & Destructor Documentation

dolReceiptPrinter::__construct (   $db)

Constructor.

Parameters
DoliDB$dbdatabase

Definition at line 157 of file dolreceiptprinter.class.php.

References db.

Member Function Documentation

dolReceiptPrinter::addPrinter (   $name,
  $type,
  $profile,
  $parameter 
)

Function to Add a printer in db.

Parameters
string$namePrinter name
int$typePrinter type
int$profilePrinter profile
string$parameterPrinter parameter
Returns
int 0 if OK; >0 if KO

Definition at line 385 of file dolreceiptprinter.class.php.

References $resql, and db.

dolReceiptPrinter::addTemplate (   $name,
  $template 
)

Function to add a printer template in db.

Parameters
string$nameTemplate name
int$templateTemplate
Returns
int 0 if OK; >0 if KO

Definition at line 455 of file dolreceiptprinter.class.php.

References $resql, and db.

dolReceiptPrinter::deletePrinter (   $printerid)

Function to Delete a printer from db.

Parameters
int$printeridPrinter id
Returns
int 0 if OK; >0 if KO

Definition at line 434 of file dolreceiptprinter.class.php.

References $resql, and db.

dolReceiptPrinter::deleteTemplate (   $templateid)

Function to delete a printer template in db.

Parameters
int$templateidTemplate ID
Returns
int 0 if OK; >0 if KO

Definition at line 476 of file dolreceiptprinter.class.php.

References $resql, and db.

dolReceiptPrinter::initPrinter (   $printerid)

Function Init Printer.

Parameters
int$printeridPrinter id
Returns
int 0 if OK; >0 if KO

Definition at line 875 of file dolreceiptprinter.class.php.

References $resql, and db.

Referenced by sendTestToPrinter(), and sendToPrinter().

dolReceiptPrinter::listPrinters ( )

list printers

Returns
int 0 if OK; >0 if KO

Definition at line 234 of file dolreceiptprinter.class.php.

References $resql, and db.

dolReceiptPrinter::listPrintersTemplates ( )

List printers templates.

Returns
int 0 if OK; >0 if KO

Definition at line 302 of file dolreceiptprinter.class.php.

References $resql, and db.

dolReceiptPrinter::loadTemplate (   $templateid)

Function to load Template.

Parameters
int$templateidTemplate id
Returns
int 0 if OK; >0 if KO

Definition at line 843 of file dolreceiptprinter.class.php.

References $resql, and db.

Referenced by sendToPrinter().

dolReceiptPrinter::selectProfilePrinter (   $selected = '',
  $htmlname = 'printerprofileid' 
)

Form to Select Profile printer.

Parameters
string$selectedId printer profile pre-selected
string$htmlnameselect html name
Returns
int 0 if OK; >0 if KO

Definition at line 359 of file dolreceiptprinter.class.php.

References Form\selectarray().

dolReceiptPrinter::selectTypePrinter (   $selected = '',
  $htmlname = 'printertypeid' 
)

Form to Select type printer.

Parameters
string$selectedId printer type pre-selected
string$htmlnameselect html name
Returns
int 0 if OK; >0 if KO

Definition at line 334 of file dolreceiptprinter.class.php.

References Form\selectarray().

dolReceiptPrinter::sendTestToPrinter (   $printerid)

Function to Send Test page to Printer.

Parameters
int$printeridPrinter id
Returns
int 0 if OK; >0 if KO

Definition at line 522 of file dolreceiptprinter.class.php.

References dol_syslog(), initPrinter(), and setEventMessages().

dolReceiptPrinter::sendToPrinter (   $object,
  $templateid,
  $printerid 
)

Function to Print Receipt Ticket.

Parameters
Facture | Commande$objectOrder or invoice object
int$templateidTemplate id
int$printeridPrinter id
Returns
int 0 if OK; >0 if KO

Definition at line 565 of file dolreceiptprinter.class.php.

References $resql, db, dol_print_date(), dol_syslog(), if, initPrinter(), loadTemplate(), price(), and setEventMessages().

dolReceiptPrinter::updatePrinter (   $name,
  $type,
  $profile,
  $parameter,
  $printerid 
)

Function to Update a printer in db.

Parameters
string$namePrinter name
int$typePrinter type
int$profilePrinter profile
string$parameterPrinter parameter
int$printeridPrinter id
Returns
int 0 if OK; >0 if KO

Definition at line 410 of file dolreceiptprinter.class.php.

References $resql, and db.

dolReceiptPrinter::updateTemplate (   $name,
  $template,
  $templateid 
)

Function to Update a printer template in db.

Parameters
string$nameTemplate name
int$templateTemplate
int$templateidTemplate id
Returns
int 0 if OK; >0 if KO

Definition at line 499 of file dolreceiptprinter.class.php.

References $resql, and db.


The documentation for this class was generated from the following file: