]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
error in response
authorAlexander Smirnov <fredeom@mail.ru>
Thu, 17 Apr 2025 14:11:09 +0000 (17:11 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Thu, 17 Apr 2025 14:11:09 +0000 (17:11 +0300)
erp24/api2/controllers/DataController.php

index 08a0c84d108e5a7c0f6b4bd5728c96e2ef101fde..baf04e50f1d619f254d3f9f2baa775d3c1c75737 100644 (file)
@@ -2232,12 +2232,6 @@ class DataController extends BaseController
                 }
             }
 
-            if (!empty($result['created_new_orders'])) {
-                foreach ($result['created_new_orders'] as $arr) {
-                    MarketplaceOrders::updateAll(['status_1c' => MarketplaceOrders::STATUSES_1C_SENDED_TO_1C], ['guid' => $arr['id']]);
-                }
-            }
-
             if (!empty($result['created_orders'])) {
                 $productsNames = Products1c::getNamesByTip('products');
                 foreach ($result['created_orders'] as $arr) {
@@ -2246,7 +2240,7 @@ class DataController extends BaseController
                     }
                     if (!empty($marketplaceOrders)) {
                         /** @var MarketplaceOrders $marketplaceOrders */
-                        if (!empty($arr["errors"]) || !empty($arr["errors_items"])) {
+                        if (!empty($arr["errors"]) || !empty($arr["error"]) || !empty($arr["errors_items"])) {
                             $errorText = '';
                             if (!empty($arr["errors"])) {
                                     //"errors": [
@@ -2299,6 +2293,13 @@ class DataController extends BaseController
                                 }
                             }
 
+                            if (!empty($arr["error"])) {
+                                //"error": "Ошибка преобразования ИД документа",
+                                //"error_description": "ИД документа 01202307-2705-1039-09bc-100015809667 уже записан в системе",
+                                $errorText .= $arr["error"];
+                                $errorText .= ' ,' . $arr['error_description'];
+                            }
+
                             $marketplaceOrders->status_1c = MarketplaceOrders::STATUSES_1C_ERROR_1C;
                             $marketplaceOrders->error_text = $errorText;
                             $marketplaceOrders->save();