From: Alexander Smirnov Date: Wed, 18 Dec 2024 07:23:51 +0000 (+0300) Subject: фиксы X-Git-Tag: 1.7~153^2~1 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=3cc58d8662aee0d5d724901f4ab7dc6e02315192;p=erp24_rep%2Fyii-erp24%2F.git фиксы --- diff --git a/erp24/api2/controllers/DataController.php b/erp24/api2/controllers/DataController.php index ade8e360..4c24aa11 100644 --- a/erp24/api2/controllers/DataController.php +++ b/erp24/api2/controllers/DataController.php @@ -138,10 +138,11 @@ class DataController extends BaseController { $waybillIncomingArray = $this->getWaybillIncomingDoc(); $waybillIncoming = $waybillIncomingArray['waybillIncoming']; + $waybillIncomingResult = $waybillIncomingArray['waybillIncomingResult']; $waybillIncomingIds = $waybillIncomingArray['waybillIncomingIds']; - if (!empty($waybillIncoming)) { - $mess['create_write_ons'] = $waybillIncoming; + if (!empty($waybillIncomingResult)) { + $mess['create_write_ons'] = $waybillIncomingResult; } $createEmployeeArray = $this->getCreateEmployee(); @@ -353,7 +354,7 @@ class DataController extends BaseController { 'summ' ]) ->indexBy('id') - ->andWhere(['status' => 1]) + ->andWhere(['status' => 2]) ->asArray() ->all(); @@ -379,11 +380,14 @@ class DataController extends BaseController { $waybillIncomingTemp = $waybillIncoming; foreach ($waybillIncomingTemp as $key => $row) { $waybillIncomingProductsRow = []; + if (!isset($waybillIncoming[$key]['items'])) { + $waybillIncoming[$key]['items'] = []; + } if (array_key_exists($row['id'], $waybillIncomingProducts)) { $waybillIncomingProductsRow = $waybillIncomingProducts[$row['id']]; } if (!empty($waybillIncomingProductsRow)) { - $waybillIncoming[$key]['items'] = $waybillIncomingProductsRow; + $waybillIncoming[$key]['items'][] = $waybillIncomingProductsRow; } } @@ -404,7 +408,7 @@ class DataController extends BaseController { file_put_contents(self::OUT_DIR . '/log_created_waybill_incoming_error.txt', PHP_EOL . date("d.m.Y H:i:s",time()). $e3->getMessage(). ' file: '. $e3->getFile() . ' line: '. $e3->getLine(), FILE_APPEND); } - return compact('waybillIncoming', 'waybillIncomingIds'); + return compact('waybillIncoming', 'waybillIncomingIds', 'waybillIncomingResult'); } private function getCreateEmployee() : array {