/**
  * Lists all BalanceAmount models.
  * @return mixed
  */
 public function actionIndex()
 {
     $session = Yii::$app->session;
     $session->open();
     $dataProvider = new ActiveDataProvider(['query' => BalanceAmount::find()->where(array('balance_sheet_id' => $session['balance_sheet_id']))->join('LEFT OUTER JOIN', 'account', 'balance_item_id = account.id')->orderBy('account.order_code')]);
     return $this->render('index', ['dataProvider' => $dataProvider]);
 }
Exemple #2
0
 public function getAmount($sheet_id)
 {
     $amount = BalanceAmount::find()->where(['account_id' => $this->id, 'balance_sheet_id' => $sheet_id])->one();
     if ($amount) {
         return $amount;
     } else {
         return null;
     }
 }