14 $this->service = $service;
24 if (!$this->service || !$this->service->isSupportPrintCheck())
30 $cashboxClass = $this->service->getCashboxClass();
31 $supportedKkmModels = [];
33 $paySystemIterator = Sale\PaySystem\Manager::getList([
38 while ($paySystemItem = $paySystemIterator->fetch())
42 $paySystemService->isSupportPrintCheck()
43 && $paySystemService->getCashboxClass() === $cashboxClass
46 $supportedKkmModels[] = $cashboxClass::getKkmValue($this->service);
50 $supportedKkmModels = array_unique(array_merge(...$supportedKkmModels));
52 $cashboxList = Sale\Cashbox\Manager::getList([
53 'select' => [
'ID',
'KKM_ID'],
55 '=HANDLER' => $cashboxClass,
56 '!@KKM_ID' => $supportedKkmModels,
59 foreach ($cashboxList as $cashboxItem)
61 $serviceCashbox = Sale\Cashbox\Manager::getObjectById($cashboxItem[
'ID']);
62 $deleteResult = Sale\Cashbox\Manager::delete($cashboxItem[
'ID']);
63 if ($deleteResult->isSuccess())
65 AddEventToStatFile(
'sale',
'deleteCashbox',
'', $serviceCashbox::getCode());
69 $result->addErrors($deleteResult->getErrors());