Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Commit b9b7145

Browse files
committed
Merge branch 'task#98'
2 parents b7f0a16 + a199411 commit b9b7145

File tree

5 files changed

+493
-28
lines changed

5 files changed

+493
-28
lines changed

src/classes/crm/invoice/invoice.php

Lines changed: 131 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,61 @@ class Invoice extends Bitrix24Entity
1919

2020
/**
2121
* Get list of lead items.
22+
*
2223
* @link http://dev.1c-bitrix.ru/rest_help/crm/invoice/crm_invoice_list.php
23-
* @param array $order - order of task items
24-
* @param array $filter - filter array
25-
* @param array $select - array of collumns to select
26-
* @param integer $start - entity number to start from (usually returned in 'next' field of previous 'crm.invoice.list' API call)
24+
*
25+
* @param array $order - order of task items
26+
* @param array $filter - filter array
27+
* @param array $select - array of collumns to select
28+
* @param integer $start - entity number to start from (usually returned in 'next' field of previous 'crm.invoice.list' API call)
29+
*
2730
* @return array
31+
* @throws \Bitrix24\Exceptions\Bitrix24ApiException
32+
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException
33+
* @throws \Bitrix24\Exceptions\Bitrix24Exception
34+
* @throws \Bitrix24\Exceptions\Bitrix24IoException
35+
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException
36+
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException
37+
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException
38+
* @throws \Bitrix24\Exceptions\Bitrix24PortalRenamedException
39+
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException
40+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException
41+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException
42+
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException
2843
*/
2944
public function getList($order = array(), $filter = array(), $select = array(), $start = 0)
3045
{
3146
$fullResult = $this->client->call(
3247
'crm.invoice.list',
3348
array(
34-
'order' => $order,
35-
'filter'=> $filter,
36-
'select'=> $select,
37-
'start' => $start
49+
'order' => $order,
50+
'filter' => $filter,
51+
'select' => $select,
52+
'start' => $start
3853
)
3954
);
4055
return $fullResult;
4156
}
4257

4358
/**
4459
* get invoice by id
45-
* @var $invoiceId integer invoice identifier
60+
*
4661
* @link http://dev.1c-bitrix.ru/rest_help/crm/invoice/crm_invoice_get.php
62+
* @var $invoiceId integer invoice identifier
4763
* @return array
48-
*/
64+
* @throws \Bitrix24\Exceptions\Bitrix24ApiException
65+
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException
66+
* @throws \Bitrix24\Exceptions\Bitrix24Exception
67+
* @throws \Bitrix24\Exceptions\Bitrix24IoException
68+
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException
69+
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException
70+
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException
71+
* @throws \Bitrix24\Exceptions\Bitrix24PortalRenamedException
72+
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException
73+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException
74+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException
75+
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException
76+
*/
4977
public function get($invoiceId)
5078
{
5179
$fullResult = $this->client->call(
@@ -57,10 +85,23 @@ public function get($invoiceId)
5785

5886
/**
5987
* delete invoice by id
60-
* @var $invoiceId integer invoice identifier
88+
*
6189
* @link http://dev.1c-bitrix.ru/rest_help/crm/invoice/crm_invoice_delete.php
90+
* @var $invoiceId integer invoice identifier
6291
* @return array
63-
*/
92+
* @throws \Bitrix24\Exceptions\Bitrix24ApiException
93+
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException
94+
* @throws \Bitrix24\Exceptions\Bitrix24Exception
95+
* @throws \Bitrix24\Exceptions\Bitrix24IoException
96+
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException
97+
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException
98+
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException
99+
* @throws \Bitrix24\Exceptions\Bitrix24PortalRenamedException
100+
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException
101+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException
102+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException
103+
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException
104+
*/
64105
public function delete($invoiceId)
65106
{
66107
$fullResult = $this->client->call(
@@ -72,10 +113,24 @@ public function delete($invoiceId)
72113

73114
/**
74115
* Add a new invoice to CRM
116+
*
75117
* @param array $fields array of fields
76-
* @link http://dev.1c-bitrix.ru/rest_help/crm/invoice/crm_invoice_add.php
118+
*
77119
* @return array
78-
*/
120+
* @throws \Bitrix24\Exceptions\Bitrix24ApiException
121+
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException
122+
* @throws \Bitrix24\Exceptions\Bitrix24Exception
123+
* @throws \Bitrix24\Exceptions\Bitrix24IoException
124+
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException
125+
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException
126+
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException
127+
* @throws \Bitrix24\Exceptions\Bitrix24PortalRenamedException
128+
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException
129+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException
130+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException
131+
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException
132+
* @link http://dev.1c-bitrix.ru/rest_help/crm/invoice/crm_invoice_add.php
133+
*/
79134
public function add($fields = array())
80135
{
81136
$fullResult = $this->client->call(
@@ -87,11 +142,26 @@ public function add($fields = array())
87142

88143
/**
89144
* update invoice by id
90-
* @var $invoiceId integer invoice identifier
91-
* @var $invoiceFields array invoice fields to update
145+
*
92146
* @link http://dev.1c-bitrix.ru/rest_help/crm/invoice/crm_invoice_update.php
147+
*
148+
* @param $invoiceId
149+
* @param $invoiceFields
150+
*
93151
* @return array
94-
*/
152+
* @throws \Bitrix24\Exceptions\Bitrix24ApiException
153+
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException
154+
* @throws \Bitrix24\Exceptions\Bitrix24Exception
155+
* @throws \Bitrix24\Exceptions\Bitrix24IoException
156+
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException
157+
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException
158+
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException
159+
* @throws \Bitrix24\Exceptions\Bitrix24PortalRenamedException
160+
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException
161+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException
162+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException
163+
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException
164+
*/
95165
public function update($invoiceId, $invoiceFields)
96166
{
97167
$fullResult = $this->client->call(
@@ -106,14 +176,57 @@ public function update($invoiceId, $invoiceFields)
106176

107177
/**
108178
* get list of invoice fields with description
179+
*
109180
* @link http://dev.1c-bitrix.ru/rest_help/crm/invoice/crm_invoice_fields.php
110181
* @return array
111-
*/
182+
* @throws \Bitrix24\Exceptions\Bitrix24ApiException
183+
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException
184+
* @throws \Bitrix24\Exceptions\Bitrix24Exception
185+
* @throws \Bitrix24\Exceptions\Bitrix24IoException
186+
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException
187+
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException
188+
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException
189+
* @throws \Bitrix24\Exceptions\Bitrix24PortalRenamedException
190+
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException
191+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException
192+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException
193+
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException
194+
*/
112195
public function fields()
113196
{
114197
$fullResult = $this->client->call(
115198
'crm.invoice.fields'
116199
);
117200
return $fullResult;
118201
}
202+
203+
/**
204+
* get external link for invoice
205+
*
206+
* @param $id
207+
*
208+
* @return array
209+
* @throws \Bitrix24\Exceptions\Bitrix24ApiException
210+
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException
211+
* @throws \Bitrix24\Exceptions\Bitrix24Exception
212+
* @throws \Bitrix24\Exceptions\Bitrix24IoException
213+
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException
214+
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException
215+
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException
216+
* @throws \Bitrix24\Exceptions\Bitrix24PortalRenamedException
217+
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException
218+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException
219+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException
220+
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException
221+
*/
222+
public function getExternalLink($id)
223+
{
224+
$fullResult = $this->client->call(
225+
'crm.invoice.getexternallink',
226+
array(
227+
'id' => $id
228+
)
229+
);
230+
return $fullResult;
231+
}
119232
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?php
2+
3+
namespace Bitrix24\CRM\Invoice;
4+
5+
use Bitrix24\Bitrix24Entity;
6+
7+
/**
8+
* Class PaySystem
9+
*/
10+
class PaySystem extends Bitrix24Entity
11+
{
12+
/**
13+
* @link https://dev.1c-bitrix.ru/rest_help/crm/invoice/crm_paysystem_list.php
14+
*
15+
* @param array $order - order of task items
16+
* @param array $filter - filter array
17+
*
18+
* @return array
19+
*
20+
* @throws \Bitrix24\Exceptions\Bitrix24ApiException
21+
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException
22+
* @throws \Bitrix24\Exceptions\Bitrix24Exception
23+
* @throws \Bitrix24\Exceptions\Bitrix24IoException
24+
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException
25+
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException
26+
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException
27+
* @throws \Bitrix24\Exceptions\Bitrix24PortalRenamedException
28+
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException
29+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException
30+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException
31+
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException
32+
*/
33+
public function getList($order = array(), $filter = array())
34+
{
35+
$fullResult = $this->client->call(
36+
'crm.paysystem.list',
37+
array(
38+
'order' => $order,
39+
'filter' => $filter,
40+
)
41+
);
42+
43+
return $fullResult;
44+
}
45+
46+
47+
/**
48+
* @link https://dev.1c-bitrix.ru/rest_help/crm/invoice/crm_paysystem_fields.php
49+
*
50+
* @return array
51+
*
52+
* @throws \Bitrix24\Exceptions\Bitrix24ApiException
53+
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException
54+
* @throws \Bitrix24\Exceptions\Bitrix24Exception
55+
* @throws \Bitrix24\Exceptions\Bitrix24IoException
56+
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException
57+
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException
58+
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException
59+
* @throws \Bitrix24\Exceptions\Bitrix24PortalRenamedException
60+
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException
61+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException
62+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException
63+
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException
64+
*
65+
*/
66+
public function fields()
67+
{
68+
$fullResult = $this->client->call(
69+
'crm.paysystem.fields',
70+
array()
71+
);
72+
73+
return $fullResult;
74+
}
75+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?php
2+
3+
namespace Bitrix24\CRM\Invoice;
4+
5+
use Bitrix24\Bitrix24Entity;
6+
7+
/**
8+
* Class PersonType
9+
*/
10+
class PersonType extends Bitrix24Entity
11+
{
12+
/**
13+
* @link https://dev.1c-bitrix.ru/rest_help/crm/invoice/crm_persontype_list.php
14+
*
15+
* @param array $order - order of task items
16+
* @param array $filter - filter array
17+
*
18+
* @return array
19+
*
20+
* @throws \Bitrix24\Exceptions\Bitrix24ApiException
21+
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException
22+
* @throws \Bitrix24\Exceptions\Bitrix24Exception
23+
* @throws \Bitrix24\Exceptions\Bitrix24IoException
24+
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException
25+
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException
26+
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException
27+
* @throws \Bitrix24\Exceptions\Bitrix24PortalRenamedException
28+
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException
29+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException
30+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException
31+
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException
32+
*/
33+
public function getList($order = array(), $filter = array())
34+
{
35+
$fullResult = $this->client->call(
36+
'crm.persontype.list',
37+
array(
38+
'order' => $order,
39+
'filter' => $filter,
40+
)
41+
);
42+
43+
return $fullResult;
44+
}
45+
46+
47+
/**
48+
* @link https://dev.1c-bitrix.ru/rest_help/crm/invoice/crm_persontype_fields.php
49+
*
50+
* @return array
51+
*
52+
* @throws \Bitrix24\Exceptions\Bitrix24ApiException
53+
* @throws \Bitrix24\Exceptions\Bitrix24EmptyResponseException
54+
* @throws \Bitrix24\Exceptions\Bitrix24Exception
55+
* @throws \Bitrix24\Exceptions\Bitrix24IoException
56+
* @throws \Bitrix24\Exceptions\Bitrix24MethodNotFoundException
57+
* @throws \Bitrix24\Exceptions\Bitrix24PaymentRequiredException
58+
* @throws \Bitrix24\Exceptions\Bitrix24PortalDeletedException
59+
* @throws \Bitrix24\Exceptions\Bitrix24PortalRenamedException
60+
* @throws \Bitrix24\Exceptions\Bitrix24SecurityException
61+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsExpiredException
62+
* @throws \Bitrix24\Exceptions\Bitrix24TokenIsInvalidException
63+
* @throws \Bitrix24\Exceptions\Bitrix24WrongClientException
64+
*
65+
*/
66+
public function fields()
67+
{
68+
$fullResult = $this->client->call(
69+
'crm.persontype.fields',
70+
array()
71+
);
72+
73+
return $fullResult;
74+
}
75+
}

0 commit comments

Comments
 (0)