From d92974e04dd750bfac2e9b0838554e9dca26664e Mon Sep 17 00:00:00 2001 From: fomichev Date: Wed, 18 Dec 2024 13:39:20 +0300 Subject: [PATCH] =?utf8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?utf8?q?=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=88?= =?utf8?q?=D0=B8=D0=B1=D0=BE=D0=BA=20=D0=B2=20error=5Ftext?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/api2/controllers/DataController.php | 4 +++- erp24/records/WaybillWriteOffs.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/erp24/api2/controllers/DataController.php b/erp24/api2/controllers/DataController.php index 558cee44..a43a92e8 100644 --- a/erp24/api2/controllers/DataController.php +++ b/erp24/api2/controllers/DataController.php @@ -260,6 +260,7 @@ class DataController extends BaseController { $waybillWriteOffsErp = WaybillWriteOffs::find()->where(['in', 'id', $waybillWriteOffIds])->all(); foreach ($waybillWriteOffsErp as $waybillWriteOffsErpElem) { $waybillWriteOffsErpElem->status = WriteOffsErp::STATUS_SEND; + $waybillWriteOffsErpElem->error_text = ''; $waybillWriteOffsErpElem->send_at = date('Y-m-d H:i:s'); $waybillWriteOffsErpElem->save(); if ($waybillWriteOffsErpElem->getErrors()) { @@ -267,7 +268,7 @@ class DataController extends BaseController { } } } catch (Exception $e3) { - file_put_contents(self::OUT_DIR . '/log_created_write_offs_erp_error.txt', PHP_EOL . date("d.m.Y H:i:s",time()). $e3->getMessage(), FILE_APPEND); + file_put_contents(self::OUT_DIR . '/log_created_waybill_write_offs_erp_error.txt', PHP_EOL . date("d.m.Y H:i:s",time()). $e3->getMessage(), FILE_APPEND); } } @@ -1069,6 +1070,7 @@ class DataController extends BaseController { if (!empty($waybillWriteOffsErp)) { /** @var WaybillWriteOffs $waybillWriteOffsErp */ $waybillWriteOffsErp->status = WriteOffsErp::STATUS_ERROR_1С; + $waybillWriteOffsErp->error_text = $errorText; $waybillWriteOffsErp->save(); if ($waybillWriteOffsErp->getErrors()) { LogService::apiErrorLog( diff --git a/erp24/records/WaybillWriteOffs.php b/erp24/records/WaybillWriteOffs.php index cac624eb..b93fb1d1 100644 --- a/erp24/records/WaybillWriteOffs.php +++ b/erp24/records/WaybillWriteOffs.php @@ -116,7 +116,7 @@ class WaybillWriteOffs extends \yii\db\ActiveRecord $model->setAttributes([ 'guid' => DataHelper::createGuidMy(), 'shift_transfer_id' => $shiftTransfer->id, - 'status' => self::STATUS_NEW, + 'status' => WriteOffsErp::STATUS_CREATED, 'store_id' => array_flip(array_map('strval', CityStore::getAllActiveGuidId()))[$shiftTransfer->store_guid], 'store_guid' => $shiftTransfer->store_guid, 'date' => $shiftTransfer->date, -- 2.39.5