1 | <?php |
||
5 | class Partner extends Base implements PartnerInterface |
||
6 | { |
||
7 | /** |
||
8 | * Gets Venture service. |
||
9 | * @return Iris\Interfaces\IrisVenture |
||
10 | */ |
||
11 | 9 | public function getVentureService() |
|
12 | { |
||
13 | 9 | return $this->getManager()->getService(\Iris\Factory::VENTURE); |
|
14 | } |
||
15 | |||
16 | /** |
||
17 | * Gets Stock service. |
||
18 | * @return Iris\Interfaces\Stock |
||
19 | */ |
||
20 | 3 | public function getStockService() |
|
21 | { |
||
22 | 3 | return $this->getManager()->getService(\Iris\Factory::STOCK); |
|
23 | } |
||
24 | |||
25 | /** |
||
26 | * Gets Stock service. |
||
27 | * @return Iris\Interfaces\Catalog |
||
28 | */ |
||
29 | 2 | public function getCatalogService() |
|
30 | { |
||
31 | 2 | return $this->getManager()->getService(\Iris\Factory::CATALOG); |
|
32 | } |
||
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | 2 | public function confirmReserveAndUpdateStock($sku, $itemId, $ventureCode, $stockQuantity, $orderNumber) |
|
38 | { |
||
39 | 2 | $this->confirmReserve($sku, $itemId, $ventureCode, $orderNumber); |
|
40 | 2 | $this->updateStock($sku, $stockQuantity); |
|
41 | 2 | } |
|
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | 1 | public function confirmReserve($sku, $itemId, $ventureCode, $orderNumber) |
|
47 | { |
||
48 | 1 | $venture = $this->getVentureService()->findByCode($ventureCode); |
|
|
|||
49 | |||
50 | 1 | $item = $this->getOrderService()->findItemByIdAndSkuAndVentureCode( |
|
51 | 1 | $itemId, |
|
52 | 1 | $sku, |
|
53 | 1 | $venture->getVentureCode(), |
|
54 | $orderNumber |
||
55 | 1 | ); |
|
56 | |||
57 | 1 | $this->getStockService()->dropReserve($item); |
|
58 | 1 | } |
|
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | 1 | public function updateStock($sku, $quantity) |
|
64 | { |
||
65 | 1 | $product = $this->getCatalogService()->getProductDataBySku($sku); |
|
66 | 1 | return $this->getStockService()->updateAbsoluteStock($product['sku'], $quantity); |
|
67 | } |
||
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | 1 | public function isVentureItem(\Iris\Transfer\Sales\Order\Item $item) |
|
73 | { |
||
74 | 1 | $irisVenture = $this->getVentureService() |
|
75 | 1 | ->getIrisVentureBySalesOrderId($item->getFkSalesOrder()); |
|
76 | |||
77 | 1 | return ($irisVenture instanceof \Iris\Transfer\Venture); |
|
78 | } |
||
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | 4 | public function findOrderByOrderNumber($orderNumber, $originCode) |
|
84 | { |
||
85 | 4 | return $this->getOrderService() |
|
86 | 4 | ->getOrderByOrderNumberAndVentureCode($orderNumber, $originCode); |
|
87 | } |
||
88 | |||
89 | /** |
||
90 | * {@inheritdoc} |
||
91 | */ |
||
92 | 1 | public function sendOrderToVenture($orderNumber, $ventureCode) |
|
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | 1 | public function confirmOrderPaidOnVenture($orderNumber, $ventureCode) |
|
104 | { |
||
105 | 1 | $order = $this->findOrderByOrderNumber($orderNumber, $ventureCode); |
|
106 | |||
107 | 1 | return $this->getPartnerApiClient() |
|
110 | |||
111 | /** |
||
112 | * {@inheritdoc} |
||
113 | */ |
||
114 | 1 | public function cancelOrderOnVenture($orderNumber, $ventureCode) |
|
120 | |||
121 | /** |
||
122 | * {@inheritdoc} |
||
123 | */ |
||
124 | 1 | public function cancelOrder($orderNumber, $originCode) |
|
134 | |||
135 | /** |
||
136 | * {@inheritdoc} |
||
137 | */ |
||
138 | 2 | public function getName() |
|
142 | |||
143 | /** |
||
144 | * {@inheritdoc} |
||
145 | */ |
||
146 | 1 | public function shippedOrder(\Iris\Transfer\Sales\Order $order, $originCode) |
|
165 | /** |
||
166 | * {@inheritdoc} |
||
167 | */ |
||
168 | 1 | public function deliveredOrder(\Iris\Transfer\Sales\Order $order, $originCode) |
|
182 | |||
183 | /** |
||
184 | * {@inheritdoc} |
||
185 | */ |
||
186 | 1 | public function deliveryFailedOrder(\Iris\Transfer\Sales\Order $order, $originCode) |
|
200 | |||
201 | /** |
||
202 | * {@inheritdoc} |
||
203 | */ |
||
204 | 1 | public function setNfeKey( |
|
219 | |||
220 | /** |
||
221 | * {@inheritdoc} |
||
222 | */ |
||
223 | 1 | public function setNfeKeyAndTrackingUrl(\Iris\Transfer\Sales\Order $order, $originCode) |
|
260 | |||
261 | /** |
||
262 | * {@inheritdoc} |
||
263 | */ |
||
264 | 1 | public function isInvalidOrder(\Iris\Transfer\Sales\Order $order) |
|
268 | |||
269 | /** |
||
270 | * @param Iris\Transfer\Sales\Order $order |
||
271 | * @return array |
||
272 | */ |
||
273 | 4 | private function getOrderItems(\Iris\Transfer\Sales\Order $order) |
|
284 | |||
285 | /** |
||
286 | * @param Iris\Transfer\Sales\Order $order |
||
287 | * @param Iris\Trnasfer\Sales\Order\ItemsCollection $items |
||
288 | * @return Iris\Transfer\Sales\Order |
||
289 | */ |
||
290 | 1 | private function updateItemsWithTheIncomingData( |
|
318 | |||
319 | /** |
||
320 | * {@inheritdoc} |
||
321 | */ |
||
322 | 1 | public function bindVentureOrder($orderNumber, $ventureCode, $ventureOrderNumber) |
|
339 | } |
||
340 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.