@@ -32,17 +32,20 @@ discard block |
||
32 | 32 | foreach ($order->getOrderProducts() as $orderProduct) { |
33 | 33 | $queueEntries = $orderProduct->getOrderProductQueues(); |
34 | 34 | if ($queueEntries->isEmpty()) { |
35 | - if (!isset($queues[$this->noQueue])) |
|
36 | - $queues[$this->noQueue] = []; |
|
35 | + if (!isset($queues[$this->noQueue])) { |
|
36 | + $queues[$this->noQueue] = []; |
|
37 | + } |
|
37 | 38 | $queues[$this->noQueue][] = $orderProduct; |
38 | - } else |
|
39 | - foreach ($queueEntries as $queueEntry) { |
|
39 | + } else { |
|
40 | + foreach ($queueEntries as $queueEntry) { |
|
40 | 41 | $queue = $queueEntry->getQueue(); |
42 | + } |
|
41 | 43 | $queueName = $queue ? $queue->getQueue() : $this->noQueue; |
42 | 44 | |
43 | 45 | |
44 | - if (!isset($queues[$queueName])) |
|
45 | - $queues[$queueName] = []; |
|
46 | + if (!isset($queues[$queueName])) { |
|
47 | + $queues[$queueName] = []; |
|
48 | + } |
|
46 | 49 | |
47 | 50 | $queues[$queueName][] = $orderProduct; |
48 | 51 | } |
@@ -85,8 +88,9 @@ discard block |
||
85 | 88 | |
86 | 89 | foreach ($productGroupProducts as $pgp) { |
87 | 90 | $childProduct = $pgp->getProductChild(); |
88 | - if ($childProduct) |
|
89 | - $this->addLine(" - " . $childProduct->getProduct() . " (" . $pgp->getQuantity() . " " . $childProduct->getProductUnit()->getProductUnit() . ")"); |
|
91 | + if ($childProduct) { |
|
92 | + $this->addLine(" - " . $childProduct->getProduct() . " (" . $pgp->getQuantity() . " " . $childProduct->getProductUnit()->getProductUnit() . ")"); |
|
93 | + } |
|
90 | 94 | } |
91 | 95 | } |
92 | 96 | } |
@@ -96,12 +100,13 @@ discard block |
||
96 | 100 | $this->addLine('', '', '-'); |
97 | 101 | |
98 | 102 | |
99 | - if ($deviceType === 'cielo') |
|
100 | - return [ |
|
103 | + if ($deviceType === 'cielo') { |
|
104 | + return [ |
|
101 | 105 | "operation" => "PRINT_TEXT", |
102 | 106 | "styles" => [[]], |
103 | 107 | "value" => [$this->text] |
104 | 108 | ]; |
109 | + } |
|
105 | 110 | } |
106 | 111 | |
107 | 112 | throw new Exception("Unsupported print type", 1); |