]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Добавляем цену
authorvladfo <fvv2011@gmail.com>
Fri, 11 Oct 2024 13:34:20 +0000 (16:34 +0300)
committervladfo <fvv2011@gmail.com>
Fri, 11 Oct 2024 13:34:20 +0000 (16:34 +0300)
erp24/services/MotivationService.php
erp24/views/motivation/test-self-cost.php

index 6e2589f7447221359f90eaff57158f25de47be13..371b30ef1167fd391a309cd45cba10ccb468e1f6 100644 (file)
@@ -1960,10 +1960,10 @@ class MotivationService
 
         // Находим товары, проданные в выбранных продажах
         $salesProducts = SalesProducts::find()
-            ->select(['check_id', 'product_id', 'quantity'])
+            ->select(['check_id', 'product_id', 'quantity', 'price'])
             ->where(['check_id' => $salesIds])
             //->andWhere(['type_id' => 1])
-                ->andWhere(['>', 'price',  '0'  ])
+            //    ->andWhere(['>', 'price',  '0'  ])
             ->asArray()
             ->all();
 
@@ -2006,6 +2006,7 @@ class MotivationService
                 'date' => $checkDate,
                 'quantity' => $quantity,
                 'check_id' => $product['check_id'],
+                'm_price' => $product['price'],
             ];
         }
 
index 0ba5d0d8b4c5c8ba6a4d6e80e554c83a26e47fa2..8e0180ec18f88c9465c875cb1dabbf1b9072352e 100644 (file)
@@ -47,6 +47,7 @@ $this->title = 'Себестоимость товаров по магазина
                 <th>ID товара</th>
                 <th>ID чека</th>
                 <th>Название</th>
+                <th>Себестоимость</th>
                 <th>Цена</th>
                 <th>Кол-во</th>
                 <th>Дата</th>
@@ -59,6 +60,7 @@ $this->title = 'Себестоимость товаров по магазина
                     <td><?= Html::encode($item['check_id']) ?></td>
                     <td><?= Html::encode($item['product_name']) ?></td>
                     <td><?= Html::encode($item['price']) ?></td>
+                    <td><?= Html::encode($item['m_price']) ?></td>
                     <td><?= Html::encode($item['quantity']) ?></td>
                     <td><?= Html::encode($item['date']) ?></td>
                 </tr>