1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
deletecashboxesondisabledfiscalization.php
См. документацию.
1<?php
2
3namespace Bitrix\Sale\PaySystem\Cashbox\Events;
4
5use Bitrix\Sale;
6
8{
10 private $service;
12 private $kkmId;
13
14 public function __construct(Sale\PaySystem\Service $service, string $kkmId)
15 {
16 $this->service = $service;
17 $this->kkmId = $kkmId;
18 }
19
27 public function executeEvent(): Sale\Result
28 {
29 $result = new Sale\Result();
30
31 if (!$this->service || !$this->service->isSupportPrintCheck())
32 {
33 return $result;
34 }
35
36 $cashboxList = Sale\Cashbox\Manager::getList([
37 'select' => ['ID', 'KKM_ID'],
38 'filter' => [
39 '=HANDLER' => $this->service->getCashboxClass(),
40 '=KKM_ID' => $this->kkmId,
41 ],
42 ]);
43 foreach ($cashboxList as $cashboxItem)
44 {
45 $cashboxId = $cashboxItem['ID'];
46 $serviceCashbox = Sale\Cashbox\Manager::getObjectById($cashboxId);
47 if (Sale\Cashbox\Manager::isCashboxChecksExist($cashboxId))
48 {
50 }
51 else
52 {
53 $deleteResult = Sale\Cashbox\Manager::delete($cashboxId);
54 if ($deleteResult->isSuccess())
55 {
56 AddEventToStatFile('sale', 'deleteCashbox', '', $serviceCashbox::getCode());
57 }
58 else
59 {
60 $result->addErrors($deleteResult->getErrors());
61 }
62 }
63 }
64
65 return $result;
66 }
67}
static getObjectById($id)
Определения manager.php:165
static deactivateCashbox($cashboxId)
Определения manager.php:631
static getList(array $parameters=[])
Определения manager.php:135
$result
Определения get_property_values.php:14
AddEventToStatFile($module, $action, $tag, $label, $action_type='', $user_id=null)
Определения tools.php:3976