'title' => 'Заменяемый товар',
'type' => Select2::class,
'options' => [
- 'class' => 'readonly-select2',
+ 'class' => 'readonly-select2',
'data' => array_merge(
['text' => 'Выберите товар'],
$products
'value' => function ($model) {
return $model->product->name;
},
- 'pageSummary' => 'Итого:',
+ 'pageSummary' => Html::tag('b', 'Итого'),
],
[
'attribute' => 'product_price',
'label' => 'Разница в сумме',
'format' => 'raw',
'pageSummary' => true,
- 'footer' => Html::tag('b', number_format($totalBalance, 2, '.', ' ')),
+ 'footer' => $totalBalance,
],
[
'attribute' => 'updated_at',
[
'label' => 'Цена товара',
'attribute' => 'product_price',
- 'value' => function ($data) {
- return number_format($data['product_price'] ?? '', 2, '.', ' ');
- },
],
[
'label' => 'Сумма',
'attribute' => 'summ',
'pageSummary' => true,
- 'value' => function ($data) {
- return number_format($data['summ'] ?? '', 2, '.', ' ');
- },
- 'footer' => Html::tag('b', 'Недостача: ') . ' ' . Html::tag('b', number_format($writeOffsBalance, 2, '.', ' ')),
+ 'footer' => Html::tag('b', 'Недостача: ') . ' ' . $writeOffsBalance
],
],
'showPageSummary' => true,
[
'label' => 'Цена товара',
'attribute' => 'product_price',
- 'value' => function ($data) {
- return number_format($data['product_price'] ?? '', 2, '.', ' ');
- },
],
[
'label' => 'Сумма',
'attribute' => 'summ',
'pageSummary' => true,
- 'value' => function ($data) {
- return number_format($data['summ'] ?? '', 2, '.', ' ');
- },
- 'footer' => Html::tag('b', 'Излишек: ') . ' ' . Html::tag('b', number_format($incomingBalance, 2, '.', ' ')),
+ 'footer' => Html::tag('b', 'Излишек: ') . ' ' . $incomingBalance,
],
],
'showPageSummary' => true,
'attribute' => 'remains_summ',
'label' => 'Сумма остатков (недостача или излишек), руб',
'pageSummary' => true,
- 'value' => function($data) {
- return number_format($data['remains_summ'] ?? '', 2, '.', ' ');
- },
],
[
'attribute' => 'self_cost',
'label' => 'Себестоимость, руб',
'pageSummary' => true,
- 'value' => function($data) {
- return number_format($data['self_cost'] ?? '', 2, '.', ' ');
- },
],
],
'layout' => '{items}',