$storeId = array_flip(array_map('strval', CityStore::getAllActiveGuidId()))[$shiftTransfer->store_guid];
$productSelfCost = SelfCostProduct::findOne(['product_guid' => $productGuid, 'date' => $shiftTransfer->date, 'store_id' => $storeId]);
-
if (!$productPrice) {
throw new \Exception('У данного товара нет цены либо замен!');
}
'change' => new \yii\web\JsExpression('function() { setProductData.call(this); }'),
],
],
- 'value' => function ($data) {
- return $data['product_id'] ?? '';
+ 'value' => function ($model) {
+ return $model->product->name ?? '';
},
],
}'),
],
],
- 'value' => function ($data) {
- return $data['product_replacement_id'] ?? '';
+ 'value' => function ($model) {
+ return $model->productReplacement->name ?? '';
},
],
[
} else {
echo GridView::widget([
'dataProvider' => new ArrayDataProvider([
- 'allModels' => $shiftTransfer->equalizationRemains, // Данные для таблицы
+ 'allModels' => $shiftTransfer->equalizationRemains,
]),
'columns' => [
[
}
],
],
- 'showPageSummary' => true, // Показывать итоговые данные
- 'summary' => 'Показано {begin} - {end} из {totalCount} записей', // Настройка вывода суммы
- 'footerRowOptions' => ['class' => 'footer-row'], // Стили для итоговой строки
- 'rowOptions' => function ($model, $key, $index, $grid) {
- // Дополнительные настройки для строк, если нужно
- return [];
- },
+ 'showPageSummary' => true,
+ 'summary' => 'Показано {begin} - {end} из {totalCount} записей',
+ 'footerRowOptions' => ['class' => 'footer-row'],
]);
if (Yii::$app->user->id === $shiftTransfer->end_shift_admin_id && $shiftTransfer->status_id === ShiftTransfer::STATUS_ID_READY_TO_ACCEPT) {