]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Правки в контроллере
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 16 Apr 2025 10:55:53 +0000 (13:55 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 16 Apr 2025 10:55:53 +0000 (13:55 +0300)
erp24/controllers/BouquetController.php
erp24/views/bouquet/month-goal.php

index 73e366ea393672fbafacdbbd977fffcf223ab377..314a97207e7b1eabb2e56096379a065737b1d9dc 100644 (file)
@@ -257,9 +257,9 @@ class BouquetController extends Controller
     public function actionMonthGoal()
     {
         $request = Yii::$app->request;
-
-        $month = $request->post('month', 5);
-        $year = $request->post('year', 2025);
+        $post = $request->post();
+        $month = $post['DynamicModel']['month'] ?? 5;
+        $year = $post['DynamicModel']['year'] ?? 2025;
 
         $model = DynamicModel::validateData(
             ['month' => $month, 'year' => $year],
index 88913afb21b5cd72fdea2566f200dc5bef210f84..b030367c38ad212f5058392c27120e867bc7a251 100644 (file)
@@ -25,7 +25,7 @@ $saleTypesLabels = [
     <div class="month-goal-form col-4">
 
         <?php $form = ActiveForm::begin([
-            'action' => Url::to(['your-controller/month-goal']),
+            'action' => Url::to(['bouquet/month-goal']),
             'method' => 'post',
         ]); ?>
 
@@ -114,7 +114,8 @@ $saleTypesLabels = [
                     'columns' => [
                         ['attribute' => 'product_guid',
                             'value' => function ($model, $key, $index, $widget) {
-                                return \yii_app\records\Products1c::find()->where(['id' => $model['product_guid']])->one()->name;
+                                return \yii_app\records\Products1c::find()->where(['id' => $model['product_guid']])->one()->name .
+                                     " (" . $model['product_guid'] . ")";
                             },
                             'label' => 'Product GUID'],
                         ['attribute' => 'bouquet_id',
@@ -128,6 +129,39 @@ $saleTypesLabels = [
                         ['attribute' => 'raw_calculation',  'label' => 'Базовый расчёт'],
                         ['attribute' => 'rounded',          'label' => 'С наценкой за сборку'],
                     ],
+//                    'export' => [
+//                        'fontAwesome' => true
+//                    ],
+//                    'exportConfig' => [
+//                        'html' => [],
+//                        'csv' => [
+//                                'label' => Yii::t('kvgrid', 'CSV'),
+//                            'icon' => '',
+//                            'iconOptions' => ['class' => 'text-primary'],
+//                            'showHeader' => true,
+//                            'showPageSummary' => true,
+//                            'showFooter' => true,
+//                            'showCaption' => true,
+//                            'filename' => Yii::t('kvgrid', 'grid-export'),
+//                            'alertMsg' => Yii::t('kvgrid', 'The CSV export file will be generated for download.'),
+//                            'options' => ['title' => Yii::t('kvgrid', 'Comma Separated Values')],
+//                            'mime' => 'application/csv',
+//                            'config' => [
+//                                'colDelimiter' => ",",
+//                                'rowDelimiter' => "\r\n",
+//                                ],
+//                            ],
+//                        'txt' => [],
+//                        'xls' => [],
+//                        'pdf' => [],
+//                        'json' => [],
+//                    ],
+//                    'panel' => [
+//                        'after' => '',
+//                        'heading' =>  Html::encode($storesMap[$storeId] ?? $storeId) ,
+//                        'type' => 'primary',
+//                        'before' => '',
+//                    ],
                 ]) ?>
             <?php endforeach; ?>
         <?php endforeach; ?>