Squashed commit

Always execute migration 9999 (can be used to fix things manually)
Optimized meal plan navigation / date range filtering
Prepared next release
Pulled translations from Transifex
Various code optimizations
This commit is contained in:
Bernd Bestel
2021-07-16 17:32:08 +02:00
parent 2d1d5d46f6
commit edfa404ed6
58 changed files with 312 additions and 513 deletions

View File

@@ -10,6 +10,39 @@ use Mike42\Escpos\Printer;
class PrintService extends BaseService
{
/**
* @param bool $printHeader Printing of Grocy logo
* @param string[] $lines Items to print
* @return string[] Returns array with result OK if no exception
* @throws Exception If unable to print, an exception is thrown
*/
public function printShoppingList(bool $printHeader, array $lines): array
{
$printer = self::getPrinterHandle();
if ($printer === false)
{
throw new Exception('Unable to connect to printer');
}
if ($printHeader)
{
self::printHeader($printer);
}
foreach ($lines as $line)
{
$printer->text($line);
$printer->feed();
}
$printer->feed(3);
$printer->cut();
$printer->close();
return [
'result' => 'OK'
];
}
/**
* Initialises the printer
* @return Printer Printer handle
@@ -50,37 +83,4 @@ class PrintService extends BaseService
$printer->selectPrintMode();
$printer->feed(2);
}
/**
* @param bool $printHeader Printing of Grocy logo
* @param string[] $lines Items to print
* @return string[] Returns array with result OK if no exception
* @throws Exception If unable to print, an exception is thrown
*/
public function printShoppingList(bool $printHeader, array $lines): array
{
$printer = self::getPrinterHandle();
if ($printer === false)
{
throw new Exception('Unable to connect to printer');
}
if ($printHeader)
{
self::printHeader($printer);
}
foreach ($lines as $line)
{
$printer->text($line);
$printer->feed();
}
$printer->feed(3);
$printer->cut();
$printer->close();
return [
'result' => 'OK'
];
}
}