detsta import improvements, procurement changes

This commit is contained in:
2016-02-26 21:19:51 +01:00
parent 6efbfa7d9b
commit 75aeb64b19
8 changed files with 49 additions and 12 deletions

View File

@@ -13,6 +13,7 @@ use common\models\Product;
use common\models\User;
use common\components\Helper;
use common\models\Account;
use yii\helpers\Url;
/**
* ProcurementController implements the CRUD actions for Procurement model.
@@ -193,7 +194,15 @@ class ProcurementController extends \backend\controllers\BackendController
}
return $this->redirect(['view', 'id' => $model->id_procurement]);
// return $this->redirect(['view', 'id' => $model->id_procurement]);
$url = Url::previous("product_index");
if ( isset($url)){
return $this->redirect( $url );
}else{
return $this->redirect(['product/index']);
}
// return $this->redirect(Yii::$app->request->referrer);
} else {
return $this->render('create_product', [
'model' => $model,

View File

@@ -12,6 +12,7 @@ use common\models\Account;
use common\models\ProductCategory;
use backend\models\ProductStatisticsSearch;
use PHPExcel;
use yii\helpers\Url;
/**
* ProductController implements the CRUD actions for Product model.
@@ -47,6 +48,8 @@ class ProductController extends \backend\controllers\BackendController
$searchModel = new ProductSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
Url::remember(Url::current(),"product_index");
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,

View File

@@ -39,16 +39,17 @@ class DestaUploadForm extends Model
$datum = $destaUzenet->fej->csoportosUzenetSorszam->osszeallitasDatuma;
$koteg = Ugiro::find()->andWhere(['number' =>$number,'datum' => $datum ])->one();
$this->koteg = $koteg;
$idKoteg = $this->koteg->id_ugiro;
if (!isset($koteg)){
$this->addError($attribute,"Nincs ilyen köteg! ( Datum: $datum, Sorszam: $number )");
}else{
if ( $koteg->status != Ugiro::$STATUS_SENT ){
$idKoteg = $this->koteg->id_ugiro;
$this->addError($attribute,"A köteg detsta fájl-ja már fel van töltve !( Köteg azonosító: $idKoteg )");
}
}
}
}

View File

@@ -17,21 +17,41 @@ $warehouseOptions = ArrayHelper::map($warehouses, 'id_warehouse', 'name') ;
?>
<h3><?= Yii::t('common/product', 'Product') ?> </h3>
<div class="row">
<div class="col-md-6">
<?php
echo DetailView::widget([
'model' => $product,
'attributes' =>[
'productCategoryName',
'accountName',
'product_number',
'barcode',
'stock',
[
'attribute' => 'productCategoryName',
'label' => 'Termék kategória'
],
[
'attribute' => 'accountName',
'label' => 'Kassza'
],
[
'attribute' => 'product_number',
'label' => 'Termék szám'
],
[
'attribute' => 'barcode',
'label' => 'Vonalkód'
],
[
'attribute' => 'stock',
'label' => 'Raktáron'
],
]
]);
?>
</div>
</div>
<div class="row">
<div class="col-md-4" >
<div class="procurement-form">
<?php $form = ActiveForm::begin(); ?>
@@ -52,3 +72,4 @@ echo DetailView::widget([
<?php ActiveForm::end(); ?>
</div>
</div></div>