diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php new file mode 100644 index 00000000000..464f7895967 --- /dev/null +++ b/htdocs/admin/receiptprinter.php @@ -0,0 +1,404 @@ + + * Copyright (C) 2015 Frederic France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/admin/receiptprinter.php + * \ingroup printing + * \brief Page to setup receipt printer + */ + +require '../main.inc.php'; + +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/receiptprinter.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php'; + +$langs->load("admin"); +$langs->load("receiptprinter"); + +if (! $user->admin) accessforbidden(); + +$action = GETPOST('action','alpha'); +$mode = GETPOST('mode','alpha'); +$value = GETPOST('value','alpha'); +$varname = GETPOST('varname', 'alpha'); +$printername = GETPOST('printername', 'alpha'); +$printerid = GETPOST('printerid', 'int'); +$parameter = GETPOST('parameter', 'alpha'); + +$printer = new dolReceiptPrinter($db); + +if (!$mode) $mode='config'; + +if (!function_exists('gzdecode')) { + function gzdecode($data) + { + return gzinflate(substr($data,10,-8)); + } +} + +/* + * Action + */ + +if ($action == 'addprinter' && $user->admin) +{ + $error=0; + $db->begin(); + if (empty($printername)) { + $error++; + setEventMessages($langs->trans("PrinterNameEmpty"), null, 'errors'); + } + + if (empty($parameter)) { + setEventMessages($langs->trans("PrinterParameterEmpty"), null, 'warnings'); + } + + if (! $error) + { + $result= $printer->AddPrinter($printername, GETPOST('printertypeid', 'int'), $parameter); + if ($result > 0) $error++; + + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans("PrinterAdded",$printername), null); + } + else + { + $db->rollback(); + dol_print_error($db); + } + } + $action = ''; +} + +if ($action == 'deleteprinter' && $user->admin) +{ + $error=0; + $db->begin(); + if (empty($printerid)) { + $error++; + setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors'); + } + + if (! $error) + { + $result= $printer->DeletePrinter($printerid); + if ($result > 0) $error++; + + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans("PrinterDeleted",$printername), null); + } + else + { + $db->rollback(); + dol_print_error($db); + } + } + $action = ''; +} + +if ($action == 'updateprinter' && $user->admin) +{ + $error=0; + $db->begin(); + if (empty($printerid)) { + $error++; + setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors'); + } + + if (! $error) + { + $result= $printer->UpdatePrinter($printername, GETPOST('printertypeid', 'int'), $parameter, $printerid); + if ($result > 0) $error++; + + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans("PrinterUpdated",$printername), null); + } + else + { + $db->rollback(); + dol_print_error($db); + } + } + $action = ''; +} + +if ($action == 'testprinter' && $user->admin) +{ + $error=0; + if (empty($printerid)) { + $error++; + setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors'); + } + + if (! $error) + { + // test + $ret = $printer->SendTestToPrinter($printerid); + if ($ret == 0) + { + setEventMessages($langs->trans("TestSentToPrinter", $printername), null); + } + else + { + setEventMessages($printer->error, $printer->errors, 'errors'); + } + } + $action = ''; +} + + +/* + * View + */ + +$form = new Form($db); + +llxHeader('',$langs->trans("ReceiptPrinterSetup")); + +$linkback=''.$langs->trans("BackToModuleList").''; +print load_fiche_titre($langs->trans("ReceiptPrinterSetup"),$linkback,'title_setup'); + +$head = receiptprinteradmin_prepare_head($mode); + +if ($mode == 'config' && $user->admin) +{ + print '
'; + print ''; + if ($action!='editprinter') { + print ''; + } else { + print ''; + } + + dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), 0, 'technic'); + + print $langs->trans("ReceiptPrinterDesc")."

\n"; + + print ''."\n"; + $var=true; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + $ret = $printer->listprinters(); + if ($ret > 0) { + setEventMessages($printer->error, $printer->errors, 'errors'); + } else { + for ($line=0; $line < count($printer->listprinters); $line++) { + $var = !$var; + print ''; + if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid) { + print ''; + print ''; + $ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } else { + print ''; + switch ($printer->listprinters[$line]['fk_type']) { + case 1: + $connector = 'CONNECTOR_DUMMY'; + break; + case 2: + $connector = 'CONNECTOR_FILE_PRINT'; + break; + case 3: + $connector = 'CONNECTOR_NETWORK_PRINT'; + break; + case 4: + $connector = 'CONNECTOR_WINDOWS_PRINT'; + break; + default: + $connector = 'CONNECTOR_UNKNOWN'; + break; + } + print ''; + print ''; + // edit icon + print ''; + // delete icon + print ''; + // test icon + print ''; + print ''; + } + } + } + + if ($action!='editprinter') { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + print ''; + print ''; + $ret = $printer->selectTypePrinter(); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } + print '
'.$langs->trans("Name").''.$langs->trans("Type").''.$langs->trans("Parameters").'
'.$printer->resprint.'
'.$printer->listprinters[$line]['name'].''.$langs->trans($connector).''.$printer->listprinters[$line]['parameter'].''; + print img_picto($langs->trans("Edit"),'edit'); + print ''; + print img_picto($langs->trans("Delete"),'delete'); + print ''; + print img_picto($langs->trans("TestPrinter"),'printer'); + print '
'.$langs->trans("Name").''.$langs->trans("Type").''.$langs->trans("Parameters").'
'.$printer->resprint.'
'; + + dol_fiche_end(); + if ($action!='editprinter') { + print '
'; + } else { + print '
'; + } + print '
'; + +} + +if ($mode == 'template' && $user->admin) +{ + $tags = array( + 'dol_align_left', + 'dol_align_center', + 'dol_align_right', + 'dol_use_font_a', + 'dol_use_font_b', + 'dol_use_font_c', + 'dol_bold', + '/dol_bold', + 'dol_double_height', + '/dol_double_height', + 'dol_double_width', + '/dol_double_width', + 'dol_underline', + '/dol_underline', + 'dol_underline_2dots', + '/dol_underline', + 'dol_emphasized', + '/dol_emphasized', + 'dol_switch_colors', + '/dol_switch_colors', + 'dol_print_barcode', + 'dol_print_barcode_customer_id', + 'dol_set_print_width_57', + 'dol_cut_paper_full', + 'dol_cut_paper_partial', + 'dol_open_drawer', + 'dol_activate_buzzer', + 'dol_print_qrcode', + 'dol_print_date', + 'dol_print_date_time', + 'dol_print_year', + 'dol_print_month_letters', + 'dol_print_month', + 'dol_print_day', + 'dol_print_day_letters', + 'dol_print_table', + 'dol_print_cutlery', + 'dol_print_payment', + 'dol_print_logo', + 'dol_print_logo_old', + 'dol_print_order_lines', + 'dol_print_order_tax', + 'dol_print_order_local_tax', + 'dol_print_order_total', + 'dol_print_order_number', + 'dol_print_order_number_unique', + 'dol_print_customer_first_name', + 'dol_print_customer_last_name', + 'dol_print_customer_mail', + 'dol_print_customer_telephone', + 'dol_print_customer_mobile', + 'dol_print_customer_skype', + 'dol_print_customer_tax_number', + 'dol_print_customer_account_balance', + 'dol_print_vendor_last_name', + 'dol_print_vendor_first_name', + 'dol_print_vendor_mail', + 'dol_print_customer_points', + 'dol_print_order_points', + 'dol_print_if_customer', + 'dol_print_if_vendor', + 'dol_print_if_happy_hour', + 'dol_print_if_num_order_unique', + 'dol_print_if_customer_points', + 'dol_print_if_order_points', + 'dol_print_if_customer_tax_number', + 'dol_print_if_customer_account_balance_positive', + ); + + print '
'; + print ''; + print ''; + + dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), 0, 'technic'); + + print $langs->trans("ReceiptPrinterTemplateDesc")."

\n"; + print ''."\n"; + $var=true; + print ''; + print ''; + print ''; + print "\n"; + print '
'.$langs->trans("Template").'
'; + print '
'; + print ''."\n"; + $var=true; + print ''; + print ''; + print ''; + print "\n"; + for ($tag=0; $tag < count($tags); $tag++) { + $var = !$var; + print ''; + print ''; + print ''; + } + print '
'.$langs->trans("Tag").''.$langs->trans("Description").'
<'.$tags[$tag].'>'.$langs->trans(strtoupper($tags[$tag])).'
'; + dol_fiche_end(); + +} + + +llxFooter(); + +$db->close(); + diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php index 74560e8ff6a..a7c1b419012 100644 --- a/htdocs/cashdesk/admin/cashdesk.php +++ b/htdocs/cashdesk/admin/cashdesk.php @@ -58,6 +58,7 @@ if (GETPOST('action','alpha') == 'set') $res = dolibarr_set_const($db,"CASHDESK_ID_WAREHOUSE",(GETPOST('CASHDESK_ID_WAREHOUSE','alpha') > 0 ? GETPOST('CASHDESK_ID_WAREHOUSE','alpha') : ''),'chaine',0,'',$conf->entity); $res = dolibarr_set_const($db,"CASHDESK_NO_DECREASE_STOCK",GETPOST('CASHDESK_NO_DECREASE_STOCK','alpha'),'chaine',0,'',$conf->entity); $res = dolibarr_set_const($db,"CASHDESK_SERVICES", GETPOST('CASHDESK_SERVICES','alpha'),'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db,"CASHDESK_DOLIBAR_RECEIPT_PRINTER", GETPOST('CASHDESK_DOLIBAR_RECEIPT_PRINTER','alpha'),'chaine',0,'',$conf->entity); dol_syslog("admin/cashdesk: level ".GETPOST('level','alpha')); @@ -169,6 +170,17 @@ if (! empty($conf->service->enabled)) print "\n"; } +// Use Dolibarr Receipt Printer +if (! empty($conf->receiptprinter->enabled)) +{ + $var=! $var; + print ''; + print $langs->trans("DolibarrReceiptPrinter"); + print ''; + print $form->selectyesno("CASHDESK_DOLIBAR_RECEIPT_PRINTER",$conf->global->CASHDESK_DOLIBAR_RECEIPT_PRINTER,1); + print "\n"; +} + print ''; print '
'; diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 683efdd1dde..7a9c1be888a 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -19,78 +19,92 @@ /** * \file htdocs/core/class/dolreceiptprinter.class.php - * \brief Print receipt ticket on various printer + * \brief Print receipt ticket on various ESC/POS printer */ /* - * codes for ticket template + * Tags for ticket template * - * Left align text - * Center text - * Right align text - * Use font A of printer - * Use font B of printer - * Use font C of printer - * Text Bold - * Text double height - * Text double width - * Underline text - * Underline with double line - * Emphasized text - * Print in white on black - * Print barcode - * Print barcode customer id - * Ticket print width of 57mm - * Cut ticket completely - * Cut ticket partially - * Open cash drawer - * Activate buzzer + * Left align text + * Center text + * Right align text + * Use font A of printer + * Use font B of printer + * Use font C of printer + * Text Bold + * Text double height + * Text double width + * Underline text + * Underline with double line + * Emphasized text + * Print in white on black + * Print barcode + * Print barcode customer id + * Ticket print width of 57mm + * Cut ticket completely + * Cut ticket partially + * Open cash drawer + * Activate buzzer * * Code which can be placed everywhere - * Print QR Code - * Print date (format : AAAA-MM-DD) - * Print date and time (format AAAA-MM-DD HH:MM:SS) - * Print Year - * Print month in letters (example : november) - * Print month number - * Print day number - * Print table number - * Print cutlery number - * Print payment method - * Print logo stored on printer. Example : 32|32 - * Print logo stored on printer. Must be followed by logo code. For old printers. - * Print order number - * Print order number after validation - * Print customer firstname - * Print customer name - * Print customer mail - * Print customer phone - * Print customer mobile - * Print customer skype - * Print customer VAT number - * Print customer account balance - * Print vendor name - * Print vendor firstname - * Print customer points - * Print number of points for this order + * Print QR Code + * Print date AAAA-MM-DD + * Print date and time AAAA-MM-DD HH:MM:SS + * Print Year + * Print month in letters (example : november) + * Print month number + * Print day number + * Print day number + * Print table number (for restaurant, bar...) + * Print number of cutlery (for restaurant) + * Print payment method + * Print logo stored on printer. Example : 32|32 + * Print logo stored on printer. Must be followed by logo code. For old printers. + * Print order lines + * Print order total tax + * Print order local tax + * Print order total + * Print order number + * Print order number after validation + * Print customer firstname + * Print customer name + * Print customer mail + * Print customer phone + * Print customer mobile + * Print customer skype + * Print customer VAT number + * Print customer account balance + * Print vendor name + * Print vendor firstname + * Print vendor mail + * Print customer points + * Print number of points for this order * * Conditional code at line start (if…then Print) - * Print the line IF a customer is affected to the order - * Print the line IF a vendor is affected to the order - * Print the line IF Happy Hour - * Print the line IF order is validated - * Print the line IF customer points > 0 - * Print the line IF points of the order > 0 - * Print the line IF customer has vat number - * Print the line IF customer balance > 0 + * Print the line IF a customer is affected to the order + * Print the line IF a vendor is affected to the order + * Print the line IF Happy Hour + * Print the line IF order is validated + * Print the line IF customer points > 0 + * Print the line IF points of the order > 0 + * Print the line IF customer has vat number + * Print the line IF customer balance > 0 * */ +require_once DOL_DOCUMENT_ROOT .'/includes/escpos/Escpos.php'; + + /** * Class to manage Receipt Printers */ -class dolReceiptPrinter +class dolReceiptPrinter extends Escpos { + const CONNECTOR_DUMMY = 1; + const CONNECTOR_FILE_PRINT = 2; + const CONNECTOR_NETWORK_PRINT = 3; + const CONNECTOR_WINDOWS_PRINT = 4; + //const CONNECTOR_JAVA = 6; var $db; var $error; var $errors; @@ -107,5 +121,191 @@ class dolReceiptPrinter $this->db=$db; } + /** + * Constructor + * + * @return int 0 if OK; >0 if KO + */ + function listPrinters() + { + global $conf; + $error = 0; + $line = 0; + $sql = 'SELECT rowid, name, fk_type, parameter'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'printer_receipt'; + $sql.= ' WHERE entity = '.$conf->entity; + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + while ($line < $num) { + $obj[] = $this->db->fetch_array($resql); + $line++; + } + } else { + $error++; + $this->errors[] = $this->db->lasterror; + } + $this->listprinters = $obj; + return $error; + } + + + /** + * Form to Select type printer + * + * @param string $selected Id printer type pre-selected + * @param string $htmlname select html name + * @return int 0 if OK; >0 if KO + */ + function selectTypePrinter($selected='', $htmlname='printertypeid') + { + global $langs; + $error = 0; + $html = ''; + + $this->resprint = $html; + return $error; + } + + /** + * Function to Add a printer in db + * + * @param string $name Printer name + * @param int $type Printer type + * @param string $parameter Printer parameter + * @return int 0 if OK; >0 if KO + */ + function AddPrinter($name, $type, $parameter) + { + global $conf; + $error = 0; + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt'; + $sql.= ' (name, fk_type, parameter, entity)'; + $sql.= ' VALUES ("'.$name.'", '.$type.', "'.$parameter.'", '.$conf->entity.')'; + $resql = $this->db->query($sql); + if (! $resql) { + $error++; + $this->errors[] = $this->db->lasterror; + } + return $error; + } + + /** + * Function to Update a printer in db + * + * @param string $name Printer name + * @param int $type Printer type + * @param string $parameter Printer parameter + * @param int $printerid Printer id + * @return int 0 if OK; >0 if KO + */ + function UpdatePrinter($name, $type, $parameter, $printerid) + { + global $conf; + $error = 0; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt'; + $sql.= ' SET name="'.$name.'"'; + $sql.= ', fk_type='.$type; + $sql.= ', parameter="'.$parameter.'"'; + $sql.= ' WHERE rowid='.$printerid; + $resql = $this->db->query($sql); + if (! $resql) { + $error++; + $this->errors[] = $this->db->lasterror; + } + return $error; + } + + /** + * Function to Delete a printer from db + * + * @param int $printerid Printer id + * @return int 0 if OK; >0 if KO + */ + function DeletePrinter($printerid) + { + global $conf; + $error = 0; + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'printer_receipt'; + $sql.= ' WHERE rowid='.$printerid; + $resql = $this->db->query($sql); + if (! $resql) { + $error++; + $this->errors[] = $this->db->lasterror; + } + return $error; + } + + /** + * Function to Send Test äge to Printer + * + * @param int $printerid Printer id + * @return int 0 if OK; >0 if KO + */ + function SendTestToPrinter($printerid) + { + global $conf; + $error = 0; + $sql = 'SELECT rowid, name, fk_type, parameter'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'printer_receipt'; + $sql.= ' WHERE rowid = '.$printerid; + $sql.= ' AND entity = '.$conf->entity; + $resql = $this->db->query($sql); + if ($resql) { + $obj = $this->db->fetch_array($resql); + } else { + $error++; + $this->errors[] = $this->db->lasterror; + } + //print '
'.print_r($obj, true).'
'; + if (! $error) { + $parameter = $obj['parameter']; + try { + switch ($obj['fk_type']) { + case 1: + require_once DOL_DOCUMENT_ROOT .'/includes/escpos/src/DummyPrintConnector.php'; + $connector = new DummyPrintConnector(); + break; + case 2: + $connector = new FilePrintConnector($parameter); + break; + case 3: + $parameters = explode(':', $parameter); + $connector = new NetworkPrintConnector($parameters[0], $parameters[1]); + break; + case 4: + $connector = new WindowsPrintConnector($parameter); + break; + default: + $connector = 'CONNECTOR_UNKNOWN'; + break; + } + $testprinter = new Escpos($connector); + $img = new EscposImage(DOL_DOCUMENT_ROOT .'/theme/common/dolibarr_logo_bw.png'); + $testprinter -> graphics($img); + $testprinter -> text("Hello World!\n"); + $testStr = "Testing 123"; + $testprinter -> qrCode($testStr); + $testprinter -> text("Most simple example\n"); + $testprinter -> feed(); + $testprinter -> cut(); + //print '
'.print_r($connector, true).'
'; + $testprinter -> close(); + + //print '
'.print_r($connector, true).'
'; + //print '
'.print_r($testprinter, true).'
'; + } catch (Exception $e) { + $this->errors[] = $e->getMessage(); + $error++; + } + } + return $error; + } } diff --git a/htdocs/core/lib/receiptprinter.lib.php b/htdocs/core/lib/receiptprinter.lib.php new file mode 100644 index 00000000000..d440acc5403 --- /dev/null +++ b/htdocs/core/lib/receiptprinter.lib.php @@ -0,0 +1,72 @@ + + * Copyright (C) 2015 Frederic France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/core/lib/receiptprinter.lib.php + * \ingroup printing + * \brief Library for receipt printer functions + */ + + + +/** + * Define head array for tabs of receipt printer setup pages + * + * @param string $mode Mode + * @return Array of head + */ +function receiptprinteradmin_prepare_head($mode) +{ + global $langs, $conf; + + $h = 0; + $head = array(); + + $head[$h][0] = DOL_URL_ROOT."/admin/receiptprinter.php?mode=config"; + $head[$h][1] = $langs->trans("ListPrinters"); + $head[$h][2] = 'config'; + $h++; + + $head[$h][0] = DOL_URL_ROOT."/admin/receiptprinter.php?mode=template"; + $head[$h][1] = $langs->trans("SetupReceiptTemplate"); + $head[$h][2] = 'template'; + $h++; + + if ($mode == 'test') + { + $head[$h][0] = DOL_URL_ROOT."/admin/receiptprinter.php?mode=test"; + $head[$h][1] = $langs->trans("TargetedPrinter"); + $head[$h][2] = 'test'; + $h++; + } + + + //$object=new stdClass(); + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab + // $this->tabs = array('entity:-tabname); to remove a tab + //complete_head_from_modules($conf,$langs,$object,$head,$h,'printingadmin'); + + //complete_head_from_modules($conf,$langs,$object,$head,$h,'printing','remove'); + + return $head; +} + + diff --git a/htdocs/core/modules/modReceiptPrinter.class.php b/htdocs/core/modules/modReceiptPrinter.class.php index 033303fdcd9..a4cf99373fa 100644 --- a/htdocs/core/modules/modReceiptPrinter.class.php +++ b/htdocs/core/modules/modReceiptPrinter.class.php @@ -50,7 +50,7 @@ class modReceiptPrinter extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) - $this->description = "Receipt Printer."; + $this->description = "ReceiptPrinterDesc"; $this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) @@ -70,7 +70,7 @@ class modReceiptPrinter extends DolibarrModules $this->depends = array(); $this->requiredby = array(); $this->phpmin = array(5,1); // Minimum version of PHP required by module - $this->need_dolibarr_version = array(3,7,-2); // Minimum version of Dolibarr required by module + $this->need_dolibarr_version = array(3,9,-2); // Minimum version of Dolibarr required by module $this->conflictwith = array(); $this->langfiles = array("receiptprinter"); diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index d3dcfb68e64..f3b5f77f296 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -38,3 +38,4 @@ ShowStock=Show warehouse DeleteArticle=Click to remove this article FilterRefOrLabelOrBC=Search (Ref/Label) UserNeedPermissionToEditStockToUsePos=You ask to decrease stock on invoice creation, so user that use POS need to have permission to edit stock. +DolibarrReceiptPrinter=Dolibarr Receipt Printer diff --git a/htdocs/langs/en_US/receiptprinter.lang b/htdocs/langs/en_US/receiptprinter.lang new file mode 100644 index 00000000000..d95b1631b40 --- /dev/null +++ b/htdocs/langs/en_US/receiptprinter.lang @@ -0,0 +1,80 @@ +# Dolibarr language file - Source file is en_US - receiptprinter +PrinterAdded=Printer %s added +PrinterUpdated=Printer %s updated +PrinterDeleted=Printer %s deleted +TestSentToPrinter=Test Sent To Printer %s +CONNECTOR_DUMMY=Dummy Printer +CONNECTOR_NETWORK_PRINT=Network Printer +CONNECTOR_FILE_PRINT=Local Printer +CONNECTOR_WINDOWS_PRINT=Local Windows Printer +CONNECTOR_DUMMY_HELP=Fake Printer for test, does nothing +CONNECTOR_NETWORK_PRINT_HELP=10.x.x.x:9100 +CONNECTOR_FILE_PRINT_HELP=/dev/usb/lp0, /dev/usb/lp1 +CONNECTOR_WINDOWS_PRINT_HELP=LPT1, COM1, smb://FooUser:secret@computername/workgroup/Receipt Printer +DOL_ALIGN_LEFT=Left align text +DOL_ALIGN_CENTER=Center text +DOL_ALIGN_RIGHT=Right align text +DOL_USE_FONT_A=Use font A of printer +DOL_USE_FONT_B=Use font B of printer +DOL_USE_FONT_C=Use font C of printer +DOL_BOLD=Text Bold +/DOL_BOLD=End of Text Bold +DOL_DOUBLE_HEIGHT=Text double height +/DOL_DOUBLE_HEIGHT=End of Text double height +DOL_DOUBLE_WIDTH=Text double width +/DOL_DOUBLE_WIDTH=End of Text double width +DOL_UNDERLINE=Underline text +/DOL_UNDERLINE=End of Underline text +DOL_UNDERLINE_2DOTS=Underline with double line +/DOL_UNDERLINE_2DOTS=End of Underline with double line +DOL_EMPHASIZED=Emphasized text +/DOL_EMPHASIZED=End of Emphasized text +DOL_SWITCH_COLORS=Print in white on black +/DOL_SWITCH_COLORS=End of Print in white on black +DOL_PRINT_BARCODE=Print barcode +DOL_PRINT_BARCODE_CUSTOMER_ID=Print barcode customer id +DOL_SET_PRINT_WIDTH_57=Ticket print width of 57mm +DOL_CUT_PAPER_FULL=Cut ticket completely +DOL_CUT_PAPER_PARTIAL=Cut ticket partially +DOL_OPEN_DRAWER=Open cash drawer +DOL_ACTIVATE_BUZZER=Activate buzzer +DOL_PRINT_QRCODE=Print QR Code +DOL_PRINT_DATE=Print date AAAA-MM-DD +DOL_PRINT_DATE_TIME=Print date and time AAAA-MM-DD HH:MM:SS +DOL_PRINT_YEAR=Print Year +DOL_PRINT_MONTH_LETTERS=Print month in letters (example : november) +DOL_PRINT_MONTH=Print month number +DOL_PRINT_DAY=Print day number +DOL_PRINT_DAY_LETTERS=Print day number +DOL_PRINT_TABLE=Print table number (for restaurant, bar...) +DOL_PRINT_CUTLERY=Print number of cutlery (for restaurant) +DOL_PRINT_PAYMENT=Print payment method +DOL_PRINT_LOGO=Print logo stored on printer. Example : 32|32 +DOL_PRINT_LOGO_OLD=Print logo stored on printer. Must be followed by logo code. For old printers. +DOL_PRINT_ORDER_LINES=Print order lines +DOL_PRINT_ORDER_TAX=Print order total tax +DOL_PRINT_ORDER_LOCAL_TAX=Print order local tax +DOL_PRINT_ORDER_TOTAL=Print order total +DOL_PRINT_ORDER_NUMBER=Print order number +DOL_PRINT_ORDER_NUMBER_UNIQUE=Print order number after validation +DOL_PRINT_CUSTOMER_FIRST_NAME=Print customer firstname +DOL_PRINT_CUSTOMER_LAST_NAME=Print customer name +DOL_PRINT_CUSTOMER_MAIL=Print customer mail +DOL_PRINT_CUSTOMER_TELEPHONE=Print customer phone +DOL_PRINT_CUSTOMER_MOBILE=Print customer mobile +DOL_PRINT_CUSTOMER_SKYPE=Print customer skype +DOL_PRINT_CUSTOMER_TAX_NUMBER=Print customer VAT number +DOL_PRINT_CUSTOMER_ACCOUNT_BALANCE=Print customer account balance +DOL_PRINT_VENDOR_LAST_NAME=Print vendor name +DOL_PRINT_VENDOR_FIRST_NAME=Print vendor firstname +DOL_PRINT_VENDOR_MAIL=Print vendor mail +DOL_PRINT_CUSTOMER_POINTS=Print customer points +DOL_PRINT_ORDER_POINTS=Print number of points for this order +DOL_PRINT_IF_CUSTOMER=Print the line IF a customer is affected to the order +DOL_PRINT_IF_VENDOR=Print the line IF a vendor is affected to the order +DOL_PRINT_IF_HAPPY_HOUR=Print the line IF Happy Hour +DOL_PRINT_IF_NUM_ORDER_UNIQUE=Print the line IF order is validated +DOL_PRINT_IF_CUSTOMER_POINTS=Print the line IF customer points > 0 +DOL_PRINT_IF_ORDER_POINTS=Print the line IF points of the order > 0 +DOL_PRINT_IF_CUSTOMER_TAX_NUMBER=Print the line IF customer has vat number +DOL_PRINT_IF_CUSTOMER_ACCOUNT_BALANCE_POSITIVE=Print the line IF customer balance > 0 diff --git a/htdocs/theme/common/dolibarr_logo_bw.png b/htdocs/theme/common/dolibarr_logo_bw.png new file mode 100644 index 00000000000..238a1899c00 Binary files /dev/null and b/htdocs/theme/common/dolibarr_logo_bw.png differ