$this->registerJsFile('/js/sales-write-offs-plan/index.js', ['position' => \yii\web\View::POS_END]);
+$this->registerCss('
+input[type=number], [name=total_sales_plan] {
+ max-width: 100px;
+}
+');
+
function colorScheme1($p) {
$p = round(100 * $p);
if ($p <= 90) { return 'red'; }
<?php ActiveForm::end() ?>
+ <div class="table-responsive">
<table id="storePlans">
<thead>
<tr><th rowspan="3" class="text-center align-middle border">Магазины</th><th colspan="4" class="text-center border">Total</th><th colspan="2" class="text-center border">Оффлайн торговля</th><th colspan="4" class="text-center border">Онлайн торговля</th></tr>
?>
<tr>
<td><?= $store->name ?><?= Html::hiddenInput('store_id', $store->id) ?></td>
- <td><?= Html::textInput('total_sales_plan', $total_sales_plan, ['type' => 'number', 'readonly' => true]) ?></td>
+ <td><?= Html::textInput('total_sales_plan', $total_sales_plan, ['readonly' => true, 'style' => 'background: lightgray;']) ?></td>
<td>
<?= Html::hiddenInput('total_sales_fact', $total_sales_fact) ?>
<span style="color:<?= colorScheme1($p1) ?>">
<?= number_format(round($p1 * 100), 0, '.', ' ') ?>
</span>%
</td>
- <td><?= Html::textInput('write_offs_plan', $write_offs_plan, ['type' => 'number', 'onchange' => 'editField(this);']) ?></td>
+ <td><?= Html::textInput('write_offs_plan', $write_offs_plan, ['type' => 'number', 'min' => 0, 'onchange' => 'editField(this);']) ?></td>
<td>
<span style="color:<?= colorScheme2($p2) ?>">
<?= number_format(round($p2 * 100), 1, '.', ' ') ?>
</span>%
</td>
- <td><?= Html::textInput('offline_sales_plan', $offline_sales_plan, ['type' => 'number', 'onchange' => 'editField(this);']) ?></td>
+ <td><?= Html::textInput('offline_sales_plan', $offline_sales_plan, ['type' => 'number', 'min' => 0, 'onchange' => 'editField(this);']) ?></td>
<td>
<span style="color:<?= colorScheme1($p3) ?>">
<?= number_format(round($p3 * 100), 0, '.', ' ') ?>
</span>%
</td>
- <td><?= Html::textInput('online_sales_shop_plan', $online_sales_shop_plan, ['type' => 'number', 'onchange' => 'editField(this);']) ?></td>
+ <td><?= Html::textInput('online_sales_shop_plan', $online_sales_shop_plan, ['type' => 'number', 'min' => 0, 'onchange' => 'editField(this);']) ?></td>
<td>
<span style="color:<?= colorScheme1($p4) ?>">
<?= number_format(round($p4 * 100), 0, '.', ' ') ?>
</span>%
</td>
- <td><?= Html::textInput('online_sales_marketplace_plan', $online_sales_marketplace_plan, ['type' => 'number', 'onchange' => 'editField(this);']) ?></td>
+ <td><?= Html::textInput('online_sales_marketplace_plan', $online_sales_marketplace_plan, ['type' => 'number', 'min' => 0, 'onchange' => 'editField(this);']) ?></td>
<td>
<span style="color:<?= colorScheme1($p5) ?>">
<?= number_format(round($p5 * 100), 0, '.', ' ') ?>
<?php endforeach; ?>
</tbody>
</table>
+ </div>
</div>