This commit is contained in:
Marc Ole Bulling 2021-01-15 02:08:09 +01:00
parent 2088e4be5b
commit c58620f898
No known key found for this signature in database
GPG Key ID: C126AFC2A47B06FF

View File

@ -2,6 +2,7 @@
namespace Grocy\Services;
use DateTime;
use Exception;
use Mike42\Escpos\PrintConnectors\NetworkPrintConnector;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
@ -33,6 +34,9 @@ class PrintService extends BaseService
*/
private static function printHeader(Printer $printer)
{
$date = new DateTime();
$dateFormatted = $date->format('d/m/Y H:i');
$printer->setJustification(Printer::JUSTIFY_CENTER);
$printer->selectPrintMode(Printer::MODE_DOUBLE_WIDTH);
$printer->setTextSize(4, 4);
@ -41,8 +45,11 @@ class PrintService extends BaseService
$printer->setJustification();
$printer->setTextSize(1, 1);
$printer->setReverseColors(false);
$printer->feed(2);
$printer->text($dateFormatted);
$printer->selectPrintMode();
$printer->feed(3);
}
/**