]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-243 Действия по замене (II этап)
authormarina <m.zozirova@gmail.com>
Fri, 29 Nov 2024 16:03:50 +0000 (19:03 +0300)
committermarina <m.zozirova@gmail.com>
Fri, 29 Nov 2024 16:03:50 +0000 (19:03 +0300)
erp24/views/shift-transfer/_transfer.php

index 61b2b7ee81c56f77174fc3566b15e44f01dc2281..65bddbcae4e78ddee970e4aa317045995d6fe4d1 100644 (file)
@@ -3,36 +3,34 @@
 use yii\helpers\ArrayHelper;
 use yii_app\records\Products1c;
 use yii_app\records\ProductsClass;
+use yii_app\records\ShiftTransfer;
 
-?>
-<?= \kartik\grid\GridView::widget([
+/* @var $shiftTransfer ShiftTransfer */
+
+echo \kartik\grid\GridView::widget([
     'dataProvider' => new \yii\data\ArrayDataProvider([
         'allModels' => $shiftTransfer->shiftRemains
     ]),
 //                'showFooter' => true,
     'columns' => [
-        [
-            'attribute'  => 'group_label',
-            'label' => 'Название группы',
-//                        'footer' => 'Итого:',
-            'pageSummary' => 'Итого:',
-            'value' => function($data) {
-                return ProductsClass::getHints()[$data['group_label']] ?? '';
-            },
-        ],
         [
             'attribute'  => 'product_guid',
             'label' => 'Продукт',
+            'pageSummary' => 'Итого:',
             'value' => function($data) {
-                $productsClass = ProductsClass::find()->select('category_id')
-                    ->where(['tip' => $data['group_label'] ?? null])->column();
-
                 $products = ArrayHelper::map(Products1c::find()->select(['id', 'name'])
-                    ->where(['parent_id' => $productsClass])->all(), 'id', 'name');
+                    ->where(['id' => $data['product_guid']])->all(), 'id', 'name');
 
                 return $products[$data['product_guid']] ?? '';
             },
         ],
+        [
+            'attribute'  => 'group_label',
+            'label' => 'Название группы',
+            'value' => function($data) {
+                return ProductsClass::getHints()[$data['group_label']] ?? '';
+            },
+        ],
         [
             'attribute'  => 'retail_price',
             'label' => 'Розничная цена, руб',