<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model common\models\InventoryItem */

$this->title = Yii::t('common/inventory-item', 'Leltár termék');
$this->params['breadcrumbs'][] = ['label' => 'Leltár lista', 'url' => ['inventory/index']];
$this->params['breadcrumbs'][] = ['label' => 'Leltár', 'url' => ['inventory-item/index', 'id' => $model->id_inventory ]];
$this->params['breadcrumbs'][] = Yii::t('common/inventory-item', 'Update');
?>
<div class="inventory-item-update">

    <h1><?= Html::encode($this->title) ?></h1>

	<h2>Leltár</h2>
		    <?= DetailView::widget([
        'model' => $inventory,
        'attributes' => [
            'id_inventory',
        		'name',
            ['attribute'=>'id_user',
            'value'=>$inventory->userName
    ],
            ['attribute'=>'id_account',
            'value'=>$inventory->accountName
    ],
            'created_at:datetime',
        ],
    ]) ?>

	<h2>Termék</h2>
	 <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
        		[
        				
        		'value' => $model->name,
        		'label' =>"Név"
	 			],
        		[
        			'value' => $model->count_system,
        			'label' => 'Rendszer szerinti mennyiség (db)',
	 			],
        		[
        			'value' => $model->count,
        			'label' => 'Leltározott mennyiség (db)',
	 			],
        		[
        			'value' => $model->count_prev,
        			'label' => 'Előző leltár (db)',
	 			],
        		[
        			'value' => $model->count_in,
        			'label' => 'Beszerzett mennyiség (db)',
	 			],
        		[
        			'value' => $model->count_sold,
        			'label' => 'Eladott mennyiség (db)',
	 			],
        		[
        			'value' => $model->getDifference(),
        			'label' => 'Különbség',
	 			],
        		[
        			'value' => '',
        			'label' => '',
	 			],
        		 
        	 
        		 
        ],
    ]) ?>
	
    <?= $this->render('_form', [
        'model' => $model,
    ]) ?>

</div>
