1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
deal.php
См. документацию.
1<?php
2namespace Bitrix\Sale\Exchange\Integration\Service\Batchable;
3
4
5use Bitrix\Sale\Exchange\Integration;
6use Bitrix\Sale\Exchange\Integration\Exception;
7use Bitrix\Sale\Rest\Entity\BusinessValuePersonDomainType;
8
9class Deal extends Proxy
10{
11 public function init($params)
12 {
13 foreach($params as $index=>$item)
14 {
16
17 $entity->setTitle($item['TITLE']);
18 $entity->setOriginId($index);
19 $entity->setOriginatorId(static::ANALITICS_ORIGINATOR_ID);
20 $entity->setOpportunity($item['PRICE']);
21 $entity->setCurrency($item['CURRENCY']);
22
23 if($item['COMPANY_ID'])
24 {
25 $entity->setCompanyId($item['COMPANY_ID']);
26 }
27 if($item['CONTACT_ID'])
28 {
29 $entity->setContactId($item['CONTACT_ID']) ;
30 }
31
32 $this->collection->addItem(
33 Integration\Service\Internal\Container\Item::create($entity)
34 ->setInternalIndex($index)
35 );
36 }
37 return $this;
38 }
39
40 static public function contactItemsGet($id)
41 {
42 $proxy = static::getProxy();
43 $r = $proxy->contactItemsGet($id);
44
45 if($r->isSuccess())
46 {
47 $result = $r->getData()['DATA']['result'];
48 }
49 else
50 {
51 throw new Exception\BatchableException(implode(',', $r->getErrorMessages()));
52 }
53
54 return $result;
55 }
56 static public function dealContactUpdates($id, $params, $contacts)
57 {
58 $result = [];
59 $indexes = self::getIndexesFromParams($params);
60 $contacts = static::getIndexesContactFromParams($contacts);
61
62 $relations = static::clientRelation($indexes, BusinessValuePersonDomainType::TYPE_I_NAME);
63
64 $contactIds = [];
66 foreach ($relations as $relation)
67 {
68 $contactIds[] = $relation->getDestinationEntityId();
69 }
70
71 if(count(array_diff($contactIds, $contacts))>0)
72 {
73 $proxy = static::getProxy();
74 $r = $proxy->contactItemsSet($id, static::getContactItemsFromIndexes(array_merge($contactIds, $contacts)));
75 if($r->isSuccess())
76 {
77 $result = $r->getData()['DATA']['result'];
78 }
79 else
80 {
81 throw new Exception\BatchableException(implode(',', $r->getErrorMessages()));
82 }
83 }
84 return $result;
85 }
86 static public function dealContactAdds($id, $params)
87 {
88 $result = [];
89 $indexes = self::getIndexesFromParams($params);
90
91 $relations = static::clientRelation($indexes, BusinessValuePersonDomainType::TYPE_I_NAME);
92
93 $contactIds = [];
95 foreach ($relations as $relation)
96 {
97 $contactIds[] = $relation->getDestinationEntityId();
98 }
99
100 if(count($contactIds)>0)
101 {
102 $proxy = static::getProxy();
103 $r = $proxy->contactItemsSet($id, static::getContactItemsFromIndexes($contactIds));
104 if($r->isSuccess())
105 {
106 $result = $r->getData()['DATA']['result'];
107 }
108 else
109 {
110 throw new Exception\BatchableException(implode(',', $r->getErrorMessages()));
111 }
112 }
113 return $result;
114 }
115
116 public function getSrcEntityTypeId()
117 {
119 }
120 public function getDstEntityTypeId()
121 {
123 }
124
125 static protected function getProxy()
126 {
128 }
129}
static create($type, array $values=null)
Определения factory.php:11
$result
Определения get_property_values.php:14
$entity
$proxy
Определения proxy.php:11
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799