add contract controller(s) changes

This commit is contained in:
Roland Schneider
2018-09-10 07:40:50 +02:00
parent dd0d6c50c9
commit 792d0caab5
7 changed files with 266 additions and 74 deletions

View File

@@ -65,13 +65,14 @@ class ContractController extends Controller {
'dataProvider' => $dataProvider
] );
}
/**
* Displays a single Contract model.
*
* @param integer $id
* @return mixed
*/
/**
* Displays a single Contract model.
*
* @param integer $id
* @return mixed
* @throws NotFoundHttpException
*/
public function actionView($id) {
$model = $this->findModel ( $id );
$customer = $model->customer;
@@ -110,14 +111,15 @@ class ContractController extends Controller {
] );
}
}
/**
* Updates an existing Contract model.
* If update is successful, the browser will be redirected to the 'view' page.
*
* @param integer $id
* @return mixed
*/
/**
* Updates an existing Contract model.
* If update is successful, the browser will be redirected to the 'view' page.
*
* @param integer $id
* @return mixed
* @throws NotFoundHttpException
*/
public function actionUpdate($id) {
$model = $this->findModel ( $id );
@@ -132,14 +134,16 @@ class ContractController extends Controller {
] );
}
}
/**
* Deletes an existing Contract model.
* If deletion is successful, the browser will be redirected to the 'index' page.
*
* @param integer $id
* @return mixed
*/
/**
* Deletes an existing Contract model.
* If deletion is successful, the browser will be redirected to the 'index' page.
*
* @param integer $id
* @return mixed
* @throws NotFoundHttpException
* @throws \yii\db\StaleObjectException
*/
public function actionDelete($id) {
$this->findModel ( $id )->delete ();
@@ -196,10 +200,15 @@ class ContractController extends Controller {
'id' => $contract->id_contract
] );
}
/**
* EGY RÉSZLET KIFIZETÉSE
*/
/**
* Cancel contract.
* @param $id
* @param $flag
* @return \yii\web\Response
* @throws NotFoundHttpException
* @throws \yii\db\Exception
*/
public function actionCancel($id,$flag) {
$contract = $this->findModel ( $id );
@@ -235,7 +244,8 @@ class ContractController extends Controller {
$productBuntetes = Product::find ()->andWhere ( [
'product_number' => Product::$BUNTETES
] )->one ();
// if there is a fee , generate fee and put it to the shopping cart
if (isset ( $productBuntetes )) {
if ($buntetes > 0) {
@@ -286,7 +296,12 @@ class ContractController extends Controller {
] );
}
public function actionMake($id) {
/**
* @param $id
* @return string|\yii\web\Response
* @throws \yii\db\Exception
*/
public function actionMake($id) {
$customer = Customer::findOne ( $id );
if (! isset ( $customer )) {
@@ -326,8 +341,13 @@ class ContractController extends Controller {
'model' => $model
] );
}
public function actionContract($id){
/**
* @param $id
* @throws NotFoundHttpException
* @throws \yii\base\InvalidConfigException
*/
public function actionContract($id){
$model = $this->findModel($id);
//$mpdf=new \mPDF('utf-8', 'A4');