1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
cashboxbitrixv3.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Sale\Cashbox;
4
5
use Bitrix\Main;
6
use Bitrix\Main\Localization;
7
8
Localization\Loc::loadMessages
(__FILE__);
9
14
class
CashboxBitrixV3
extends
CashboxBitrixV2
15
{
16
public
function
buildCheckQuery
(
Check
$check)
17
{
18
$result
= parent::buildCheckQuery($check);
19
20
if
($this->
isContainMarkingCode
(
$result
))
21
{
22
$result
[
'validateMarkingCodes'
] =
true
;
23
}
24
25
return
$result
;
26
}
27
28
protected
function
isContainMarkingCode
(
array
$check) : bool
29
{
30
if
(isset($check[
'items'
]))
31
{
32
foreach
($check[
'items'
] as $item)
33
{
34
if
(
35
isset($item[
'imcParams'
])
36
&& !empty($item[
'imcParams'
][
'imc'
])
37
)
38
{
39
return
true
;
40
}
41
}
42
}
43
44
return
false
;
45
}
46
47
protected
function
buildPosition
(
array
$checkData,
array
$item)
48
{
49
$position = parent::buildPosition($checkData, $item);
50
51
$position[
'measurementUnit'
] = (int)$this->
getValueFromSettings
(
'MEASURE'
, $item[
'measure_code'
]);
52
53
if
(isset($position[
'nomenclatureCode'
]))
54
{
55
unset($position[
'nomenclatureCode'
]);
56
}
57
58
if
(isset($item[
'marking_code'
]))
59
{
60
$position[
'imcParams'
] = [
61
'imcType'
=>
'auto'
,
62
'imc'
=> base64_encode($item[
'marking_code'
]),
63
'itemEstimatedStatus'
=> $this->
buildEstimatedStatus
($checkData),
64
'imcModeProcessing'
=> 0,
65
];
66
}
67
68
return
$position;
69
}
70
71
protected
function
buildEstimatedStatus
(
array
$checkData) : string
72
{
73
if
(mb_strpos($checkData[
'type'
],
'sellreturn'
) === 0)
74
{
75
return
'itemPieceReturn'
;
76
}
77
78
return
'itemPieceSold'
;
79
}
80
84
protected
function
getPaymentObjectMap
()
85
{
86
$result
= parent::getPaymentObjectMap();
87
88
$result
[
Check::PAYMENT_OBJECT_COMMODITY_MARKING_NO_MARKING_EXCISE
] =
'exciseWithoutMarking '
;
89
$result
[
Check::PAYMENT_OBJECT_COMMODITY_MARKING_EXCISE
] =
'exciseWithMarking '
;
90
$result
[
Check::PAYMENT_OBJECT_COMMODITY_MARKING_NO_MARKING
] =
'commodityWithoutMarking '
;
91
$result
[
Check::PAYMENT_OBJECT_COMMODITY_MARKING
] =
'commodityWithMarking'
;
92
93
return
$result
;
94
}
95
99
public
static
function
getName
()
100
{
101
return
Localization\Loc::getMessage
(
'SALE_CASHBOX_BITRIX_V3_TITLE'
);
102
}
103
108
public
static
function
getSettings
($modelId = 0)
109
{
110
$settings
= parent::getSettings($modelId);
111
112
$kkmList = static::getSupportedKkmModels();
113
if
(isset($kkmList[$modelId]))
114
{
115
$settings
[
'MEASURE'
] = static::getMeasureSettings();
116
}
117
118
return
$settings
;
119
}
120
121
protected
static
function
getMeasureSettings
():
array
122
{
123
$measureItems = [];
124
if
(
Main
\Loader::includeModule(
'catalog'
))
125
{
126
$measuresList = \CCatalogMeasure::getList();
127
while
($measure = $measuresList->fetch())
128
{
129
$measureItems[$measure[
'CODE'
]] = [
130
'TYPE'
=>
'STRING'
,
131
'LABEL'
=> $measure[
'MEASURE_TITLE'
],
132
'REQUIRED'
=>
'Y'
,
133
'VALUE'
=>
MeasureCodeToTag2108Mapper::getTag2108Value
($measure[
'CODE'
]),
134
];
135
}
136
}
137
138
return
[
139
'LABEL'
=>
Localization\Loc::getMessage
(
'SALE_CASHBOX_MEASURE_SUPPORT_SETTINGS'
),
140
'ITEMS'
=> $measureItems,
141
];
142
}
143
146
public
static
function
getFfdVersion
(): ?float
147
{
148
return
1.2;
149
}
150
}
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Определения
loc.php:65
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Определения
loc.php:30
Bitrix\Sale\Cashbox\CashboxBitrixV2
Определения
cashboxbitrixv2.php:16
Bitrix\Sale\Cashbox\CashboxBitrixV3
Определения
cashboxbitrixv3.php:15
Bitrix\Sale\Cashbox\CashboxBitrixV3\getFfdVersion
static getFfdVersion()
Определения
cashboxbitrixv3.php:146
Bitrix\Sale\Cashbox\CashboxBitrixV3\getSettings
static getSettings($modelId=0)
Определения
cashboxbitrixv3.php:108
Bitrix\Sale\Cashbox\CashboxBitrixV3\getPaymentObjectMap
getPaymentObjectMap()
Определения
cashboxbitrixv3.php:84
Bitrix\Sale\Cashbox\CashboxBitrixV3\getMeasureSettings
static getMeasureSettings()
Определения
cashboxbitrixv3.php:121
Bitrix\Sale\Cashbox\CashboxBitrixV3\getName
static getName()
Определения
cashboxbitrixv3.php:99
Bitrix\Sale\Cashbox\CashboxBitrixV3\buildCheckQuery
buildCheckQuery(Check $check)
Определения
cashboxbitrixv3.php:16
Bitrix\Sale\Cashbox\CashboxBitrixV3\buildPosition
buildPosition(array $checkData, array $item)
Определения
cashboxbitrixv3.php:47
Bitrix\Sale\Cashbox\CashboxBitrixV3\isContainMarkingCode
isContainMarkingCode(array $check)
Определения
cashboxbitrixv3.php:28
Bitrix\Sale\Cashbox\CashboxBitrixV3\buildEstimatedStatus
buildEstimatedStatus(array $checkData)
Определения
cashboxbitrixv3.php:71
Bitrix\Sale\Cashbox\Cashbox\getValueFromSettings
getValueFromSettings($name, $code)
Определения
cashbox.php:203
Bitrix\Sale\Cashbox\Check
Определения
check.php:23
Bitrix\Sale\Cashbox\Check\PAYMENT_OBJECT_COMMODITY_MARKING_EXCISE
const PAYMENT_OBJECT_COMMODITY_MARKING_EXCISE
Определения
check.php:50
Bitrix\Sale\Cashbox\Check\PAYMENT_OBJECT_COMMODITY_MARKING_NO_MARKING_EXCISE
const PAYMENT_OBJECT_COMMODITY_MARKING_NO_MARKING_EXCISE
Определения
check.php:49
Bitrix\Sale\Cashbox\Check\PAYMENT_OBJECT_COMMODITY_MARKING
const PAYMENT_OBJECT_COMMODITY_MARKING
Определения
check.php:52
Bitrix\Sale\Cashbox\Check\PAYMENT_OBJECT_COMMODITY_MARKING_NO_MARKING
const PAYMENT_OBJECT_COMMODITY_MARKING_NO_MARKING
Определения
check.php:51
Bitrix\Sale\Cashbox\MeasureCodeToTag2108Mapper\getTag2108Value
static getTag2108Value(?string $measureCode)
Определения
measurecodetotag2108mapper.php:51
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
Bitrix\Main
$settings
$settings
Определения
product_settings.php:43
bitrix
modules
sale
lib
cashbox
cashboxbitrixv3.php
Создано системой
1.14.0