diff --git a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php index ee303722..9bd387fd 100644 --- a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php +++ b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php @@ -814,7 +814,9 @@ class RetailCrmHistory if ($paymentExternalId) { $newHistoryPayments[$orderPayment->getField('XML_ID')]['externalId'] = $paymentExternalId; RCrmActions::apiMethod($api, 'paymentEditById', __METHOD__, $newHistoryPayments[$orderPayment->getField('XML_ID')]); - \Bitrix\Sale\Internals\PaymentTable::update($paymentId, array('XML_ID' => '')); + if ($paymentId) { + \Bitrix\Sale\Internals\PaymentTable::update($paymentId, array('XML_ID' => '')); + } } } }