14 private const TYPE =
'cashbox';
16 private const CASHBOX_HANDLERS = [
17 Sale\Cashbox\CashboxOrangeData::class,
18 Sale\Cashbox\CashboxCheckbox::class,
19 Sale\Cashbox\CashboxBusinessRu::class,
20 Sale\Cashbox\CashboxBusinessRuV5::class,
21 Sale\Cashbox\CashboxOrangeDataFfd12::class,
28 private $cashboxHandler;
32 $this->check = $check;
34 $cashboxId = $check->getField(
'CASHBOX_ID');
35 $this->cashboxHandler = Sale\Cashbox\Manager::getObjectById($cashboxId);
48 $cashboxHandlerCode = $this->cashboxHandler::getCode();
50 $isCashboxHandlerExists = (bool)array_filter(
51 self::CASHBOX_HANDLERS,
52 static function ($cashboxHandler) use ($cashboxHandlerCode) {
53 return $cashboxHandlerCode === $cashboxHandler::getCode();
57 return $isCashboxHandlerExists && $this->check->getField(
'STATUS') ===
'Y';
65 $checkData = $this->getCheckData();
67 'cashbox' => $this->cashboxHandler::getCode(),
68 'date_time' => $checkData[
'date_time'],
75 private function getCheckData(): array
77 $dateTime = $this->check->getField(
'DATE_PRINT_END');
84 'date_time' => $dateTime->format(
'Y-m-d H:i:s'),