]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Вычисление средней цены
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 9 Apr 2025 07:16:14 +0000 (10:16 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 9 Apr 2025 07:16:14 +0000 (10:16 +0300)
erp24/services/StorePlanService.php

index 2ffb6b3e7f9e6c1bcf025be089c213e70cd2f729..b1ed5cbebcb05c745039739abf16c18096cc617d 100755 (executable)
@@ -477,10 +477,10 @@ class StorePlanService
 
         if (!empty($priceRecords)) {
             $totalPrice = 0;
-            $records = ArrayHelper::getColumn((array)$priceRecords, 'price');
+            $records = ArrayHelper::toArray($priceRecords);
             $count = count($records);
             foreach ($priceRecords as $record) {
-                if ($record->price) {
+                if (isset($record->price)) {
                     $totalPrice += $record->price;
                 }
             }