upd orderEdit method
This commit is contained in:
parent
1a674a91be
commit
47452c4f25
@ -119,28 +119,16 @@ class ICrmOrderEvent {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$arFields = CSaleOrder::GetById($ID);
|
|
||||||
|
|
||||||
if (empty($arFields)) {
|
|
||||||
//handle err
|
|
||||||
self::eventLog('ICrmOrderEvent::onSaleCancelOrder', 'empty($arFields)', 'incorrect order');
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$api_host = COption::GetOptionString(self::$MODULE_ID, self::$CRM_API_HOST_OPTION, 0);
|
$api_host = COption::GetOptionString(self::$MODULE_ID, self::$CRM_API_HOST_OPTION, 0);
|
||||||
$api_key = COption::GetOptionString(self::$MODULE_ID, self::$CRM_API_KEY_OPTION, 0);
|
$api_key = COption::GetOptionString(self::$MODULE_ID, self::$CRM_API_KEY_OPTION, 0);
|
||||||
|
|
||||||
//saved cat params
|
//saved cat params
|
||||||
$optionsOrderTypes = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_ORDER_TYPES_ARR, 0));
|
|
||||||
$optionsPayStatuses = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_PAYMENT_STATUSES, 0)); // --statuses
|
$optionsPayStatuses = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_PAYMENT_STATUSES, 0)); // --statuses
|
||||||
|
|
||||||
$api = new IntaroCrm\RestApi($api_host, $api_key);
|
$api = new IntaroCrm\RestApi($api_host, $api_key);
|
||||||
|
|
||||||
$order = array(
|
$order = array(
|
||||||
'externalId' => (int) $ID,
|
'externalId' => (int) $ID,
|
||||||
'customerId' => (int) $arFields['USER_ID'],
|
|
||||||
'orderType' => $optionsOrderTypes[$arFields['PERSON_TYPE_ID']],
|
|
||||||
'status' => $optionsPayStatuses[$cancel],
|
'status' => $optionsPayStatuses[$cancel],
|
||||||
'statusComment' => ICrmOrderActions::toJSON($reason)
|
'statusComment' => ICrmOrderActions::toJSON($reason)
|
||||||
);
|
);
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
<?
|
|
||||||
$arModuleVersion = array(
|
|
||||||
'VERSION' => '0.4.6',
|
|
||||||
'VERSION_DATE' => '2013-07-25 15:35:00',
|
|
||||||
);
|
|
Loading…
Reference in New Issue
Block a user