mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-04 16:12:39 +01:00
Merge pull request #13176 from andreubisquerra/master
Add orders to Receipt Printer module
This commit is contained in:
@@ -49,6 +49,8 @@
|
||||
* <dol_print_object_tax> Print object total tax
|
||||
* <dol_print_object_local_tax> Print object local tax
|
||||
* <dol_print_object_total> Print object total
|
||||
* <dol_print_order_lines_printer1> Print order lines for Printer1
|
||||
* <dol_print_order_lines_printer2> Print order lines for Printer2
|
||||
* <dol_print_payment> Print payment method
|
||||
*
|
||||
* Code which can be placed everywhere
|
||||
@@ -188,6 +190,8 @@ class dolReceiptPrinter extends Printer
|
||||
'dol_print_object_local_tax',
|
||||
'dol_print_object_total',
|
||||
'dol_print_object_number',
|
||||
'dol_print_order_lines_printer1',
|
||||
'dol_print_order_lines_printer2',
|
||||
'dol_value_customer_firstname',
|
||||
'dol_value_customer_lastname',
|
||||
'dol_value_customer_mail',
|
||||
@@ -720,6 +724,28 @@ class dolReceiptPrinter extends Printer
|
||||
case 'DOL_BEEP':
|
||||
$this->printer->getPrintConnector() -> write("\x1e");
|
||||
break;
|
||||
case 'DOL_PRINT_ORDER_LINES_PRINTER1':
|
||||
foreach ($object->lines as $line) {
|
||||
if ($line->special_code==1)
|
||||
{
|
||||
$spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - 10 - 1;
|
||||
$spaces = str_repeat(' ', $spacestoadd);
|
||||
$this->printer->text($line->ref.$spaces.$line->qty.' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
|
||||
$this->printer->text(strip_tags(htmlspecialchars_decode($line->desc))."\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'DOL_PRINT_ORDER_LINES_PRINTER2':
|
||||
foreach ($object->lines as $line) {
|
||||
if ($line->special_code==2)
|
||||
{
|
||||
$spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - 10 - 1;
|
||||
$spaces = str_repeat(' ', $spacestoadd);
|
||||
$this->printer->text($line->ref.$spaces.$line->qty.' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
|
||||
$this->printer->text(strip_tags(htmlspecialchars_decode($line->desc))."\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$this->printer->text($vals[$tplline]['tag']);
|
||||
$this->printer->text($vals[$tplline]['value']);
|
||||
|
||||
Reference in New Issue
Block a user