1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
creditcheck.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Sale\Cashbox;
4
5
use Bitrix\Main;
6
use Bitrix\Sale;
7
8
Main\Localization\Loc::loadMessages
(__FILE__);
9
14
15
class
CreditCheck
extends
Check
16
{
20
public
static
function
getType
()
21
{
22
return
'credit'
;
23
}
24
28
public
static
function
getName
()
29
{
30
return
Main\Localization\Loc::getMessage
(
'SALE_CASHBOX_CREDIT_NAME'
);
31
}
32
36
public
static
function
getCalculatedSign
()
37
{
38
return
static::CALCULATED_SIGN_INCOME;
39
}
40
44
public
static
function
getSupportedEntityType
()
45
{
46
return
static::SUPPORTED_ENTITY_TYPE_SHIPMENT;
47
}
48
56
public
function
setEntities(
array
$entities
)
57
{
58
parent::setEntities(
$entities
);
59
60
foreach
(
$entities
as
$entity
)
61
{
62
if
(
$entity
instanceof
Sale
\
Shipment
)
63
{
64
$this->
setField
(
'SHIPMENT_ID'
, $entity->getId());
65
66
if
(!$this->
getField
(
'CURRENCY'
))
67
{
68
$this->
setField
(
'CURRENCY'
, $entity->getOrder()->getCurrency());
69
}
70
71
$sum
=
$entity
->getPrice();
72
$shipmentItemCollection =
$entity
->getShipmentItemCollection();
73
75
foreach
($shipmentItemCollection as $item)
76
{
77
$basketItem = $item->getBasketItem();
78
$sum
+=
Sale\PriceMaths::roundPrecision
($item->getQuantity() * $basketItem->getPrice());
79
}
80
81
$this->
setField
(
'SUM'
,
$sum
);
82
}
83
}
84
}
85
89
protected
function
extractDataInternal
()
90
{
91
$result
= parent::extractDataInternal();
92
93
$totalSum
= 0;
94
if
(isset(
$result
[
'PRODUCTS'
]))
95
{
96
foreach
(
$result
[
'PRODUCTS'
] as $item)
97
$totalSum
+= $item[
'SUM'
];
98
}
99
100
if
(isset(
$result
[
'DELIVERY'
]))
101
{
102
foreach
(
$result
[
'DELIVERY'
] as $item)
103
$totalSum
+= $item[
'SUM'
];
104
}
105
106
$result
[
'PAYMENTS'
] =
array
(
107
array
(
108
'TYPE'
=> static::PAYMENT_TYPE_CREDIT,
109
'SUM'
=>
$totalSum
110
)
111
);
112
113
$result
[
'TOTAL_SUM'
] =
$totalSum
;
114
115
return
$result
;
116
}
117
121
public
static
function
getSupportedRelatedEntityType
()
122
{
123
return
static::SUPPORTED_ENTITY_TYPE_NONE;
124
}
125
126
}
$sum
$sum
Определения
checkout.php:6
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\AbstractCheck\$entities
$entities
Определения
abstractcheck.php:57
Bitrix\Sale\Cashbox\AbstractCheck\setField
setField($name, $value)
Определения
abstractcheck.php:124
Bitrix\Sale\Cashbox\AbstractCheck\getField
getField($name)
Определения
abstractcheck.php:115
Bitrix\Sale\Cashbox\Check
Определения
check.php:23
Bitrix\Sale\Cashbox\CreditCheck
Определения
creditcheck.php:16
Bitrix\Sale\Cashbox\CreditCheck\extractDataInternal
extractDataInternal()
Определения
creditcheck.php:89
Bitrix\Sale\Cashbox\CreditCheck\getType
static getType()
Определения
creditcheck.php:20
Bitrix\Sale\Cashbox\CreditCheck\getSupportedEntityType
static getSupportedEntityType()
Определения
creditcheck.php:44
Bitrix\Sale\Cashbox\CreditCheck\getName
static getName()
Определения
creditcheck.php:28
Bitrix\Sale\Cashbox\CreditCheck\getSupportedRelatedEntityType
static getSupportedRelatedEntityType()
Определения
creditcheck.php:121
Bitrix\Sale\Cashbox\CreditCheck\getCalculatedSign
static getCalculatedSign()
Определения
creditcheck.php:36
Bitrix\Sale\PriceMaths\roundPrecision
static roundPrecision($value)
Определения
pricemaths.php:16
Bitrix\Sale\Shipment
Определения
shipment.php:21
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
$entity
$entity
Определения
group_bizproc_workflow_delete.php:17
Bitrix\Sale
$totalSum
$totalSum
Определения
template.php:410
bitrix
modules
sale
lib
cashbox
creditcheck.php
Создано системой
1.14.0