diff --git a/COPYRIGHT b/COPYRIGHT
index 1af09e6fdaf..fe707c1d63d 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -2,7 +2,7 @@
License
-------
-Dolibarr is released under the terms of the GNU General Public License as
+Dolibarr is released 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 (GPL-3+).
More information: https://www.gnu.org/licenses/gpl-3.0.txt
@@ -15,13 +15,13 @@ PHP libraries:
AdoDb-Date 0.36 Modified BSD License Yes Date convertion (not into rpm package)
CKEditor 4.12.1 LGPL-2.1+ Yes Editor WYSIWYG
EvalMath 1.0 BSD Yes Safe math expressions evaluation
-Escpos-php ? MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
+Escpos-php 2.2 MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)
Mobiledetect 2.8.33 MIT License Yes Detect mobile devices browsers
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
ParseDown 1.6 MIT License Yes Markdown parser
-PHPDebugBar 1.15.0 MIT License Yes Used only by the module "debugbar" for developers
+PHPDebugBar 1.15.0 MIT License Yes Used only by the module "debugbar" for developers
PHPExcel 1.8.1 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
PHPSpreadSheet ? LGPL-2.1+ Yes Read/Write XLS files, read ODS files
php-iban 1.4.7 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
@@ -37,7 +37,7 @@ TCPDF 6.3.2 LGPL-3+ Yes
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
JS libraries:
-Ace 1.4.6 BSD Yes JS library to get code syntaxique coloration in a textarea.
+Ace 1.4.6 BSD Yes JS library to get code syntaxique coloration in a textarea.
jQuery 3.4.1 MIT License Yes JS library
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
jQuery select2 4.0.5 GPL and Apache License Yes JS library plugin for sexier multiselect
diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php
index 42b0ecb9ea9..e01fc4402a8 100644
--- a/htdocs/admin/receiptprinter.php
+++ b/htdocs/admin/receiptprinter.php
@@ -174,14 +174,19 @@ if ($action == 'testtemplate' && $user->admin) {
// }
// if (! $error) {
- // // test
- // $ret = $printer->sendTestToPrinter($printerid);
- // if ($ret == 0) {
- setEventMessages($langs->trans("TestTemplateToPrinter", $printername), null);
- // } else {
- // setEventMessages($printer->error, $printer->errors, 'errors');
- // }
- // }
+ // test
+ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
+ $object = new Facture($db);
+ //$object->initAsSpecimen();
+ $object->fetch(8);
+ //var_dump($object->lines);
+ $ret = $printer->sendToPrinter($object, $templateid, 1);
+ if ($ret == 0) {
+ setEventMessages($langs->trans("TestTemplateToPrinter", $printername), null);
+ } else {
+ setEventMessages($printer->error, $printer->errors, 'errors');
+ }
+ //}
$action = '';
}
@@ -310,7 +315,7 @@ if ($mode == 'config' && $user->admin) {
}
}
- if ($action!='editprinter') {
+ if ($action != 'editprinter') {
if ($nbofprinters > 0) {
print '
';
@@ -462,18 +467,6 @@ if ($mode == 'template' && $user->admin) {
dol_fiche_end();
}
-// to remove after test
-// $object=new stdClass();
-// $object->date_time = '2015-11-02 22:30:25';
-// $object->id = 1234;
-// $object->customer_firstname = 'John';
-// $object->customer_lastname = 'Deuf';
-// $object->vendor_firstname = 'Jim';
-// $object->vendor_lastname = 'Big';
-// $object->barcode = '3700123862396';
-//$printer->sendToPrinter($object, 1, 16);
-//setEventMessages($printer->error, $printer->errors, 'errors');
-
// End of page
llxFooter();
$db->close();
diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php
index 1f9ea78bf95..c18c6e0be9b 100644
--- a/htdocs/core/class/dolreceiptprinter.class.php
+++ b/htdocs/core/class/dolreceiptprinter.class.php
@@ -59,12 +59,12 @@
* 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 object lines
+ * Print object total tax
+ * Print object local tax
+ * Print object total
+ * Print object number
+ * Print object number after validation
* Print customer firstname
* Print customer name
* Print customer mail
@@ -77,15 +77,15 @@
* Print vendor firstname
* Print vendor mail
* Print customer points
- * Print number of points for this order
+ * Print number of points for this object
*
* 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 a customer is affected to the object
+ * Print the line IF a vendor is affected to the object
* Print the line IF Happy Hour
- * Print the line IF order is validated
+ * Print the line IF object is validated
* Print the line IF customer points > 0
- * Print the line IF points of the order > 0
+ * Print the line IF points of the object > 0
* Print the line IF customer has vat number
* Print the line IF customer balance > 0
*
@@ -141,6 +141,7 @@ class dolReceiptPrinter extends Printer
{
$this->db=$db;
$this->tags = array(
+ 'dol_line_feed',
'dol_align_left',
'dol_align_center',
'dol_align_right',
@@ -167,7 +168,8 @@ class dolReceiptPrinter extends Printer
'dol_cut_paper_full',
'dol_cut_paper_partial',
'dol_open_drawer',
- 'dol_activate_buzzer',
+ //'dol_activate_buzzer',
+ 'dol_print_text',
'dol_print_qrcode',
'dol_print_date',
'dol_print_date_time',
@@ -181,12 +183,14 @@ class dolReceiptPrinter extends Printer
'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_object_id',
+ 'dol_print_object_ref',
+ 'dol_print_object_lines',
+ 'dol_print_object_tax',
+ 'dol_print_object_local_tax',
+ 'dol_print_object_total',
+ 'dol_print_object_number',
+ 'dol_print_object_number_unique',
'dol_print_customer_firstname',
'dol_print_customer_lastname',
'dol_print_customer_mail',
@@ -199,13 +203,13 @@ class dolReceiptPrinter extends Printer
'dol_print_vendor_firstname',
'dol_print_vendor_mail',
'dol_print_customer_points',
- 'dol_print_order_points',
+ 'dol_print_object_points',
'dol_print_if_customer',
'dol_print_if_vendor',
'dol_print_if_happy_hour',
- 'dol_print_if_num_order_unique',
+ 'dol_print_if_num_object_unique',
'dol_print_if_customer_points',
- 'dol_print_if_order_points',
+ 'dol_print_if_object_points',
'dol_print_if_customer_tax_number',
'dol_print_if_customer_account_balance_positive',
);
@@ -521,12 +525,13 @@ class dolReceiptPrinter extends Printer
*/
public function sendToPrinter($object, $templateid, $printerid)
{
- global $conf;
+ global $conf, $mysoc;
$error = 0;
$ret = $this->loadTemplate($templateid);
// tags a remplacer par leur valeur avant de parser
- $this->template = str_replace('', $object->id, $this->template);
+ $this->template = str_replace('', $object->id, $this->template);
+ $this->template = str_replace('', $object->ref, $this->template);
$this->template = str_replace('', $object->customer_firstname, $this->template);
$this->template = str_replace('', $object->customer_lastname, $this->template);
$this->template = str_replace('', $object->customer_mail, $this->template);
@@ -536,7 +541,7 @@ class dolReceiptPrinter extends Printer
$this->template = str_replace('', $object->customer_tax_number, $this->template);
$this->template = str_replace('', $object->customer_account_balance, $this->template);
$this->template = str_replace('', $object->customer_points, $this->template);
- $this->template = str_replace('', $object->order_points, $this->template);
+ $this->template = str_replace('', $object->object_points, $this->template);
$this->template = str_replace('', $object->vendor_firstname, $this->template);
$this->template = str_replace('', $object->vendor_lastname, $this->template);
$this->template = str_replace('', $object->vendor_mail, $this->template);
@@ -558,78 +563,92 @@ class dolReceiptPrinter extends Printer
//print '