Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
invoice.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\Exchange\EntityType
;
9
use
Bitrix\Sale\Internals\Entity
;
10
use
Bitrix\Sale\Order
;
11
12
class
Invoice
extends
OrderImport
13
{
17
public
function
getOwnerTypeId
()
18
{
19
return
EntityType::INVOICE
;
20
}
21
27
protected
function
addMarker
($invoice,
$entity
, $result)
28
{
29
EntityMarker::addMarker($invoice,
$entity
, $result);
30
}
31
36
protected
function
createEntity
(array $fileds)
37
{
38
return \Bitrix\Crm\Invoice\Invoice::create($this->settings->getSiteId(), $fileds[
'USER_ID'
], $this->settings->getCurrency());
39
}
40
45
protected
function
loadParentEntity(array
$fields
)
46
{
47
$entity
=
null
;
48
49
if
(!empty(
$fields
[
'ID'
]))
50
{
52
$entity
= \Bitrix\Crm\Invoice\Invoice::load(
$fields
[
'ID'
]);
53
}
54
return
$entity
;
55
}
56
62
public
static
function
resolveEntityTypeId
(
Entity
$order)
63
{
64
if
(!($order instanceof
Order
))
65
throw
new
ArgumentException
(
"Entity must be instanceof Order"
);
66
67
return
EntityType::INVOICE
;
68
}
69
74
protected
function
getShipmentTypeId
()
75
{
76
return
EntityType::INVOICE_SHIPMENT
;
77
}
78
}
Bitrix\Catalog\Model\Entity
Definition
entity.php:12
Bitrix\Main\ArgumentException
Definition
exception.php:34
Bitrix\Sale\Exchange\Entity\EntityImport\$entity
$entity
Definition
entityimport.php:22
Bitrix\Sale\Exchange\Entity\Invoice
Definition
invoice.php:13
Bitrix\Sale\Exchange\Entity\Invoice\getShipmentTypeId
getShipmentTypeId()
Definition
invoice.php:74
Bitrix\Sale\Exchange\Entity\Invoice\addMarker
addMarker($invoice, $entity, $result)
Definition
invoice.php:27
Bitrix\Sale\Exchange\Entity\Invoice\createEntity
createEntity(array $fileds)
Definition
invoice.php:36
Bitrix\Sale\Exchange\Entity\Invoice\getOwnerTypeId
getOwnerTypeId()
Definition
invoice.php:17
Bitrix\Sale\Exchange\Entity\Invoice\resolveEntityTypeId
static resolveEntityTypeId(Entity $order)
Definition
invoice.php:62
Bitrix\Sale\Exchange\Entity\OrderImport
Definition
orderimport.php:18
Bitrix\Sale\Exchange\EntityType
Definition
entitytype.php:6
Bitrix\Sale\Exchange\EntityType\INVOICE
const INVOICE
Definition
entitytype.php:16
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\Exchange\Entity
Definition
entityimport.php:2
modules
sale
lib
exchange
entity
invoice.php
Создано системой
1.10.0