From: Alexander Smirnov Date: Fri, 6 Dec 2024 07:48:20 +0000 (+0300) Subject: [ERP-258] убрал пагинацию из таблицы вьюшки, обработал кейс update из index X-Git-Tag: 1.7~189^2~2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=e13734a9b055b9bece986ee52fd26bdb6acc7b94;p=erp24_rep%2Fyii-erp24%2F.git [ERP-258] убрал пагинацию из таблицы вьюшки, обработал кейс update из index --- diff --git a/erp24/controllers/ShiftTransferController.php b/erp24/controllers/ShiftTransferController.php index d114bf06..7a99aadf 100644 --- a/erp24/controllers/ShiftTransferController.php +++ b/erp24/controllers/ShiftTransferController.php @@ -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; diff --git a/erp24/records/ShiftTransfer.php b/erp24/records/ShiftTransfer.php index 74155c3e..99691660 100644 --- a/erp24/records/ShiftTransfer.php +++ b/erp24/records/ShiftTransfer.php @@ -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() { diff --git a/erp24/views/shift-transfer/_transfer.php b/erp24/views/shift-transfer/_transfer.php index b07dbc9c..ab47fc30 100644 --- a/erp24/views/shift-transfer/_transfer.php +++ b/erp24/views/shift-transfer/_transfer.php @@ -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 +]); ?>