Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ofdruofd.php
1
<?php
2
3
namespace
Bitrix\Sale\Cashbox
;
4
5
use
Bitrix\Main\Localization
;
6
use
Bitrix\Main
;
7
use
Bitrix\Sale\Result
;
8
9
Localization\Loc::loadMessages(__FILE__);
10
15
class
OfdruOfd
extends
Ofd
16
{
17
const
ACTIVE_URL
=
'https://ofd.ru/rec/'
;
18
22
protected
function
getUrl
()
23
{
24
return
static::ACTIVE_URL;
25
}
26
31
public
static
function
getName
()
32
{
33
return
Localization\Loc::getMessage(
'SALE_CASHBOX_OFDRU_OFD_NAME'
);
34
}
35
40
public
function
generateCheckLink
($data)
41
{
42
$url = $this->
getUrl
();
43
$url .= $this->
getValueFromSettings
(
'SELLER'
,
'INN'
).
'/'
;
44
$url .= $data[
Check::PARAM_REG_NUMBER_KKT
].
'/'
;
45
$url .= $data[
Check::PARAM_FN_NUMBER
].
'/'
;
46
$url .= $data[
Check::PARAM_FISCAL_DOC_NUMBER
].
'/'
;
47
$url .= $data[
Check::PARAM_FISCAL_DOC_ATTR
];
48
49
return
$url;
50
}
51
55
public
static
function
getSettings
()
56
{
57
$settings = parent::getSettings();
58
59
$settings[
'SELLER'
] = array(
60
'LABEL'
=> Localization\
Loc::getMessage
(
'SALE_CASHBOX_OFDRU_SETTINGS_SELLER_INFO'
),
61
'ITEMS'
=> array(
62
'INN'
=> array(
63
'TYPE'
=>
'STRING'
,
64
'REQUIRED'
=>
'Y'
,
65
'LABEL'
=> Localization\
Loc::getMessage
(
'SALE_CASHBOX_OFDRU_SELLER_INN'
),
66
'VALUE'
=>
''
67
)
68
)
69
);
70
71
return
$settings;
72
}
73
77
public
function
validate
()
78
{
79
$result =
new
Result
();
80
81
$settings = $this->cashbox->getField(
'OFD_SETTINGS'
);
82
83
if
(empty($settings[
'SELLER'
][
'INN'
]))
84
{
85
$result->addError(
new
Main\
Error
(Localization\
Loc::getMessage
(
'SALE_CASHBOX_OFD_VALIDATE_E_INN'
)));
86
}
87
88
return
$result;
89
}
90
91
}
Bitrix\Main\DB\Result
Definition
result.php:19
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\Sale\Cashbox\AbstractCheck\PARAM_FN_NUMBER
const PARAM_FN_NUMBER
Definition
abstractcheck.php:26
Bitrix\Sale\Cashbox\AbstractCheck\PARAM_FISCAL_DOC_ATTR
const PARAM_FISCAL_DOC_ATTR
Definition
abstractcheck.php:24
Bitrix\Sale\Cashbox\AbstractCheck\PARAM_FISCAL_DOC_NUMBER
const PARAM_FISCAL_DOC_NUMBER
Definition
abstractcheck.php:23
Bitrix\Sale\Cashbox\AbstractCheck\PARAM_REG_NUMBER_KKT
const PARAM_REG_NUMBER_KKT
Definition
abstractcheck.php:28
Bitrix\Sale\Cashbox\Ofd
Definition
ofd.php:15
Bitrix\Sale\Cashbox\Ofd\getValueFromSettings
getValueFromSettings($name, $code=null)
Definition
ofd.php:185
Bitrix\Sale\Cashbox\OfdruOfd
Definition
ofdruofd.php:16
Bitrix\Sale\Cashbox\OfdruOfd\validate
validate()
Definition
ofdruofd.php:77
Bitrix\Sale\Cashbox\OfdruOfd\getName
static getName()
Definition
ofdruofd.php:31
Bitrix\Sale\Cashbox\OfdruOfd\ACTIVE_URL
const ACTIVE_URL
Definition
ofdruofd.php:17
Bitrix\Sale\Cashbox\OfdruOfd\generateCheckLink
generateCheckLink($data)
Definition
ofdruofd.php:40
Bitrix\Sale\Cashbox\OfdruOfd\getUrl
getUrl()
Definition
ofdruofd.php:22
Bitrix\Sale\Cashbox\OfdruOfd\getSettings
static getSettings()
Definition
ofdruofd.php:55
Bitrix\Main\Localization
Definition
culture.php:8
Bitrix\Main
Bitrix\Sale\Cashbox
Definition
abstractcheck.php:3
modules
sale
lib
cashbox
ofdruofd.php
Создано системой
1.10.0