add inventory admin fix, add procurement update

This commit is contained in:
2016-03-30 20:04:49 +02:00
parent 19761cb0cc
commit a12b87d3be
22 changed files with 853 additions and 245 deletions

View File

@@ -33,14 +33,24 @@ $this->registerJs('inventoryItemIndex.init( '. json_encode($options) .' );');
'name',
['attribute'=>'id_user',
'value'=>$model->userName
],
],
['attribute'=>'id_account',
'value'=>$model->accountName
],
['attribute'=>'status',
'value'=>$model->getStatusHuman(),
'label' => "Állapot"
],
'created_at:datetime',
],
]) ?>
<?php
if ( $model->isOpen()){
echo Html::a("Lezárás",['inventory/close' , 'id' => $model->id_inventory ] ,['data-method' =>'post', 'class' => 'btn btn-danger']);
}
?>
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
@@ -74,9 +84,8 @@ $this->registerJs('inventoryItemIndex.init( '. json_encode($options) .' );');
</p>
<?php
echo GridView::widget( [
'dataProvider' => $dataProvider,
'columns' =>[
$columns = [
[
'attribute' => 'item_created_at',
'label' => 'Létrehozva',
@@ -96,6 +105,16 @@ $this->registerJs('inventoryItemIndex.init( '. json_encode($options) .' );');
'attribute' => 'inventory_prev_name',
'label' => 'Utolsó leltár'
],
[
'attribute' => 'item_count_system',
'label' => 'Rendszer szerinti mennyiség (db)',
],
[
'attribute' => 'item_count',
'label' => 'Leltározott mennyiség (db)',
],
[
'attribute' => 'item_count_prev',
@@ -111,24 +130,20 @@ $this->registerJs('inventoryItemIndex.init( '. json_encode($options) .' );');
'attribute' => 'item_count_sold',
'label' => 'Eladott mennyiség (db)',
],
[
'attribute' => 'item_count',
'label' => 'Leltározott mennyiség (db)',
],
[
'attribute' => 'item_count_system',
'label' => 'Rendszer szerinti mennyiség (db)',
],
[
'attribute' => 'item_difference',
'label' => 'Különbség (db)',
],
['class' => 'yii\grid\ActionColumn',
'template' => '',
];
if ( $model->isOpen() ){
$columns[] = ['class' => 'yii\grid\ActionColumn',
'template' => '{update}',
'urlCreator' => function ($action, $model, $key, $index){
return Url::to(['inventory-item/update', 'id' => $model['item_id_inventory_item' ] ]) ;
},
@@ -141,8 +156,14 @@ $this->registerJs('inventoryItemIndex.init( '. json_encode($options) .' );');
}
]
]
]
] ;
}
echo GridView::widget( [
'dataProvider' => $dataProvider,
'columns' => $columns
]);
?>

View File

@@ -17,7 +17,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?php //echo Html::a(Yii::t('common/inventory', 'Új leltár'), ['create'], ['class' => 'btn btn-success']) ?>
<?php echo Html::a(Yii::t('common/inventory', 'Új leltár'), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
@@ -28,6 +28,7 @@ $this->params['breadcrumbs'][] = $this->title;
'name',
[ 'attribute' => 'id_user', "value" =>"userName" ],
'created_at:datetime',
[ 'attribute' => 'status', "value" =>"statusHuman" ],
['class' => 'yii\grid\ActionColumn',
'template' => '{view}',

View File

@@ -0,0 +1,34 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
/* @var $this yii\web\View */
/* @var $model common\models\Procurement */
/* @var $warehouses common\models\Warehouse[] */
/* @var $form yii\widgets\ActiveForm */
?>
<?php
?>
<div class="procurement-form">
<?php $form = ActiveForm::begin(); ?>
<?php // echo $form->field($model, 'id_account')->dropDownList($accountsOptions)->label('Kassza') ?>
<?= $form->field($model, 'count')->textInput() ?>
<?= $form->field($model, 'purchase_price')->textInput() ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/procurement', 'Create') : Yii::t('common/procurement', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -48,7 +48,15 @@ $this->params['breadcrumbs'][] = $this->title;
[
'class' => 'yii\grid\ActionColumn',
'template' => '{view}',
'template' => '{view} {update}',
'buttons' => [
'update' => function ($url, $model, $key) {
return Html::a('Módosít',$url, ['class' =>'btn btn-xs btn-primary' ]);
},
'view' => function ($url, $model, $key) {
return Html::a('Részletek',$url, ['class' =>'btn btn-xs btn-primary' ]);
}
]
],
],
]); ?>

View File

@@ -1,13 +1,12 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\Procurement */
$this->title = Yii::t('common/procurement', 'Update {modelClass}: ', [
'modelClass' => 'Procurement',
]) . ' ' . $model->id_procurement;
$this->title = Yii::t('common/procurement', 'Beszerzés módosítása' );
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/procurement', 'Procurements'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id_procurement, 'url' => ['view', 'id' => $model->id_procurement]];
$this->params['breadcrumbs'][] = Yii::t('common/procurement', 'Update');
@@ -15,8 +14,40 @@ $this->params['breadcrumbs'][] = Yii::t('common/procurement', 'Update');
<div class="procurement-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id_procurement',
[
'attribute' => 'id_warehouse',
'value' => $model->warehouseName,
],
[
'attribute' => 'id_user',
'value' => $model->userName,
],
[
'attribute' => 'id_product',
'value' => $model->productName,
],
'count',
'stock',
'purchase_price',
[
'attribute' => 'description',
'value' => nl2br($model->description),
'format' => 'raw'
],
'created_at:datetime',
],
]) ?>
<?= $this->render('_form', [
<?= $this->render('_form_update', [
'model' => $model,
]) ?>

View File

@@ -0,0 +1,112 @@
<?php
use yii\grid\GridView;
use common\components\Helper;
use common\models\Transfer;
?>
<?php
?>
<style>
.table td,.table th{
padding: 2px;
}
.table th{
text-align: center;
}
.table td.transfer_id_transfer{
width: 70px;
}
.table td.transfer_created_at{
width: 120px;
}
.table td.ticket_comment{
width: 150px;
}
.table td.customer_name{
/*width: 150px;*/
}
.table td.transfer_status{
width: 120px;
}
.table td.transfer_money{
width: 70px;
text-align: right;
}
</style>
<h2>Fizetendő tételek</h2>
<?= GridView::widget([
'tableOptions' => ['class' => 'table table-striped table-bordered table-transfer'],
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'transfer_id_transfer',
'label' => 'T.',
'enableSorting' => false,
'contentOptions' => ['class' => 'transfer_id_transfer'],
],
[
'attribute' => 'transfer_created_at',
'label' => 'Kiadva',
'format' => 'datetime',
'enableSorting' => false,
'contentOptions' => ['class' => 'transfer_created_at'],
],
/*
[
'attribute' => 'user_username',
'label' => 'Felhasználó',
'enableSorting' => false,
'contentOptions' => ['class' => 'user_username'],
],
*/
[
'attribute' => 'customer_name',
'label' => 'Vendég',
'enableSorting' => false,
'contentOptions' => ['class' => 'customer_name'],
],
[
'attribute' => 'ticket_start',
'label' => 'Bérlet',
// 'format' => 'date',
'enableSorting' => false,
'contentOptions' => ['class' => 'ticket_start'],
'value' => function ($model, $key, $index, $column){
$type = $model['ticket_type_name'];
$start = \Yii::$app->formatter->asDate($model['ticket_start']);
$end = \Yii::$app->formatter->asDate($model['ticket_end']);
return $type. " (" .$start . " - " .$end . ")";
//return Helper::getArrayValue(Transfer::statuses(), $model['transfer_status'],'');
},
],
[
'attribute' => 'transfer_money',
'label' => 'Összeg',
'enableSorting' => false,
'contentOptions' => ['class' => 'transfer_money'],
],
/*[
'attribute' => 'transfer_status',
'enableSorting' => false,
'label' => 'Státusz',
'contentOptions' => ['class' => 'transfer_status'],
'value' => function ($model, $key, $index, $column){
return Helper::getArrayValue(Transfer::statuses(), $model['transfer_status'],'');
},
],
*/
[
'attribute' => 'ticket_comment',
'label' => 'Megjegyzés',
'enableSorting' => false,
'contentOptions' => ['class' => 'ticket_comment'],
],
],
]); ?>

View File

@@ -36,6 +36,11 @@ $this->params['breadcrumbs'][] = $this->title;
<h1><?= Html::encode($this->title) ?></h1>
<?php echo $this->render('_search_payment_later', ['model' => $searchModel, ]); ?>
<div style="margin-bottom: 6px;">
<?php
echo Html::a("PDF",Url::current(['TransferLaterSearch[output]'=>'pdf']), ['class' => 'btn btn-primary' ]);
?>
</div>
<div style="margin-bottom: 6px;">
<?php
@@ -108,12 +113,16 @@ echo Html::a("Egyiket sem",null, ['class' => 'btn btn-primary deselect-all',
'label' => 'Összeg'
],
[
'attribute' => 'transfer_status',
'label' => 'Státusz',
'value' => function ($model, $key, $index, $column){
'attribute' => 'transfer_status',
'label' => 'Státusz',
'value' => function ($model, $key, $index, $column){
return Helper::getArrayValue(Transfer::statuses(), $model['transfer_status'],'');
},
],
[
'attribute' => 'ticket_comment',
'label' => 'Megjegyzés'
],
],
]); ?>

View File

@@ -0,0 +1,128 @@
<?php
use yii\widgets\DetailView;
use yii\grid\GridView;
?>
<style>
.table td, .table th{
padding: 3px;
}
.table-request thead th{
text-align: center;
}
.table tbody td.id_customer{
width: 100px;
}
.table tbody td.money{
width: 80px;
text-align: right;
}
.table tbody td.customer_bank_account{
width: 240px;
}
.table tbody td.request_request_target_time_at{
width: 130px;
}
.table-ugiro th{
width: 230px;
}
.table tbody td.comment{
width: 100px;
}
</style>
<?php
$attributes = [
[
'attribute' => 'id_ugiro',
'label' => 'Köteg azonosító',
],
[
'attribute' => 'datum',
'label' => 'Üzenet összeállítási dátum'
],
[
'attribute' => 'user.username',
'label' => 'Felhasználó'
],
[
'attribute' => 'statusName',
'label' => 'Státusz'
],
[
'attribute' => 'created_at',
'label' => 'Létrehozva',
'format' =>'datetime'
],
];
?>
<h1>Csoportos beszedés</h1>
<?= DetailView::widget([
'options' => ['class' => 'table table-striped table-bordered detail-view table-ugiro'],
'model' => $model,
'attributes' => $attributes,
]) ?>
<?php
/*
* customer.id_customer as customer_id_customer',
'customer.name as customer_name',
'customer.bank_account as customer_bank_account',
'ticket_installment_request.money as request_money',
'ticket_installment_request.request_target_time_at as request_request_target_time_at',
* **/
echo GridView::widget([
'tableOptions' => ['class' => 'table table-striped table-bordered table-request'],
'dataProvider' => $dataProvider,
'emptyCell' => '',
'columns' =>[
[
'attribute' => 'customer_id_customer' ,
'label' => 'Vendég azonosító',
'contentOptions' =>['class' => 'id_customer' ]
],
[
'attribute' => 'customer_name' ,
'label' => 'Vendég neve'
],
[
'attribute' => 'customer_bank_account' ,
'label' => 'Bankszámlaszám',
'contentOptions' =>['class' => 'customer_bank_account' ]
],
[
'attribute' => 'request_money' ,
'label' => 'Összeg',
'contentOptions' =>['class' => 'money' ]
],
[
'attribute' => 'request_request_target_time_at' ,
'label' => 'Esedékességi dátum',
'format' => 'datetime',
'contentOptions' =>['class' => 'request_request_target_time_at' ]
],
[
'value' => function (){
return "";
},
'label' => 'Megjegyzés',
'contentOptions' =>['class' => 'comment' ]
]
]
]);
?>

View File

@@ -87,6 +87,7 @@ $attributes = [
echo Html::a("DetSta Fájl Feldoglozás",['view', 'id' => $model->id_ugiro] ,['data-method' =>'post', 'class' => 'btn btn-danger']);
}
echo Html::a("Megbízások a kötegben",['ticket-installment-request/index', 'TicketInstallmentRequestSearch[id_ugiro]' => $model->id_ugiro] ,[ 'class' => 'btn btn-primary']);
echo Html::a("PDF", Url::current(['output' => 'pdf']) ,[ 'class' => 'btn btn-primary']);
$detstaMessage = $model->messageDetsta;
if ( isset($detstaMessage)){