• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/shipmentitemstore.php
  • Класс: BitrixSaleShipmentItemStore
  • Вызов: ShipmentItemStore::addErrorMessagesToHistory
protected function addErrorMessagesToHistory($errors)
{
	$registry = Registry::getInstance(static::getRegistryType());

	/** @var ShipmentItemStoreCollection $shipmentItemStoreCollection */
	$shipmentItemStoreCollection = $this->getCollection();

	/** @var BitrixCrmOrderShipmentItemCollection $shipmentItemCollection */
	$shipmentItemCollection = $shipmentItemStoreCollection->getShipmentItem()->getCollection();

	$order = $shipmentItemCollection->getShipment()->getOrder();

	/** @var OrderHistory $orderHistory */
	$orderHistory = $registry->getOrderHistoryClassName();
	$orderHistory::addAction(
		'SHIPMENT',
		$order->getId(),
		($this->getId() > 0) ? 'SHIPMENT_ITEM_STORE_UPDATE_ERROR' : 'SHIPMENT_ITEM_STORE_ADD_ERROR',
		($this->getId() > 0) ? $this->getId() : null,
		$this,
		[
			"ERROR" => $errors
		]
	);
}