• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/reservation/basketreservationhistoryservice.php
  • Класс: BitrixSaleReservationBasketReservationHistoryService
  • Вызов: BasketReservationHistoryService::updateByReservation
public function updateByReservation(int $reservationId): Result
{
	$reservation = BasketReservationTable::getRowById($reservationId);
	if (!$reservation)
	{
		throw new Exception('Reservation not found');
	}

	$reservationQuantity = $this->roundQuantity($reservation['QUANTITY']);
	$historyQuantity = $this->roundQuantity($this->getQuantityByReservation($reservationId));

	if ($reservationQuantity !== $historyQuantity)
	{
		return $this->addQuantity($reservationId, $reservationQuantity - $historyQuantity);
	}

	return new Result();
}