add transfer unstorno
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user