add indexes, add messagedetsta
This commit is contained in:
85
backend/views/product/_search_statistics.php
Normal file
85
backend/views/product/_search_statistics.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use common\models\Product;
|
||||
use common\models\ProductCategory;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use common\models\Account;
|
||||
use kartik\widgets\DateTimePicker;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\ProductSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
<?php
|
||||
|
||||
function mkOptions($options){
|
||||
$o = $options;
|
||||
$o[''] = Yii::t('common/product','All' ) ;
|
||||
return $o;
|
||||
}
|
||||
|
||||
$statusOptions = ['' => "Mind"] + ( Product::statuses() );
|
||||
|
||||
$productCategories = ['' => "Mind"] + ArrayHelper::map( ProductCategory::read(null) ,'id_product_category','name') ;
|
||||
|
||||
$accounts = ['' => "Mind"] + ( ArrayHelper::map( Account::read(null) ,'id_account','name'));
|
||||
|
||||
?>
|
||||
<div class="product-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
'action' => ['product/statistics'],
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'id_product_category')->dropDownList($productCategories) ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'id_account')->dropDownList($accounts) ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?php // echo $form->field($model, 'status')->dropDownList($statusOptions) ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'name')->label("Terméknév") ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'barcode') ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'product_number') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'start')->widget(DateTimePicker::classname(), [
|
||||
'pluginOptions' => [
|
||||
'autoclose'=>true,
|
||||
'format' => 'yyyy.mm.dd hh:ii'
|
||||
]
|
||||
])->label("Időszak kezdete (inklúzív)") ?>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'end') ->widget(DateTimePicker::classname(), [
|
||||
'pluginOptions' => [
|
||||
'autoclose'=>true,
|
||||
'format' => 'yyyy.mm.dd hh:ii'
|
||||
]
|
||||
])->label("Időszak vége (exklúzív)") ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton(Yii::t('common/product', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
64
backend/views/product/statistics.php
Normal file
64
backend/views/product/statistics.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use yii\helpers\Url;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel backend\models\ProductSearch */
|
||||
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||
|
||||
$this->title = Yii::t('common/product', 'Products');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="product-index">
|
||||
|
||||
<h1><?php echo "Termék eladás statisztika" ?></h1>
|
||||
<?php echo $this->render('_search_statistics', ['model' => $searchModel]); ?>
|
||||
|
||||
<?php
|
||||
$params = [];
|
||||
$params[ Html::getInputName($searchModel, 'output')] = "xls";
|
||||
echo Html::a("XLS", Url::current($params), ['class' => 'btn btn-primary'] );
|
||||
|
||||
?>
|
||||
<?= GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'columns' => [
|
||||
[
|
||||
'attribute' => 'product_name',
|
||||
'label' => 'Terméknév',
|
||||
],
|
||||
[
|
||||
'attribute' => 'product_number',
|
||||
'label' => 'Termékszám',
|
||||
],
|
||||
[
|
||||
'attribute' => 'product_barcode',
|
||||
'label' => 'Vonalkód',
|
||||
],
|
||||
[
|
||||
'attribute' => 'father_account_name',
|
||||
'label' => 'Termék kassza',
|
||||
],
|
||||
// [
|
||||
// 'attribute' => 'account_name',
|
||||
// 'label' => 'Fizetési kassza',
|
||||
// ],
|
||||
[
|
||||
'attribute' => 'product_sale_price',
|
||||
'label' => 'Eladási ár',
|
||||
],
|
||||
[
|
||||
'attribute' => 'transfer_count',
|
||||
'label' => 'Eladott mennyiség',
|
||||
],
|
||||
[
|
||||
'attribute' => 'transfer_money',
|
||||
'label' => 'Eladás összege',
|
||||
],
|
||||
|
||||
],
|
||||
]); ?>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user