add transfer unstorno

This commit is contained in:
2016-04-11 21:21:47 +02:00
parent 1d95d37373
commit 01ada90e8c
8 changed files with 120 additions and 47 deletions

View File

@@ -17,6 +17,7 @@ use common\models\Product;
use backend\models\TransferListUserGroupedSearch;
use backend\models\TransferLaterSearch;
use yii\helpers\Url;
use common\components\Helper;
/**
* TransferController implements the CRUD actions for Transfer model.
@@ -26,6 +27,14 @@ class TransferController extends \backend\controllers\BackendController
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className (),
'actions' => [
'unstorno' => [
'post'
]
]
],
'access' => [
'class' => \yii\filters\AccessControl::className(),
'rules' => [
@@ -38,10 +47,17 @@ class TransferController extends \backend\controllers\BackendController
"sale",
"sale-pdf" ,
'list-user-grouped',
'payment-later'],
'payment-later'
],
'allow' => true,
'roles' => ['admin','employee','reception'],
],
[
'actions' => [ 'unstorno',
],
'allow' => true,
'roles' => ['admin' ],
],
// everything else is denied
],
],
@@ -296,6 +312,18 @@ class TransferController extends \backend\controllers\BackendController
'model' => $this->findModel($id),
]);
}
public function actionUnstorno($id)
{
$model = $this->findModel($id);
$model->unstorono();
Helper::flash("success", "Bérlet visszaállítva");
return $this->redirect( ['view' ,'id' => $model->id_transfer]);
}
/**