• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/paysystem/cashbox/events/togglecashboxesonupdatepaysystem.php
  • Класс: BitrixSalePaySystemCashboxEventsToggleCashboxesOnUpdatePaySystem
  • Вызов: ToggleCashboxesOnUpdatePaySystem::isCashboxUsedByOtherPaySystems
private function isCashboxUsedByOtherPaySystems(): bool
{
	$cashboxClass = $this->service->getCashboxClass();

	$paySystemIterator = SalePaySystemManager::getList([
		'filter' => [
			'=ACTIVE' => 'Y',
			'!=ID' => $this->service->getField('ID'),
		]
	]);

	$kkmId = $this->getKkmId();
	$paySystemCodeForKkm = $cashboxClass::getPaySystemCodeForKkm();

	while ($paySystemItem = $paySystemIterator->fetch())
	{
		$paySystemService = new SalePaySystemService($paySystemItem);
		if (
			$paySystemService->isSupportPrintCheck()
			&& $paySystemService->getCashboxClass() === $cashboxClass
			&& SaleBusinessValue::getValuesByCode($paySystemService->getConsumerName(), $paySystemCodeForKkm) === $kkmId
		)
		{
			return true;
		}
	}

	return false;
}