<?php

use yii\helpers\Html;
use backend\assets\ProcurementCreateAsset;
use yii\helpers\Url;


/* @var $this yii\web\View */
/* @var $model common\models\Procurement */
/* @var $warehouses common\models\Warehouse[] */

$this->title = Yii::t('common/procurement', 'Create Procurement');
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/procurement', 'Procurements'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;

ProcurementCreateAsset::register($this);

$options = [];
$options['products'] = $products;
$options['url_product_find'] = Url::toRoute(['product/find']);

$this->registerJs(' new ProcurementCreate( '. json_encode($options) .' );');

?>
<div class="procurement-create">

    <h1><?= Html::encode($this->title) ?></h1>
    
    <div class="row">
    	<div class="col-md-6">
		    <table class="table table-striped">
		    	<tr>
		    		<th>Terméknév</th>
		    		<td class="product-name"></td>
		    	</tr>
		    	<tr>
		    		<th>Mennyiség</th>
		    		<td class="product-stock"></td>
		    	</tr>
		    	<tr>
		    		<th>Termék kategória</th>
		    		<td class="product-category"></td>
		    	</tr>
		    </table>
    	</div>
    </div>

    <?= $this->render('_form', [
        'model' => $model,
    	'warehouses' => $warehouses,
    	'accounts' => $accounts
    ]) ?>

</div>
