1
0
mirror of synced 2024-11-22 05:16:09 +03:00

fix onOrderUpdateEvent

This commit is contained in:
Grisha Pomadchin 2013-09-17 18:06:58 +04:00
parent 77abe318ac
commit e3ceadfe67
2 changed files with 6 additions and 2 deletions

View File

@ -417,6 +417,8 @@ class ICrmOrderActions
'STATUS_ID' => $optionsPayStatuses[$order['status']]
));
$GLOBALS['FROM_HISTORY'] = true;
CSaleOrder::Update($order['externalId'], $arFields);
}

View File

@ -21,6 +21,9 @@ class ICrmOrderEvent {
* @param mixed $arFields - Order arFields
*/
function onUpdateOrder($ID, $arFields = array()) {
if(isset($GLOBALS['FROM_HISTORY']) && $GLOBALS['FROM_HISTORY'])
return;
self::writeDataOnOrderCreate($ID);
}
@ -35,6 +38,7 @@ class ICrmOrderEvent {
*/
function onSendOrderMail($ID, &$eventName, &$arFields) {
self::writeDataOnOrderCreate($ID);
COption::SetOptionString(self::$MODULE_ID, self::$CRM_ORDER_LAST_ID, $ID);
}
/**
@ -89,8 +93,6 @@ class ICrmOrderEvent {
return true;
}
COption::SetOptionString(self::$MODULE_ID, self::$CRM_ORDER_LAST_ID, $ID);
return true;
}