add reception account state view and pdf export

This commit is contained in:
2016-01-08 14:06:55 +01:00
parent da29702a79
commit e8df61f123
30 changed files with 1190 additions and 288 deletions

View File

@@ -0,0 +1,21 @@
<?php
namespace common\components\total;
use yii\base\Widget;
class TotalBaseWidget extends Widget{
public $dailyListing;
public $viewPath = '@common/views/total';
public $viewFile = 'totaleasy.php';
public $view;
public function init(){
$this->view = $this->viewPath . "/" . $this->viewFile;
}
public function run(){
echo $this->render($this->view,[ 'model' => $this->dailyListing ]);
}
}

View File

@@ -0,0 +1,9 @@
<?php
namespace common\components\total;
class TotalDetailedMoneyMovementWidget extends TotalBaseWidget{
public $viewFile = 'total_detailed_money_movement.php';
}

View File

@@ -0,0 +1,9 @@
<?php
namespace common\components\total;
class TotalDetailedProductsWidget extends TotalBaseWidget{
public $viewFile = 'total_detailed_product.php';
}

View File

@@ -0,0 +1,9 @@
<?php
namespace common\components\total;
class TotalDetailedTicketsWidget extends TotalBaseWidget{
public $viewFile = 'total_detailed_ticket.php';
}

View 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;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace common\components\total;
use yii\base\Widget;
class TotalEasyWidget extends Widget{
public $dailyListing;
public $viewPath = '@common/views/total';
public $viewFile = 'totaleasy.php';
public $view;
public function init(){
$this->view = $this->viewPath . "/" . $this->viewFile;
}
public function run(){
echo $this->render($this->view,[ 'model' => $this->dailyListing ]);
}
}

View File

@@ -0,0 +1,9 @@
<?php
namespace common\components\total;
class TotalMediumMoneyMovementsWidget extends TotalBaseWidget{
public $viewFile = 'total_medium_money_movement.php';
}

View File

@@ -0,0 +1,9 @@
<?php
namespace common\components\total;
class TotalMediumProductsWidget extends TotalBaseWidget{
public $viewFile = 'total_medium_product.php';
}

View File

@@ -0,0 +1,9 @@
<?php
namespace common\components\total;
class TotalMediumTicketsWidget extends TotalBaseWidget{
public $viewFile = 'total_medium_ticket.php';
}