add reception account state view and pdf export
This commit is contained in:
68
common/components/total/TotalDifferenceWidget.php
Normal file
68
common/components/total/TotalDifferenceWidget.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
namespace common\components\total;
|
||||
|
||||
use yii\base\Widget;
|
||||
use yii\widgets\DetailView;
|
||||
|
||||
/**
|
||||
* Display account state difference information widget
|
||||
*
|
||||
*
|
||||
* @property common\models\AccountState $model
|
||||
*
|
||||
* */
|
||||
class TotalDifferenceWidget extends Widget{
|
||||
|
||||
|
||||
public $model;
|
||||
|
||||
|
||||
public function run(){
|
||||
return $this->generateDifference();
|
||||
}
|
||||
|
||||
protected function generateDifference(){
|
||||
$s = "";
|
||||
if ( $this->model->hasDifferenceToPrevState()){
|
||||
|
||||
$ft = " Ft";
|
||||
$s .= DetailView::widget([
|
||||
'model' => $this->model,
|
||||
'template' =>"<tr><th>{label}</th><td style='text-align: right;'>{value} </td></tr>",
|
||||
'attributes' => [
|
||||
[
|
||||
'label' => "Előző nyitás ideje",
|
||||
'value' => $this->model->prevObject ? \Yii::$app->formatter->asDatetime( $this->model->prevObject->created_at) : "-",
|
||||
],
|
||||
[
|
||||
'label' => "Előzőleg nyitott",
|
||||
'value' => $this->model->prevObject ? $this->model->user->username : "-",
|
||||
],
|
||||
[
|
||||
'label' => "Előző nyitás összege",
|
||||
'value' => $this->model->prev_money.$ft
|
||||
],
|
||||
[
|
||||
'label' => "Bevételek összesen előző nyitás óta",
|
||||
'value' => $this->model->collection_money .$ft
|
||||
],
|
||||
[
|
||||
'label' => "Zárás összege",
|
||||
'value' => $this->model->money.$ft
|
||||
],
|
||||
[
|
||||
'label' => "Várt összeg",
|
||||
'value' => $this->model->expected.$ft
|
||||
],
|
||||
[
|
||||
'label' => "Különbözet",
|
||||
'value' => $this->model->signedDiff.$ft
|
||||
],
|
||||
]
|
||||
]);
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user