public function actionSetSaldoAwal()
 {
     if (!Yii::app()->request->isAjaxRequest) {
         return;
     }
     if (isset($_POST) && !empty($_POST)) {
         //require_once(Yii::app()->basePath . '/vendors/frontaccounting/ui.inc');
         $status = false;
         $msg = 'Saldo Awal berhasil disimpan.';
         $date = $_POST['trans_date'];
         $user = Yii::app()->user->getId();
         $id = Pe::get_next_trans_saldo_awal();
         app()->db->autoCommit = false;
         $transaction = app()->db->beginTransaction();
         try {
             Pe::add_gl(SALDO_AWAL, $id, $date, "-", $_POST['account_code'], '-', get_number($_POST['amount']), $user);
             $transaction->commit();
             $status = true;
         } catch (Exception $ex) {
             $transaction->rollback();
             $status = false;
             $msg = $ex;
         }
         echo CJSON::encode(array('success' => $status, 'id' => $id, 'msg' => $msg));
         Yii::app()->end();
     }
 }