Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
shipmentinvoice.php
1
<?php
2
3
namespace
Bitrix\Sale\Exchange\Entity
;
4
5
6
use Bitrix\Crm\Invoice\EntityMarker;
7
use
Bitrix\Main\ArgumentException
;
8
use
Bitrix\Sale\BasketBase
;
9
use
Bitrix\Sale\BasketItem
;
10
use
Bitrix\Sale\Exchange\EntityType
;
11
use
Bitrix\Sale\Internals\Entity
;
12
use
Bitrix\Sale\Order
;
13
use
Bitrix\Sale\Shipment
;
14
15
class
ShipmentInvoice
extends
ShipmentImport
16
{
17
public
function
getOwnerTypeId
()
18
{
19
return
EntityType::INVOICE_SHIPMENT
;
20
}
21
27
protected
function
addMarker
($invoice,
$entity
, $result)
28
{
29
EntityMarker::addMarker($invoice,
$entity
, $result);
30
}
31
36
protected
function
loadParentEntity(array
$fields
)
37
{
38
$entity
=
null
;
39
40
if
(!empty(
$fields
[
'ID'
]))
41
{
43
$entity
= \Bitrix\Crm\Invoice\Invoice::load(
$fields
[
'ID'
]);
44
}
45
return
$entity
;
46
}
47
53
public
static
function
resolveEntityTypeId
(
Entity
$shipment)
54
{
55
if
(!($shipment instanceof
Shipment
))
56
throw
new
ArgumentException
(
"Entity must be instanceof Shipment"
);
57
58
return
EntityType::INVOICE_SHIPMENT
;
59
}
60
66
protected
function
getBasketItemByItem
(
BasketBase
$basket, array $item)
67
{
68
return
Invoice::getBasketItemByItem($basket, $item);
69
}
70
75
protected
function
getAttributesItem
(
BasketItem
$basket)
76
{
77
return
Invoice::getAttributesItem($basket);
78
}
79
}
Bitrix\Catalog\Model\Entity
Definition
entity.php:12
Bitrix\Main\ArgumentException
Definition
exception.php:34
Bitrix\Sale\BasketBase
Definition
basketbase.php:17
Bitrix\Sale\BasketItem
Definition
basketitem.php:27
Bitrix\Sale\Exchange\Entity\EntityImport\$entity
$entity
Definition
entityimport.php:22
Bitrix\Sale\Exchange\Entity\ShipmentImport
Definition
shipmentimport.php:23
Bitrix\Sale\Exchange\Entity\ShipmentInvoice
Definition
shipmentinvoice.php:16
Bitrix\Sale\Exchange\Entity\ShipmentInvoice\addMarker
addMarker($invoice, $entity, $result)
Definition
shipmentinvoice.php:27
Bitrix\Sale\Exchange\Entity\ShipmentInvoice\getAttributesItem
getAttributesItem(BasketItem $basket)
Definition
shipmentinvoice.php:75
Bitrix\Sale\Exchange\Entity\ShipmentInvoice\resolveEntityTypeId
static resolveEntityTypeId(Entity $shipment)
Definition
shipmentinvoice.php:53
Bitrix\Sale\Exchange\Entity\ShipmentInvoice\getOwnerTypeId
getOwnerTypeId()
Definition
shipmentinvoice.php:17
Bitrix\Sale\Exchange\Entity\ShipmentInvoice\getBasketItemByItem
getBasketItemByItem(BasketBase $basket, array $item)
Definition
shipmentinvoice.php:66
Bitrix\Sale\Exchange\EntityType
Definition
entitytype.php:6
Bitrix\Sale\Exchange\EntityType\INVOICE_SHIPMENT
const INVOICE_SHIPMENT
Definition
entitytype.php:17
Bitrix\Sale\Exchange\ImportBase\$fields
$fields
Definition
importbase.php:18
Bitrix\Sale\Helpers\Order
Definition
order.php:10
Bitrix\Sale\Shipment
Definition
shipment.php:21
Bitrix\Sale\Exchange\Entity
Definition
entityimport.php:2
modules
sale
lib
exchange
entity
shipmentinvoice.php
Создано системой
1.10.0