add reception account state view and pdf export
This commit is contained in:
84
common/components/accountstate/AccountStateWidget.php
Normal file
84
common/components/accountstate/AccountStateWidget.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
namespace common\components\accountstate;
|
||||
use yii\base\Widget;
|
||||
use common\models\AccountState;
|
||||
use yii\data\ArrayDataProvider;
|
||||
use yii\grid\GridView;
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/**
|
||||
* This is the model class for widget display bank notes.
|
||||
*
|
||||
* @property common\models\AccountState $model
|
||||
* */
|
||||
class AccountStateWidget extends Widget{
|
||||
|
||||
public $model;
|
||||
|
||||
|
||||
public function init(){
|
||||
parent::init();
|
||||
}
|
||||
|
||||
public function run(){
|
||||
|
||||
if ($this->model->isTypeOpen() ){
|
||||
$attributes = [
|
||||
[
|
||||
'attribute' =>'account.name',
|
||||
'label' => 'Kassza'
|
||||
],
|
||||
[
|
||||
'attribute' =>'typeName',
|
||||
'label' => 'Típus'
|
||||
],
|
||||
[
|
||||
'attribute' =>'money',
|
||||
'value' => \Yii::$app->formatter->asInteger($this->model->money) ." Ft",
|
||||
],
|
||||
'user.username',
|
||||
[
|
||||
'attribute' => 'created_at',
|
||||
'label' => 'Nyitás ideje'
|
||||
],
|
||||
];
|
||||
}else{
|
||||
|
||||
$attributes = [
|
||||
[
|
||||
'attribute' =>'account.name',
|
||||
'label' => 'Kassza'
|
||||
],
|
||||
[
|
||||
'attribute' =>'typeName',
|
||||
'label' => 'Típus'
|
||||
],
|
||||
[
|
||||
'attribute' =>'money',
|
||||
'value' => \Yii::$app->formatter->asInteger($this->model->money) ." Ft",
|
||||
],
|
||||
'user.username',
|
||||
[
|
||||
'attribute' => 'start_date',
|
||||
'label' => 'Előző nyitás ideje'
|
||||
],
|
||||
[
|
||||
'attribute' => 'created_at',
|
||||
'label' => 'Zárás ideje'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
echo DetailView::widget([
|
||||
'model' => $this->model,
|
||||
'attributes' =>$attributes,
|
||||
]) ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user