public function actionUpdate($id = null)
{
- if (!Yii::$app->request->isPost) {
- return $this->redirect('index');
- }
-
$shiftTransfer = ShiftTransfer::findOne($id);
if (!$shiftTransfer) {
}
}
}
+ } else {
+ $data = self::buildLoadDataShiftRemains(explode(',', $shiftTransfer->product_groups), $shiftTransfer->store_guid);
+ $productGuids = $data['productGuids'];
+ $shiftTransfer->setGroups();
}
$isCreate = false;
}
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() {
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' => [
],
'layout' => '{items}',
'showPageSummary' => true,
-]); ?>
\ No newline at end of file
+]); ?>