]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-258] убрал пагинацию из таблицы вьюшки, обработал кейс update из index
authorAlexander Smirnov <fredeom@mail.ru>
Fri, 6 Dec 2024 07:48:20 +0000 (10:48 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Fri, 6 Dec 2024 07:48:20 +0000 (10:48 +0300)
erp24/controllers/ShiftTransferController.php
erp24/records/ShiftTransfer.php
erp24/views/shift-transfer/_transfer.php

index d114bf06d343a244882705f060758b70adae87b3..7a99aadf797180217ba60c5f53dd4866ae325e54 100644 (file)
@@ -120,10 +120,6 @@ class ShiftTransferController extends Controller
 
     public function actionUpdate($id = null)
     {
-        if (!Yii::$app->request->isPost) {
-            return $this->redirect('index');
-        }
-
         $shiftTransfer = ShiftTransfer::findOne($id);
 
         if (!$shiftTransfer) {
@@ -175,6 +171,10 @@ class ShiftTransferController extends Controller
                     }
                 }
             }
+        } else {
+            $data = self::buildLoadDataShiftRemains(explode(',', $shiftTransfer->product_groups), $shiftTransfer->store_guid);
+            $productGuids = $data['productGuids'];
+            $shiftTransfer->setGroups();
         }
 
         $isCreate = false;
index 74155c3e292970afc8f5b4a98e81079e47c00431..99691660a7f73b7623b10904453e690a7aa7de77 100644 (file)
@@ -106,10 +106,8 @@ class ShiftTransfer extends \yii\db\ActiveRecord
     }
 
     public function setGroups() {
-        function cb($a) { return $a != 'other_items'; }
-        function cb2($a) { return $a == 'other_items'; }
-        $this->groups1 = array_filter(explode(',', $this->product_groups ?? ''), 'cb');
-        $this->groups2 = array_filter(explode(',', $this->product_groups ?? ''), 'cb2');
+        $this->groups1 = array_filter(explode(',', $this->product_groups ?? ''), function ($a) { return $a != 'other_items'; });
+        $this->groups2 = array_filter(explode(',', $this->product_groups ?? ''), function ($a) { return $a == 'other_items'; });
     }
 
     public function setProductGroups() {
index b07dbc9cd022f76608ff80b6a387246ca5a2e5f5..ab47fc3034e77cf68a8844fee1bbc7ebd8d16943 100644 (file)
@@ -10,7 +10,8 @@ use yii_app\records\ShiftTransfer;
 echo \yii\helpers\Html::label('Таблица фактических остатков');
 echo \kartik\grid\GridView::widget([
     'dataProvider' => new \yii\data\ArrayDataProvider([
-        'allModels' => $shiftTransfer->shiftRemains
+        'allModels' => $shiftTransfer->shiftRemains,
+        'pagination' => false,
     ]),
 //                'showFooter' => true,
     'columns' => [
@@ -93,4 +94,4 @@ echo \kartik\grid\GridView::widget([
     ],
     'layout' => '{items}',
     'showPageSummary' => true,
-]); ?>
\ No newline at end of file
+]); ?>