$incomingBalance = \yii_app\records\WaybillIncoming::findOne(['shift_transfer_id' => $shiftTransfer->id])->summ ?? 0;
$form = \yii\widgets\ActiveForm::begin(); ?>
- ?>
<div class="row py-2">
<div class="col-2">
<?= Html::label('Таблица замен', null, ['class' => 'h4 font-weight-bold']); ?>
],
[
'name' => 'product_price',
- 'type' => BaseColumn::TYPE_TEXT_INPUT,
- 'options' => ['type' => 'number', 'step' => 0.01, 'readonly' => true,],
+ 'type' => BaseColumn::TYPE_TEXT_INPUT, // Если это верно, оставляем так.
+ 'options' => ['type' => 'number', 'step' => 0.01, 'readonly' => true],
'title' => 'Цена товара',
'value' => function ($data) {
- return $data['product_price'] ?? '';
+ return isset($data['product_price']) ? $data['product_price'] : '';
},
],
[
'name' => 'product_self_cost',
- 'type' => BaseColumn::TYPE_TEXT_INPUT,
- 'options' => ['type' => 'number', 'step' => 0.01, 'readonly' => true,],
+ 'type' => BaseColumn::TYPE_HIDDEN_INPUT,
+ 'options' => ['step' => 0.01, 'readonly' => true,],
'title' => 'Себестоимость товара',
'value' => function ($data) {
return $data['product_self_cost'] ?? '';
'name' => 'product_count',
'type' => BaseColumn::TYPE_TEXT_INPUT,
'options' => ['type' => 'number', 'step' => 1, 'readonly' => true,],
- 'title' => 'Ð\9aоличество',
+ 'title' => 'Ð\9dеобÑ\85одимое количество',
'value' => function ($data) {
- return $data['product_count'] ?? '';
+ return !empty($data) ? abs($data['product_count']) : '';
}
],
[
],
[
'name' => 'product_replacement_self_cost',
- 'type' => BaseColumn::TYPE_TEXT_INPUT,
- 'options' => ['type' => 'number', 'step' => 0.01, 'readonly' => true,],
+ 'type' => BaseColumn::TYPE_HIDDEN_INPUT,
+ 'options' => ['step' => 0.01, 'readonly' => true,],
'title' => 'Себестоимость замещаемого товара',
'value' => function ($data) {
return $data['product_replacement_self_cost'] ?? '';
[
'name' => 'balance_self_cost',
'title' => 'Разница в сумме (Себестоиомость)',
- 'type' => BaseColumn::TYPE_TEXT_INPUT,
- 'options' => ['type' => 'number', 'step' => 0.01, 'readonly' => true,],
+ 'type' => BaseColumn::TYPE_HIDDEN_INPUT,
+ 'options' => ['step' => 0.01, 'readonly' => true,],
'value' => function ($data) {
return $data['balance_self_cost'] ?? '';
},