• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/delivery/requests/manager.php
  • Класс: BitrixSaleDeliveryRequestsManager
  • Вызов: Manager::checkShipmentIdsBeforeUpdate
static function checkShipmentIdsBeforeUpdate(array $shipmentIds)
{
	$result = array();
	$positiveIds = self::filterPositiveIds($shipmentIds);

	foreach (array_diff($shipmentIds, $positiveIds) as $id)
	{
		$shpRes = new ShipmentResult($id);
		$shpRes->addError(
			new MainError(
				Loc::getMessage('SALE_DLVR_REQ_MNGR_ERROR_SHIPMENT_ID').' "'.$id.'"')
		);
		$result[] = $shpRes;
	}

	$addedIds = self::filterAddedIds($positiveIds);

	foreach (array_diff($positiveIds, $addedIds) as $id)
	{
		$shpRes = new ShipmentResult($id);
		$shpRes->addError(
			new MainError(
				Loc::getMessage('SALE_DLVR_REQ_MNGR_ERROR_SHIPMENT_NOT_IN_REQUEST', array('#SHIPMENT_ID#' => $id)
		)));
		$result[] = $shpRes;
	}

	$existingIds = self::filterExistIds($addedIds);

	foreach (array_diff($addedIds, $existingIds) as $id)
	{
		$shpRes = new ShipmentResult($id);
		$shpRes->addError(
			new MainError(
				Loc::getMessage('SALE_DLVR_REQ_MNGR_SHP_NOT_FOUND', array('#SHIPMENT_ID#' => $id)
		)));
		$result[] = $shpRes;
	}

	return $result;
}