Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AmiBX
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bitrix
AmiBX
Commits
38062638
Commit
38062638
authored
Feb 09, 2022
by
Kulya
😊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Begin adding Client to Billz1
parent
1bea6135
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
1 deletion
+47
-1
AloVoiceRest.php
vendor/alovoice/src/AloVoiceRest.php
+23
-1
BillzRest.php
vendor/alovoice/src/BillzRest.php
+24
-0
No files found.
vendor/alovoice/src/AloVoiceRest.php
View file @
38062638
...
@@ -714,7 +714,7 @@ class AloVoiceRest
...
@@ -714,7 +714,7 @@ class AloVoiceRest
}
}
$res
=
BxRest
::
call
(
"sale.order.list"
,[
$res
=
BxRest
::
call
(
"sale.order.list"
,[
"select"
=>
[
"id"
,
"price"
,
"accountNumber"
,
"dateUpdate"
],
"select"
=>
[
"id"
],
//
,"price","accountNumber","dateUpdate"],
"filter"
=>
$sFilter
"filter"
=>
$sFilter
]);
]);
...
@@ -751,6 +751,8 @@ class AloVoiceRest
...
@@ -751,6 +751,8 @@ class AloVoiceRest
];
];
$arResOrders
[]
=
BillzRest
::
createOrder
(
$arOrderParams
);
$arResOrders
[]
=
BillzRest
::
createOrder
(
$arOrderParams
);
$arOrder
=
self
::
process_order_client
(
$order
[
"id"
]);
}
}
self
::
set_orders_last_update
();
self
::
set_orders_last_update
();
...
@@ -768,6 +770,26 @@ class AloVoiceRest
...
@@ -768,6 +770,26 @@ class AloVoiceRest
}
}
private
function
process_order_client
(
$id
=
false
)
{
$res
=
BxRest
::
call
(
"sale.order.get"
,[
"id"
=>
$id
]);
ALVC
::
eLog
(
$res
[
"result"
],
"------ Billz :: Order RES:"
);
if
(
empty
(
$res
[
"result"
][
"order"
][
'clients'
])){
return
false
;
}
$client
=
$res
[
"result"
][
"order"
][
'clients'
][
0
];
$clientId
=
$client
[
"entityId"
];
$clientTypeId
=
$client
[
"entityTypeId"
];
if
(
$clientTypeId
==
3
){
$resCont
=
BxRest
::
call
(
"crm.contact.get"
,[
"id"
=>
$clientId
]);
ALVC
::
eLog
(
$resCont
[
"result"
],
"------ Billz :: Client(contact) RES:"
);
if
(
!
empty
(
$resCont
[
"UF_CRM_1644411792448"
])){
}
}
//
}
private
function
get_bx_order_products
(
$id
=
false
)
{
private
function
get_bx_order_products
(
$id
=
false
)
{
// if(empty($id)){ return false; }
// if(empty($id)){ return false; }
$res
=
BxRest
::
call
(
"sale.basketItem.list"
,[
$res
=
BxRest
::
call
(
"sale.basketItem.list"
,[
...
...
vendor/alovoice/src/BillzRest.php
View file @
38062638
...
@@ -32,6 +32,30 @@ require_once (__DIR__.'/keys.php');
...
@@ -32,6 +32,30 @@ require_once (__DIR__.'/keys.php');
return
$result
;
return
$result
;
}
}
public
static
function
createClient
(
$params
=
false
)
{
/*
{
"jsonrpc": "2.0",
"method": "client.create",
"params": {
"phone": "998931830000",
"firstName": "Ivanoff",
"lastName": "Fedor",
"gender": 0,
"birthDate":"1980-08-12T00:00:00Z"
},
"id": "1200"
}
*/
$client_params
=
[
"firstName"
=>
(
!
empty
(
$params
[
"NAME"
]))
?
$params
[
"NAME"
]
:
"New Client"
];
// if(!empty())
$result
=
static
::
callCurl
(
"client.create"
,
$client_params
);
return
$result
;
}
public
static
function
createOrder
(
$params
=
false
)
{
public
static
function
createOrder
(
$params
=
false
)
{
/*
/*
order_id
order_id
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment