From e3c1d93ae42c578b09c4769c4cfb6515dddf3d1e Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Thu, 17 Apr 2025 17:11:09 +0300 Subject: [PATCH] error in response --- erp24/api2/controllers/DataController.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/erp24/api2/controllers/DataController.php b/erp24/api2/controllers/DataController.php index 08a0c84d..baf04e50 100644 --- a/erp24/api2/controllers/DataController.php +++ b/erp24/api2/controllers/DataController.php @@ -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(); -- 2.39.5