예제 #1
0
 /**
  * Creates a new InvoiceCharges model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new InvoiceCharges();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->invoice_id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
예제 #2
0
 public function actionAddcharges($entrepreneur_user_id, $invoice_id)
 {
     $model = new InvoiceCharges();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->invoice_id]);
     } else {
         $model = $this->findModel($entrepreneur_user_id, $invoice_id);
         //$model2 = $this->findProfile($entrepreneur_user_id);
         //$query = $model->getInvoice();
         //$dataProvider = new ActiveDataProvider(['query'=>$query]);
         return $this->render('charges', ['model' => $model]);
     }
 }