Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
cashbox1c.php
1<?php
2
3namespace Bitrix\Sale\Cashbox;
4
8
9Localization\Loc::loadMessages(__FILE__);
10
15class Cashbox1C extends Cashbox
16{
17 const CACHE_ID = 'BITRIX_CASHBOX_1C_ID';
18 const TTL = 31536000;
19
20
25 public function buildCheckQuery(Check $check)
26 {
27 return array();
28 }
29
34 public function buildZReportQuery($id)
35 {
36 return array();
37 }
38
42 public static function getName()
43 {
44 return Localization\Loc::getMessage('SALE_CASHBOX_1C_TITLE');
45 }
46
50 public static function getId()
51 {
52 $id = 0;
53 $cacheManager = Main\Application::getInstance()->getManagedCache();
54
55 if ($cacheManager->read(self::TTL, self::CACHE_ID))
56 $id = $cacheManager->get(self::CACHE_ID);
57
58 if ($id <= 0)
59 {
60 $data = CashboxTable::getRow(
61 array(
62 'select' => array('ID'),
63 'filter' => array('=HANDLER' => '\Bitrix\Sale\Cashbox\Cashbox1C')
64 )
65 );
66 if (is_array($data) && $data['ID'] > 0)
67 {
68 $id = $data['ID'];
69 $cacheManager->set(self::CACHE_ID, $id);
70 }
71 }
72
73 return $id;
74 }
75
81 protected static function extractCheckData(array $data)
82 {
83 return array(
84 'ID' => $data['ID'],
85 'LINK_PARAMS' => array(
86 Check::PARAM_FISCAL_DOC_ATTR => $data['LINK_PARAMS']['FISCAL_SIGN'],
87 Check::PARAM_REG_NUMBER_KKT => $data['LINK_PARAMS']['REG_NUMBER_KKT']
88 )
89 );
90 }
91}
static extractCheckData(array $data)
Definition cashbox1c.php:81