@@ -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) |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $this->request = $this->requestStack->getCurrentRequest(); |
34 | 34 | } |
35 | 35 | |
36 | - public function addOrderProduct(Order $order, Product $product, $quantity, $price, ?ProductGroup $productGroup = null, ?Product $parentProduct = null, ?OrderProduct $orderProductParent = null): OrderProduct |
|
36 | + public function addOrderProduct(Order $order, Product $product, $quantity, $price, ?ProductGroup $productGroup = null, ?Product $parentProduct = null, ?OrderProduct $orderProductParent = null): OrderProduct |
|
37 | 37 | { |
38 | 38 | $OProduct = new OrderProduct(); |
39 | 39 | $OProduct->setOrder($order); |
@@ -75,10 +75,10 @@ discard block |
||
75 | 75 | $this->orderProductQueueService->addProductToQueue($OProduct); |
76 | 76 | } |
77 | 77 | |
78 | - private function checkInventory(OrderProduct &$orderProduct) |
|
78 | + private function checkInventory(OrderProduct & $orderProduct) |
|
79 | 79 | { |
80 | 80 | $order = $orderProduct->getOrder(); |
81 | - $product = $orderProduct->getProduct(); |
|
81 | + $product = $orderProduct->getProduct(); |
|
82 | 82 | |
83 | 83 | if ($order->getOrderType() == 'sale' && !$orderProduct->getOutInventory()) |
84 | 84 | $orderProduct->setOutInventory($product->getDefaultOutInventory()); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $subProducts = $json['sub_products']; |
100 | 100 | foreach ($subProducts as $subproduct) { |
101 | 101 | $product = $this->manager->getRepository(Product::class)->find($subproduct['product']); |
102 | - $productGroup = $this->manager->getRepository(ProductGroup::class)->find($subproduct['productGroup']); |
|
102 | + $productGroup = $this->manager->getRepository(ProductGroup::class)->find($subproduct['productGroup']); |
|
103 | 103 | $this->addSubproduct($orderProduct, $product, $productGroup, $subproduct['quantity']); |
104 | 104 | } |
105 | 105 | } |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | if ($printForm) $this->printService->addLine('', '', ' '); |
68 | 68 | |
69 | 69 | $this->printService->addLine( |
70 | - $indent . $quantity . ' X ' . $product->getProduct(), |
|
71 | - " R$ " . number_format($total, 2, ',', '.'), |
|
70 | + $indent.$quantity.' X '.$product->getProduct(), |
|
71 | + " R$ ".number_format($total, 2, ',', '.'), |
|
72 | 72 | '.' |
73 | 73 | ); |
74 | 74 | |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | foreach ($groupedChildren as $groupName => $orderProductChildren) { |
91 | - $this->printService->addLine(strtoupper($groupName) . ":"); |
|
91 | + $this->printService->addLine(strtoupper($groupName).":"); |
|
92 | 92 | foreach ($orderProductChildren as $orderProductChild) { |
93 | 93 | $product = $orderProductChild->getProduct(); |
94 | - $this->printService->addLine(" - " . $product->getProduct()); |
|
94 | + $this->printService->addLine(" - ".$product->getProduct()); |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 | $this->printService->addLine('', '', '-'); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | foreach ($parentOrderProducts as $parentOrderProduct) { |
105 | 105 | $quantity = $printForm ? $parentOrderProduct->getQuantity() : 1; |
106 | 106 | for ($i = 0; $i < $quantity; $i++) { |
107 | - $this->printProduct($parentOrderProduct, "- ", $printForm); |
|
107 | + $this->printProduct($parentOrderProduct, "- ", $printForm); |
|
108 | 108 | |
109 | 109 | $childs = $parentOrderProduct->getOrderProductComponents(); |
110 | 110 | if (!empty($childs)) |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | foreach ($queues as $queueName => $orderProducts) { |
121 | 121 | $parentOrderProducts = array_filter($orderProducts, fn($orderProduct) => $orderProduct->getOrderProduct() === null); |
122 | 122 | if (!empty($parentOrderProducts)) { |
123 | - if (!$printForm) $this->printService->addLine(strtoupper($queueName) . ":"); |
|
123 | + if (!$printForm) $this->printService->addLine(strtoupper($queueName).":"); |
|
124 | 124 | $this->printQueueProducts($orderProducts, $printForm); |
125 | 125 | if ($printForm) $this->printService->addLine('', '', ' '); |
126 | 126 | $this->printService->addLine('', '', ' '); |
@@ -136,13 +136,13 @@ discard block |
||
136 | 136 | |
137 | 137 | $printForm = ($device_configs->getConfigs(true)['print-mode'] ?? 'order') == 'form'; |
138 | 138 | |
139 | - $this->printService->addLine("PEDIDO #" . $order->getId()); |
|
139 | + $this->printService->addLine("PEDIDO #".$order->getId()); |
|
140 | 140 | $this->printService->addLine($order->getOrderDate()->format('d/m/Y H:i')); |
141 | 141 | |
142 | 142 | if (!$printForm) { |
143 | 143 | $client = $order->getClient(); |
144 | 144 | $this->printService->addLine(($client !== null ? $client->getName() : 'Não informado')); |
145 | - $this->printService->addLine("R$ " . number_format($order->getPrice(), 2, ',', '.')); |
|
145 | + $this->printService->addLine("R$ ".number_format($order->getPrice(), 2, ',', '.')); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | $this->printService->addLine("", "", "-"); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | #[ORM\ManyToOne(targetEntity: Invoice::class, inversedBy: 'order', cascade: ['persist'])] |
50 | 50 | #[ORM\JoinColumn(name: 'invoice_id', referencedColumnName: 'id')] |
51 | - #[Groups(['order_invoice:read', 'order:read', 'order_details:read', 'order:write', 'order_invoice:write'])] |
|
51 | + #[Groups(['order_invoice:read', 'order:read', 'order_details:read', 'order:write', 'order_invoice:write'])] |
|
52 | 52 | private $invoice; |
53 | 53 | |
54 | 54 | #[ORM\ManyToOne(targetEntity: Order::class, inversedBy: 'invoice', cascade: ['persist'])] |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | private $order; |
58 | 58 | |
59 | 59 | #[ORM\Column(name: 'real_price', type: 'float', nullable: false)] |
60 | - #[Groups(['order_invoice:read', 'order:read', 'order_details:read', 'order:write', 'order_invoice:write'])] |
|
60 | + #[Groups(['order_invoice:read', 'order:read', 'order_details:read', 'order:write', 'order_invoice:write'])] |
|
61 | 61 | private $realPrice = 0; |
62 | 62 | |
63 | 63 | public function getId() |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | #[ORM\Id] |
69 | 69 | #[ORM\GeneratedValue] |
70 | 70 | #[ORM\Column(type: 'integer')] |
71 | - #[Groups(['order_product_queue:read', 'order:read', 'order_details:read', 'order:write', 'order_product:write', 'order_product:read'])] |
|
71 | + #[Groups(['order_product_queue:read', 'order:read', 'order_details:read', 'order:write', 'order_product:write', 'order_product:read'])] |
|
72 | 72 | private $id; |
73 | 73 | |
74 | 74 | #[ORM\ManyToOne(targetEntity: Order::class)] |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | #[ORM\ManyToOne(targetEntity: Product::class)] |
80 | 80 | #[ORM\JoinColumn(nullable: false)] |
81 | - #[Groups(['order_product_queue:read', 'order:read', 'order_details:read', 'order:write', 'order_product:write', 'order_product:read'])] |
|
81 | + #[Groups(['order_product_queue:read', 'order:read', 'order_details:read', 'order:write', 'order_product:write', 'order_product:read'])] |
|
82 | 82 | private $product; |
83 | 83 | |
84 | 84 | #[ORM\ManyToOne(targetEntity: Inventory::class)] |
@@ -115,15 +115,15 @@ discard block |
||
115 | 115 | private $orderProductQueues; |
116 | 116 | |
117 | 117 | #[ORM\Column(type: 'float')] |
118 | - #[Groups(['order_product_queue:read', 'order:read', 'order_details:read', 'order:write', 'order_product:write', 'order_product:read'])] |
|
118 | + #[Groups(['order_product_queue:read', 'order:read', 'order_details:read', 'order:write', 'order_product:write', 'order_product:read'])] |
|
119 | 119 | private $quantity = 1; |
120 | 120 | |
121 | 121 | #[ORM\Column(type: 'float')] |
122 | - #[Groups(['order_product_queue:read', 'order:read', 'order_details:read', 'order:write', 'order_product:write', 'order_product:read'])] |
|
122 | + #[Groups(['order_product_queue:read', 'order:read', 'order_details:read', 'order:write', 'order_product:write', 'order_product:read'])] |
|
123 | 123 | private $price = 0; |
124 | 124 | |
125 | 125 | #[ORM\Column(type: 'float')] |
126 | - #[Groups(['order_product_queue:read', 'order:read', 'order_details:read', 'order:write', 'order_product:write', 'order_product:read'])] |
|
126 | + #[Groups(['order_product_queue:read', 'order:read', 'order_details:read', 'order:write', 'order_product:write', 'order_product:read'])] |
|
127 | 127 | private $total = 0; |
128 | 128 | |
129 | 129 | public function __construct() |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['client' => 'exact'])] |
109 | 109 | #[ORM\JoinColumn(name: 'client_id', referencedColumnName: 'id')] |
110 | 110 | #[ORM\ManyToOne(targetEntity: People::class)] |
111 | - #[Groups(['order_product_queue:read', 'order:read', 'order_details:read', 'order:write', 'invoice:read'])] |
|
111 | + #[Groups(['order_product_queue:read', 'order:read', 'order_details:read', 'order:write', 'invoice:read'])] |
|
112 | 112 | private $client; |
113 | 113 | |
114 | 114 | #[ApiFilter(DateFilter::class, properties: ['orderDate'])] |
@@ -171,13 +171,13 @@ discard block |
||
171 | 171 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['payer' => 'exact'])] |
172 | 172 | #[ORM\JoinColumn(name: 'payer_people_id', referencedColumnName: 'id')] |
173 | 173 | #[ORM\ManyToOne(targetEntity: People::class)] |
174 | - #[Groups(['order_product_queue:read', 'order:read', 'order_details:read', 'order:write', 'invoice:read'])] |
|
174 | + #[Groups(['order_product_queue:read', 'order:read', 'order_details:read', 'order:write', 'invoice:read'])] |
|
175 | 175 | private $payer; |
176 | 176 | |
177 | 177 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['provider' => 'exact'])] |
178 | 178 | #[ORM\JoinColumn(name: 'provider_id', referencedColumnName: 'id')] |
179 | 179 | #[ORM\ManyToOne(targetEntity: People::class)] |
180 | - #[Groups(['order_product_queue:read', 'order:read', 'order_details:read', 'order:write', 'invoice:read'])] |
|
180 | + #[Groups(['order_product_queue:read', 'order:read', 'order_details:read', 'order:write', 'invoice:read'])] |
|
181 | 181 | private $provider; |
182 | 182 | |
183 | 183 | #[ApiFilter(filterClass: SearchFilter::class, properties: ['addressOrigin' => 'exact'])] |