public function actionStage()
 {
     $form = new AccountRecordForm();
     $account = new Account();
     $inAccounts = $account->findFormListArray(['type_id' => 2]);
     $outAccounts = $account->findFormListArray(['type_id' => 2]);
     if (Yii::$app->request->isPost && $form->load(Yii::$app->request->post())) {
         $feeId = $this->insertFeeRecord($form, FEE);
         return $this->insertCreditRecord($form, $feeId, 'o', $feeId);
     }
     return $this->render('insterStage', ['model' => $form, 'inAccounts' => $inAccounts, 'outAccounts' => $outAccounts, 'type' => '信用卡分期']);
 }
 public function actionInsert($io_type = 0)
 {
     $form = new AccountRecordForm();
     $account = new Account();
     $inAccounts = $account->findFormListArray(['type_id' => 1], -1);
     $outAccounts = $account->findFormListArray(['type_id' => 1]);
     if (Yii::$app->request->isPost && $form->load(Yii::$app->request->post())) {
         return $this->insertRecord($form, $form->io_type);
     }
     $form->io_type = $io_type;
     $typeName = $this->findTypeName($io_type);
     return $this->render('inserttest', ['model' => $form, 'inAccounts' => $inAccounts, 'outAccounts' => $outAccounts, 'typeName' => $typeName]);
 }
 public function actionRefundout()
 {
     $form = new AccountRecordForm();
     $person = new Person();
     $account = new Account();
     $lendRecord = new LendRecord();
     $persons = $person->findLendArray();
     $me = $account->findFormListArray(['type_id' => 1]);
     $records = $lendRecord->findLendInfo(key($persons), 2);
     if (Yii::$app->request->isPost && $form->load(Yii::$app->request->post())) {
         $id = $this->insertRecord($form, REFUNDOUT);
         $refundRecord = new RefundRecord();
         $errors = $refundRecord->insertRecord($form, $id, REFUNDOUT);
     }
     return $this->render('refundout', ['model' => $form, 'persons' => $persons, 'me' => $me, 'type' => '还出', 'records' => $records]);
 }