23 private function callProviderMethod($methodName, array $products = array())
42 return $this->callProviderMethod(
'tryShip', $products);
53 return $this->callProviderMethod(
'isNeedShip', $products);
62 public function ship(array $products)
64 return $this->callProviderMethod(
'ship', $products);
75 return $this->callProviderMethod(
'checkBarcode', $items);
87 return $this->callProviderMethod(
'reserve', $products);
98 return $this->callProviderMethod(
'deliver', $products);
109 return $this->callProviderMethod(
'viewProduct', $products);
120 return $this->callProviderMethod(
'recurring', $products);
131 return $this->callProviderMethod(
'getProductListStores', $products);
144 return static::setItemsResultAfterTryShipByCoefficient($pool, $products, $productTryList, 1);
157 return static::setItemsResultAfterTryShipByCoefficient($pool, $products, $productTryList, -1);
169 private function setItemsResultAfterTryShipByCoefficient(
PoolQuantity $pool, array $products, array $productTryList, $coefficient)
171 foreach ($products as $productId => $productData)
173 if (!isset($productTryList[$productId]))
178 if (empty($productData[
'SHIPMENT_ITEM_DATA_LIST']))
185 foreach ($productData[
'SHIPMENT_ITEM_DATA_LIST'] as $shipmentItemIndex => $shipmentItemQuantity)
187 $quantity = $coefficient * $shipmentItemQuantity;
192 return new Sale\Result();
215 $result = $this->callProviderMethod(
'getAvailableQuantity', $products);
217 $resultData = $result->getData();
218 if (!array_key_exists(
'AVAILABLE_QUANTITY_LIST', $resultData))
223 return $result->setData([
'AVAILABLE_QUANTITY_LIST' => $resultData[
'AVAILABLE_QUANTITY_LIST']]);
234 $result = $this->callProviderMethod(
'getAvailableQuantityByStore', $products);
236 $resultData = $result->getData();
237 if (!array_key_exists(
'AVAILABLE_QUANTITY_LIST_BY_STORE', $resultData))
242 return $result->setData([
'AVAILABLE_QUANTITY_LIST_BY_STORE' => $resultData[
'AVAILABLE_QUANTITY_LIST_BY_STORE']]);
253 $result = $this->callProviderMethod(
'getAvailableQuantityAndPrice', $products);
255 $resultData = $result->getData();
257 return $result->setData([
258 'PRODUCT_DATA_LIST' => [
259 'PRICE_LIST' => $resultData[
'PRODUCT_DATA_LIST'][
'PRICE_LIST'],
260 'AVAILABLE_QUANTITY_LIST' => $resultData[
'PRODUCT_DATA_LIST'][
'AVAILABLE_QUANTITY_LIST']
272 return $this->callProviderMethod(
'getProductData', $products);
282 return $this->callProviderMethod(
'getBundleItems', $products);
290 return $this->callProviderMethod(
'getStoresCount');
298 return $this->callProviderMethod(
'writeOffProductBatches', $products);
306 return $this->callProviderMethod(
'returnProductBatches', $products);
add($type, $code, $value)
getAvailableQuantityByStore(array $products)
isNeedShip(array $products)
getAvailableQuantityAndPrice(array $products)
setItemsResultAfterTryUnship(PoolQuantity $pool, array $products, array $productTryList)
getProductListStores(array $products)
getAvailableQuantity(array $products)
recurring(array $products)
viewProduct(array $products)
setItemsResultAfterGetData(array $products, Sale\Result $reserveResult)
writeOffProductBatches(array $products)
checkBarcode(array $items)
returnProductBatches(array $products)
getBundleItems(array $products)
setItemsResultAfterTryShip(PoolQuantity $pool, array $products, array $productTryList)
getProductData(array $products)