1
0
mirror of synced 2024-11-23 22:06:11 +03:00

Исправление присваивания номера заказа к платежу при синхронизации с CRM (#343)

This commit is contained in:
Kocmonavtik 2024-04-03 10:59:10 +03:00 committed by GitHub
parent 7f69ebfa1f
commit cbddd69001
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 8 deletions

View File

@ -1,3 +1,6 @@
## 2024-04-03 v.6.5.13
- Исправление присваивания номера заказа к платежу при синхронизации с CRM
## 2024-03-28 v.6.5.12
- Исправлена подстановка домена при генерации каталога

View File

@ -1245,6 +1245,12 @@ class RetailCrmHistory
}
}
self::orderSave($newOrder);
if ($optionsOrderNumbers === 'Y' && isset($order['number'])) {
$newOrder->setField('ACCOUNT_NUMBER', $order['number']);
}
$orderSumm = 0;
foreach ($basket as $item) {
@ -1268,6 +1274,7 @@ class RetailCrmHistory
if (!isset($orderCrm)) {
$orderCrm = RCrmActions::apiMethod($api, 'orderGet', __METHOD__, $order['id']);
}
if ($orderCrm) {
self::paymentsUpdate($newOrder, $orderCrm['order'], $newHistoryPayments);
}
@ -1344,11 +1351,6 @@ class RetailCrmHistory
self::orderSave($newOrder);
if ($optionsOrderNumbers === 'Y' && isset($order['number'])) {
$newOrder->setField('ACCOUNT_NUMBER', $order['number']);
self::orderSave($newOrder);
}
//items loyalty info to HL
if (!empty($editBasketInfo)) {
$newBasket = $newOrder->getBasket();
@ -1989,10 +1991,12 @@ class RetailCrmHistory
//update data
if ($nowPayment instanceof Payment) {
$nowPayment->setField('SUM', $paymentCrm['amount']);
if ($optionsPayTypes[$paymentCrm['type']] != $nowPayment->getField('PAY_SYSTEM_ID')) {
$nowPayment->setField('PAY_SYSTEM_ID', $optionsPayTypes[$paymentCrm['type']]);
$nowPayment->setField('PAY_SYSTEM_NAME', $arPaySysmems[$optionsPayTypes[$paymentCrm['type']]]);
}
if (isset($optionsPayment[$paymentCrm['status']])) {
$nowPayment->setField('PAID', $optionsPayment[$paymentCrm['status']]);
}
@ -2012,6 +2016,7 @@ class RetailCrmHistory
$newPayment->setField('EXTERNAL_PAYMENT', 'N');
$newPayment->setField('UPDATED_1C', 'N');
$newPayment->setField('XML_ID', $paymentCrm['id']);
$newPayment->setField('ACCOUNT_NUMBER', $order->getField('ACCOUNT_NUMBER'));
$newPaymentId = $newPayment->getId();
@ -2024,6 +2029,7 @@ class RetailCrmHistory
$paySumm += $paymentCrm['amount'];
}
}
foreach ($paymentsList as $payment) {
if ($payment->isPaid()) {
$payment->setPaid("N");

View File

@ -1 +1 @@
- Исправлена подстановка домена при генерации каталога
- Исправление присваивания номера заказа к платежу при синхронизации с CRM

View File

@ -1,6 +1,6 @@
<?php
$arModuleVersion = [
'VERSION' => '6.5.12',
'VERSION_DATE' => '2024-03-28 17:00:00'
'VERSION' => '6.5.13',
'VERSION_DATE' => '2024-04-03 10:30:00'
];