• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/internals/catalog/provider.php
  • Класс: BitrixSaleInternalsCatalogProvider
  • Вызов: Provider::getNeedQuantityByShipmentItemList
static function getNeedQuantityByShipmentItemList(array $shipmentItemList) : array
{
	$needQuantityList = [];

	/** @var SaleShipmentItem $shipmentItem */
	foreach ($shipmentItemList as $shipmentItem)
	{
		$quantityList = self::getNeedQuantityByShipmentItem($shipmentItem);
		$providerName = key($quantityList);
		$productId = key($quantityList[$providerName]);

		foreach ($quantityList[$providerName][$productId] as $storeId => $quantity)
		{
			if (!isset($needQuantityList[$providerName][$productId][$storeId]))
			{
				$needQuantityList[$providerName][$productId][$storeId] = 0;
			}

			$needQuantityList[$providerName][$productId][$storeId] += $quantity;
		}
	}

	return $needQuantityList;
}