dolibarr 20.0.0
dolReceiptPrinter Class Reference

Class to manage Receipt Printers. More...

Inheritance diagram for dolReceiptPrinter:
Collaboration diagram for dolReceiptPrinter:

Public Member Functions

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

Detailed Description

Class to manage Receipt Printers.

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

Constructor & Destructor Documentation

◆ __construct()

dolReceiptPrinter::__construct ( $db)

Constructor.

Parameters
DoliDB$dbdatabase

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

Member Function Documentation

◆ addPrinter()

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 445 of file dolreceiptprinter.class.php.

◆ addTemplate()

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 516 of file dolreceiptprinter.class.php.

◆ deletePrinter()

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 495 of file dolreceiptprinter.class.php.

◆ deleteTemplate()

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 537 of file dolreceiptprinter.class.php.

◆ initPrinter()

dolReceiptPrinter::initPrinter ( $printerid)

Function Init Printer into $this->printer.

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

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

References dol_sanitizePathName(), dol_syslog(), and getDolGlobalString().

Referenced by sendTestToPrinter(), and sendToPrinter().

◆ listPrinters()

dolReceiptPrinter::listPrinters ( )

List printers into the array ->listprinters.

Returns
int 0 if OK; >0 if KO

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

◆ listPrintersTemplates()

dolReceiptPrinter::listPrintersTemplates ( )

List printers templates.

Returns
int 0 if OK; >0 if KO

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

◆ loadTemplate()

dolReceiptPrinter::loadTemplate ( $templateid)

Function to load Template into $this->template.

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

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

Referenced by sendToPrinter().

◆ selectProfilePrinter()

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 419 of file dolreceiptprinter.class.php.

References Form\selectarray().

◆ selectTypePrinter()

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 394 of file dolreceiptprinter.class.php.

References Form\selectarray().

◆ sendTestToPrinter()

dolReceiptPrinter::sendTestToPrinter ( $printerid,
$addimgandbarcode = 0 )

Function to Send Test page to Printer.

Parameters
int$printeridPrinter id
int$addimgandbarcodeAdd image and barcode into the test
Returns
int 0 if OK; >0 if KO

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

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

◆ sendToPrinter()

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 632 of file dolreceiptprinter.class.php.

References $object, dol_now(), dol_print_date(), dol_syslog(), getDolGlobalInt(), getDolGlobalString(), initPrinter(), loadTemplate(), price(), and setEventMessages().

◆ updatePrinter()

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 470 of file dolreceiptprinter.class.php.

◆ updateTemplate()

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 560 of file dolreceiptprinter.class.php.


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