add reception account state view and pdf export
This commit is contained in:
@@ -9,7 +9,14 @@ use yii\grid\GridView;
|
||||
use yii\base\Object;
|
||||
use yii\data\ArrayDataProvider;
|
||||
use yii\helpers\Url;
|
||||
use common\components\total\TotalDifferenceWidget;
|
||||
|
||||
/**
|
||||
* Display account state widget
|
||||
*
|
||||
* @property common\models\AccountState $model the account state object
|
||||
* @property int $index the current index in the list
|
||||
* */
|
||||
class AccountStateBanknoteCountWidget extends Widget{
|
||||
|
||||
public $model;
|
||||
@@ -37,53 +44,27 @@ class AccountStateBanknoteCountWidget extends Widget{
|
||||
|
||||
|
||||
$s .= $this->generateInfoRow();
|
||||
$s .= $this->generateNotes();
|
||||
|
||||
// $s .= $this->generateNotes();
|
||||
|
||||
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 utolsó 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
|
||||
],
|
||||
]
|
||||
]);
|
||||
$s .= "<h3>Különbözet</h3>";
|
||||
$s .= TotalDifferenceWidget::widget(['model' => $this->model]);
|
||||
}
|
||||
|
||||
|
||||
$s .= $this->generateComment();
|
||||
|
||||
$s .= Html::beginTag("div", ['class' => 'row', 'style' => 'margin-top: 6px;']);
|
||||
$s .= Html::beginTag("div", ['class' => 'col-md-12 text-right']);
|
||||
|
||||
$s .= Html::a('<span class="glyphicon glyphicon-trash"></span>Törlés', Url::toRoute(['delete','id' =>$this->model->id_account_state]), [
|
||||
$s .= Html::a( Html::tag("span","",['class' =>'glyphicon glyphicon-download-alt']) ." Pdf", Url::to([ 'view', 'id' =>$this->model->id_account_state, 'output' =>'pdf']) ,['class' => 'btn btn-primary btn-pdf','style' =>'margin-bottom: 12px; margin-right: 6px;']);
|
||||
|
||||
$s .= Html::a('<span class="glyphicon glyphicon-eye-open"></span> Részletek', Url::toRoute(['view','id' =>$this->model->id_account_state]), [
|
||||
'title' => 'Részletek',
|
||||
'class' => 'btn btn-success',
|
||||
'style' =>'margin-bottom: 12px; margin-right: 6px;'
|
||||
]);
|
||||
$s .= Html::a('<span class="glyphicon glyphicon-trash"></span> Törlés', Url::toRoute(['delete','id' =>$this->model->id_account_state]), [
|
||||
'title' => \Yii::t('yii', 'Delete'),
|
||||
'data-confirm' =>\Yii::t('yii', 'Are you sure to delete this item?'),
|
||||
'data-method' => 'post',
|
||||
|
||||
Reference in New Issue
Block a user