@@ -22,7 +22,7 @@ |
||
| 22 | 22 | private StatusService $statusService, |
| 23 | 23 | RequestStack $requestStack |
| 24 | 24 | ) { |
| 25 | - $this->request = $requestStack->getCurrentRequest(); |
|
| 25 | + $this->request = $requestStack->getCurrentRequest(); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | public function calculateOrderPrice(Order $order) |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $this->request = $this->requestStack->getCurrentRequest(); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - public function addOrderProduct(Order $order, Product $product, $quantity, $price, ?ProductGroup $productGroup = null, ?Product $parentProduct = null, ?OrderProduct $orderProductParent = null): OrderProduct |
|
| 35 | + public function addOrderProduct(Order $order, Product $product, $quantity, $price, ?ProductGroup $productGroup = null, ?Product $parentProduct = null, ?OrderProduct $orderProductParent = null): OrderProduct |
|
| 36 | 36 | { |
| 37 | 37 | $OProduct = new OrderProduct(); |
| 38 | 38 | $OProduct->setOrder($order); |
@@ -74,10 +74,10 @@ discard block |
||
| 74 | 74 | $this->orderProductQueueService->addProductToQueue($OProduct); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - private function checkInventory(OrderProduct &$orderProduct) |
|
| 77 | + private function checkInventory(OrderProduct & $orderProduct) |
|
| 78 | 78 | { |
| 79 | 79 | $order = $orderProduct->getOrder(); |
| 80 | - $product = $orderProduct->getProduct(); |
|
| 80 | + $product = $orderProduct->getProduct(); |
|
| 81 | 81 | |
| 82 | 82 | if ($order->getOrderType() == 'sale' && !$orderProduct->getOutInventory()) |
| 83 | 83 | $orderProduct->setOutInventory($product->getDefaultOutInventory()); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $this->checkInventory($orderProduct); |
| 98 | 98 | foreach ($subProducts as $subproduct) { |
| 99 | 99 | $product = $this->manager->getRepository(Product::class)->find($subproduct['product']); |
| 100 | - $productGroup = $this->manager->getRepository(ProductGroup::class)->find($subproduct['productGroup']); |
|
| 100 | + $productGroup = $this->manager->getRepository(ProductGroup::class)->find($subproduct['productGroup']); |
|
| 101 | 101 | $this->addSubproduct($orderProduct, $product, $productGroup, $subproduct['quantity']); |
| 102 | 102 | } |
| 103 | 103 | $this->orderProductQueueService->addProductToQueue($orderProduct); |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $quantity = $orderProduct->getQuantity(); |
| 51 | 51 | $this->printService->addLine( |
| 52 | - $indent . $quantity . ' X ' . $product->getProduct(), |
|
| 53 | - " R$ " . number_format($orderProduct->getTotal(), 2, ',', '.'), |
|
| 52 | + $indent.$quantity.' X '.$product->getProduct(), |
|
| 53 | + " R$ ".number_format($orderProduct->getTotal(), 2, ',', '.'), |
|
| 54 | 54 | '.' |
| 55 | 55 | ); |
| 56 | 56 | } |
@@ -68,10 +68,10 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | foreach ($groupedChildren as $groupName => $orderProductChildren) { |
| 71 | - $this->printService->addLine(strtoupper($groupName) . ":"); |
|
| 71 | + $this->printService->addLine(strtoupper($groupName).":"); |
|
| 72 | 72 | foreach ($orderProductChildren as $orderProductChild) { |
| 73 | 73 | $product = $orderProductChild->getProduct(); |
| 74 | - $this->printService->addLine(" - " . $product->getProduct()); |
|
| 74 | + $this->printService->addLine(" - ".$product->getProduct()); |
|
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | $this->printService->addLine('', '', '-'); |
@@ -98,21 +98,21 @@ discard block |
||
| 98 | 98 | foreach ($queues as $queueName => $orderProducts) { |
| 99 | 99 | $parentOrderProducts = array_filter($orderProducts, fn($orderProduct) => $orderProduct->getOrderProduct() === null); |
| 100 | 100 | if (!empty($parentOrderProducts)) { |
| 101 | - $this->printService->addLine(strtoupper($queueName) . ":"); |
|
| 101 | + $this->printService->addLine(strtoupper($queueName).":"); |
|
| 102 | 102 | $this->printQueueProducts($orderProducts); |
| 103 | 103 | $this->printService->addLine('', '', ' '); |
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - public function generatePrintData(Order $order, Device $device,?array $aditionalData = []): Spool |
|
| 108 | + public function generatePrintData(Order $order, Device $device, ?array $aditionalData = []): Spool |
|
| 109 | 109 | { |
| 110 | 110 | |
| 111 | - $this->printService->addLine("PEDIDO #" . $order->getId()); |
|
| 111 | + $this->printService->addLine("PEDIDO #".$order->getId()); |
|
| 112 | 112 | $this->printService->addLine($order->getOrderDate()->format('d/m/Y H:i')); |
| 113 | 113 | $client = $order->getClient(); |
| 114 | 114 | $this->printService->addLine(($client !== null ? $client->getName() : 'Não informado')); |
| 115 | - $this->printService->addLine("R$ " . number_format($order->getPrice(), 2, ',', '.')); |
|
| 115 | + $this->printService->addLine("R$ ".number_format($order->getPrice(), 2, ',', '.')); |
|
| 116 | 116 | $this->printService->addLine("", "", "-"); |
| 117 | 117 | $queues = $this->getQueues($order); |
| 118 | 118 | |