@@ -84,8 +84,9 @@ |
||
84 | 84 | $this->printProduct($parentOrderProduct); |
85 | 85 | |
86 | 86 | $childs = $parentOrderProduct->getOrderProductComponents(); |
87 | - if (!empty($childs)) |
|
88 | - $this->printChildren($childs); |
|
87 | + if (!empty($childs)) { |
|
88 | + $this->printChildren($childs); |
|
89 | + } |
|
89 | 90 | |
90 | 91 | $this->printService->addLine('', '', '-'); |
91 | 92 | } |
@@ -60,17 +60,21 @@ discard block |
||
60 | 60 | $order = $orderProduct->getOrder(); |
61 | 61 | $product = $orderProduct->getProduct(); |
62 | 62 | |
63 | - if ($order->getOrderType() == 'sale' && !$orderProduct->getOutInventory()) |
|
64 | - $orderProduct->setOutInventory($product->getDefaultOutInventory()); |
|
63 | + if ($order->getOrderType() == 'sale' && !$orderProduct->getOutInventory()) { |
|
64 | + $orderProduct->setOutInventory($product->getDefaultOutInventory()); |
|
65 | + } |
|
65 | 66 | |
66 | - if ($order->getOrderType() == 'purchase' && !$orderProduct->getInInventory()) |
|
67 | - $orderProduct->setInInventory($product->getDefaultInInventory()); |
|
67 | + if ($order->getOrderType() == 'purchase' && !$orderProduct->getInInventory()) { |
|
68 | + $orderProduct->setInInventory($product->getDefaultInInventory()); |
|
69 | + } |
|
68 | 70 | } |
69 | 71 | |
70 | 72 | public function postPersist(OrderProduct $orderProduct) |
71 | 73 | { |
72 | 74 | |
73 | - if (!self::$mainProduct) return; |
|
75 | + if (!self::$mainProduct) { |
|
76 | + return; |
|
77 | + } |
|
74 | 78 | self::$mainProduct = false; |
75 | 79 | |
76 | 80 | $json = json_decode($this->request->getContent(), true); |
@@ -88,7 +92,9 @@ discard block |
||
88 | 92 | public function preRemove(OrderProduct $orderProduct) |
89 | 93 | { |
90 | 94 | |
91 | - if (!self::$mainProduct) return; |
|
95 | + if (!self::$mainProduct) { |
|
96 | + return; |
|
97 | + } |
|
92 | 98 | self::$mainProduct = false; |
93 | 99 | $order = $orderProduct->getOrder(); |
94 | 100 | $this->manager->persist($order->setPrice(0)); |
@@ -97,8 +103,9 @@ discard block |
||
97 | 103 | 'parentProduct' => $orderProduct->getProduct(), |
98 | 104 | ]); |
99 | 105 | |
100 | - foreach ($parentProducts as $parentProduct) |
|
101 | - $this->manager->remove($parentProduct); |
|
106 | + foreach ($parentProducts as $parentProduct) { |
|
107 | + $this->manager->remove($parentProduct); |
|
108 | + } |
|
102 | 109 | $this->manager->flush(); |
103 | 110 | |
104 | 111 | self::$calculateBefore[] = $order; |