Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
cashboxbusinessrutrait.php
1<?php
2
3namespace Bitrix\Sale\Cashbox;
4
6
7Localization\Loc::loadMessages(__FILE__);
8
14trait CashboxBusinessRuTrait
15{
19 public static function isCorrectionOn(): bool
20 {
21 return false;
22 }
23
28 public function buildCheckQuery(Check $check)
29 {
30 $result = parent::buildCheckQuery($check);
31
32 $result['service']['vendor_name'] = 'Bitrix24';
33 $result['print_check'] = $this->getValueFromSettings('INTERACTION', 'CHECK_REAL_PRINT') === 'Y';
34
35 return $result;
36 }
37
41 public static function getSupportedKkmModels()
42 {
43 $result = [];
44
46 {
47 $result[$kkmCode] = KkmRepository::getByCode($kkmCode);
48 }
49
50 return $result;
51 }
52
56 public static function getGeneralRequiredFields()
57 {
58 $fields = parent::getGeneralRequiredFields();
59
60 $map = Internals\CashboxTable::getMap();
61 $fields['KKM_ID'] = $map['KKM_ID']['title'];
62
63 return $fields;
64 }
65
70 public static function getSettings($modelId = 0)
71 {
72 $settings = parent::getSettings($modelId);
73
74 $settings['INTERACTION']['ITEMS']['CHECK_REAL_PRINT'] = [
75 'TYPE' => 'Y/N',
76 'LABEL' => Localization\Loc::getMessage('SALE_CASHBOX_BUSINESS_RU_SETTINGS_CHECK_REAL_PRINT_LABEL'),
77 'VALUE' => 'N',
78 ];
79
80 return $settings;
81 }
82
86 protected function getOptionPrefix(): string
87 {
88 return 'business_ru_access_token';
89 }
90}