• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/order.php
  • Класс: BitrixSaleOrder
  • Вызов: Order::saveEntities
protected function saveEntities()
{
	$result = parent::saveEntities();

	$r = $this->getShipmentCollection()->save();
	if (!$r->isSuccess())
	{
		$result->addWarnings($r->getErrors());
	}

	$r = $this->getPaymentCollection()->save();
	if (!$r->isSuccess())
	{
		$result->addWarnings($r->getErrors());
	}

	// user budget
	InternalsUserBudgetPool::onUserBudgetSave($this->getUserId());

	$r = $this->getTradeBindingCollection()->save();
	if (!$r->isSuccess())
	{
		$result->addWarnings($r->getErrors());
	}

	$res = CashboxInternalsPool::generateChecks($this->getInternalId());
	if (!$res->isSuccess())
	{
		$result->addWarnings($res->getErrors());

		$warningResult = new Result();
		$warningResult->addWarnings($res->getErrors());

		$registry = Registry::getInstance(static::getRegistryType());
		/** @var EntityMarker $entityMarker */
		$entityMarker = $registry->getEntityMarkerClassName();
		$entityMarker::addMarker($this, $this, $warningResult);
		static::updateInternal($this->getId(), array('MARKED' => 'Y'));
	}

	return $result;
}