From c4109cf1c6f5b39d4c77e199961805a9a69c3a03 Mon Sep 17 00:00:00 2001 From: gorokh Date: Mon, 9 Dec 2019 10:58:41 +0300 Subject: [PATCH 1/3] =?UTF-8?q?=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B4=D1=83=D0=B1=D0=BB=D0=B8=D1=80=D1=83=D1=8E?= =?UTF-8?q?=D1=89=D0=B8=D1=85=20=D1=82=D0=BE=D0=B2=D0=B0=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=BF=D0=BE=20externalId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../general/history/RetailCrmHistory_v5.php | 20 +++++++++---------- intaro.retailcrm/description.ru | 4 +--- intaro.retailcrm/install/version.php | 4 ++-- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php index 7badf05c..d356aaf5 100644 --- a/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php +++ b/intaro.retailcrm/classes/general/history/RetailCrmHistory_v5.php @@ -654,11 +654,11 @@ class RetailCrmHistory $orderTemp = $response['order']; $ditems = []; foreach ($orderTemp['items'] as $item) { - $ditems[$item['offer']['xmlId']]['quantity'] += $item['quantity']; - $ditems[$item['offer']['xmlId']]['discountTotal'] += $item['quantity'] * $item['discountTotal']; - $ditems[$item['offer']['xmlId']]['initialPrice'] = (float)$item['initialPrice']; - $ditems[$item['offer']['xmlId']]['price_sum'] = $ditems[$item['offer']['xmlId']]['initialPrice'] * $ditems[$item['offer']['xmlId']]['quantity'] - $ditems[$item['offer']['xmlId']]['discountTotal']; - $ditems[$item['offer']['xmlId']]['price_item'] = $ditems[$item['offer']['xmlId']]['price_sum'] / $ditems[$item['offer']['xmlId']]['quantity']; + $ditems[$item['offer']['externalId']]['quantity'] += $item['quantity']; + $ditems[$item['offer']['externalId']]['discountTotal'] += $item['quantity'] * $item['discountTotal']; + $ditems[$item['offer']['externalId']]['initialPrice'] = (float)$item['initialPrice']; + $ditems[$item['offer']['externalId']]['price_sum'] = $ditems[$item['offer']['externalId']]['initialPrice'] * $ditems[$item['offer']['externalId']]['quantity'] - $ditems[$item['offer']['externalId']]['discountTotal']; + $ditems[$item['offer']['externalId']]['price_item'] = $ditems[$item['offer']['externalId']]['price_sum'] / $ditems[$item['offer']['externalId']]['quantity']; } unset($orderTemp); } @@ -666,8 +666,8 @@ class RetailCrmHistory $log->write($ditems, 'duplicateItemsOrderHistory'); foreach ($order['items'] as $product) { - if($ditems[$product['offer']['xmlId']]['quantity']){ - $product['quantity'] = $ditems[$product['offer']['xmlId']]['quantity']; + if($ditems[$product['offer']['externalId']]['quantity']){ + $product['quantity'] = $ditems[$product['offer']['externalId']]['quantity']; } $item = self::getExistsItem($basket, 'catalog', $product['offer']['externalId']); @@ -703,7 +703,7 @@ class RetailCrmHistory } if ($product['delete']) { - if ($ditems[$product['offer']['xmlId']]['quantity'] <= 0) { + if ($ditems[$product['offer']['externalId']]['quantity'] <= 0) { $item->delete(); continue; @@ -737,8 +737,8 @@ class RetailCrmHistory $item->setField('PRICE', $itemCost - $resultDiscount); //set price dublicate item - if ($ditems[$product['offer']['xmlId']]['price_item']) { - $item->setField('PRICE', $ditems[$product['offer']['xmlId']]['price_item']); + if ($ditems[$product['offer']['externalId']]['price_item']) { + $item->setField('PRICE', $ditems[$product['offer']['externalId']]['price_item']); $item->setField('DISCOUNT_PRICE', ''); } } diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index a2a82e24..5f3b05c4 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1,3 +1 @@ -- Исправление при обработке полученных изменений о контрагенте -- При обработки истории по клиентам добавлены кастомные поля -- Исправлены мелкие ошибки и недочеты +- При обработке истории сбор по дублирующим товарам заменен на "externalId" diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index df44f11f..764a33ed 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,5 +1,5 @@ "2.5.3", - "VERSION_DATE" => "2019-11-1 15:10:00" + "VERSION" => "5.2.4", + "VERSION_DATE" => "2019-12-9 10:45:00" ); From 37c347276c0b64d63b516d5c5bbf1b641978fea5 Mon Sep 17 00:00:00 2001 From: gorokh Date: Fri, 20 Dec 2019 13:49:32 +0300 Subject: [PATCH 2/3] fix version --- intaro.retailcrm/install/version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index 764a33ed..30a8fd84 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,5 +1,5 @@ "5.2.4", - "VERSION_DATE" => "2019-12-9 10:45:00" + "VERSION" => "5.2.3", + "VERSION_DATE" => "2019-11-1 15:10:00" ); From af3720f80d5c8ce79e5490471dc2cd1db7f5ea99 Mon Sep 17 00:00:00 2001 From: gorokh Date: Fri, 20 Dec 2019 13:53:46 +0300 Subject: [PATCH 3/3] fix --- intaro.retailcrm/install/version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index 30a8fd84..df44f11f 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,5 +1,5 @@ "5.2.3", + "VERSION" => "2.5.3", "VERSION_DATE" => "2019-11-1 15:10:00" );