add reception collection basics

This commit is contained in:
2015-11-03 17:27:14 +01:00
parent 33bf52df60
commit 931b83040b
12 changed files with 385 additions and 26 deletions

View File

@@ -0,0 +1,50 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use frontend\components\HtmlHelper;
/* @var $this yii\web\View */
/* @var $model common\models\Collection */
$this->title = Yii::t('frontend/collection', 'Create Collection - Select Account');
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/collection', 'Collections'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
$accountOptions = HtmlHelper::mkAccountOptions($model->accounts);
?>
<div class="collection-create select-account">
<h1><?= Html::encode($this->title) ?></h1>
<div class="collection-form">
<?php $form = ActiveForm::begin(
[
'method' => 'post',
'action' => ['collection/select-account'],
]
); ?>
<div class="row">
<div class="col-md-4">
<?= $form->field($model, 'id_account')->dropDownList($accountOptions) ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton( Yii::t('frontend/collection', 'Next') ,['class' =>'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
</div>

View File

@@ -2,26 +2,23 @@
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use frontend\components\HtmlHelper;
/* @var $this yii\web\View */
/* @var $model common\models\Collection */
/* @var $form yii\widgets\ActiveForm */
?>
<?php
?>
<div class="collection-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id_account')->textInput() ?>
<?= $form->field($model, 'money')->textInput() ?>
<?= $form->field($model, 'start')->textInput() ?>
<?= $form->field($model, 'end')->textInput() ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('frontend/collection', 'Create') : Yii::t('frontend/collection', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>

View File

@@ -1,6 +1,7 @@
<?php
use yii\helpers\Html;
use frontend\components\TransferTotalWidget;
/* @var $this yii\web\View */
@@ -15,13 +16,41 @@ $this->params['breadcrumbs'][] = $this->title;
<h1><?= Html::encode($this->title) ?></h1>
<dl class='dl-horizontal'>
<dt>Utolsó zárás</dt>
<dd>asdf</dd>
<dt></dt>
<dd></dd>
<dt></dt>
<dd></dd>
</dl>
<dt><?= Yii::t('frontend/collection', "Last collection")?></dt>
<dd><?php echo isset($model->lastCollection) ? Yii::$app->formatter->asDatetime($model->lastCollection->end) : Yii::t('frontend/collection', "No collection found") ?></dd>
<dt><?= Yii::t('frontend/collection', "Start of interval")?></dt>
<dd><?php echo Yii::$app->formatter->asDatetime($model->start) ?></dd>
<dt><?= Yii::t('frontend/collection', "End of interval")?></dt>
<dd><?php echo Yii::$app->formatter->asDatetime($model->end) ?></dd>
</dl>
<?php
echo TransferTotalWidget::widget([
'options' => [
'statistic' => $model->totals['paid_at'],
'panelHeading' => 'Fizetve' ,
]
]);
echo TransferTotalWidget::widget([
'options' => [
'statistic' => $model->totals['created_at'],
'panelHeading' => 'Kiadva',
]
]);
echo TransferTotalWidget::widget([
'options' => [
'statistic' => $model->totals['created_at_paid'],
'panelHeading' => 'Kiadva és fizetve',
]
]);
?>
<?= $this->render('_form', [
'model' => $model,

View File

@@ -16,7 +16,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a(Yii::t('frontend/collection', 'Create Collection'), ['create'], ['class' => 'btn btn-success']) ?>
<?= Html::a(Yii::t('frontend/collection', 'Create Collection'), ['select-account'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([