dolReceiptPrinter
class dolReceiptPrinter extends Printer (View source)
Class to manage Receipt Printers
Constants
| CONNECTOR_DUMMY |
|
| CONNECTOR_FILE_PRINT |
|
| CONNECTOR_NETWORK_PRINT |
|
| CONNECTOR_WINDOWS_PRINT |
|
| CONNECTOR_CUPS_PRINT |
|
Properties
| DoliDB | $db | ||
| string[] | $tags | ||
| Printer | $printer | ||
| string | $template | ||
| int | $orderprinter | Number of order printer |
|
| array<array{rowid: int, name: string, fk_type: int, fk_type_name: string, fk_profile: int, fk_profile_name: string, parameter: string}> | $listprinters | Array with list of printers |
|
| array<array{rowid: int, name: string, template: string}> | $listprinterstemplates | Array with list of printer templates |
|
| string | $profileresprint | ||
| string | $resprint | ||
| string | $error | ||
| string[] | $errors |
Methods
List printers into the array ->listprinters
List printers templates
Form to Select type printer
Form to Select Profile printer
Function to Add a printer in db
Function to Update a printer in db
Function to Delete a printer from db
Function to add a printer template in db
Function to delete a printer template in db
Function to Update a printer template in db
Function to Send Test page to Printer
Function to Print Receipt Ticket
Function to load Template into $this->template
Function Init Printer into $this->printer
Details
__construct(DoliDB $db)
Constructor
int
listPrinters()
List printers into the array ->listprinters
int
listPrintersTemplates()
List printers templates
selectTypePrinter($selected = '', string $htmlname = 'printertypeid')
Form to Select type printer
@param string $selected Id printer type pre-selected
selectProfilePrinter($selected = '', string $htmlname = 'printerprofileid')
Form to Select Profile printer
@param string $selected Id printer profile pre-selected
addPrinter($name, int $type, $profile, $parameter)
Function to Add a printer in db
@param string $name Printer name
updatePrinter($name, int $type, $profile, $parameter, $printerid)
Function to Update a printer in db
@param string $name Printer name
int
deletePrinter($printerid)
Function to Delete a printer from db
@param int $printerid Printer id
addTemplate($name, string $template)
Function to add a printer template in db
@param string $name Template name
int
deleteTemplate($templateid)
Function to delete a printer template in db
@param int $templateid Template ID
updateTemplate($name, string $template, $templateid)
Function to Update a printer template in db
@param string $name Template name
sendTestToPrinter($printerid, int $addimgandbarcode = 0)
Function to Send Test page to Printer
@param int $printerid Printer id
sendToPrinter($object, int $templateid, $printerid)
Function to Print Receipt Ticket
@param Facture|Commande $object Order or invoice object
int
loadTemplate($templateid)
Function to load Template into $this->template
@param int $templateid Template id
void|int
initPrinter($printerid)
Function Init Printer into $this->printer
@param int $printerid Printer id