public function beforeSave() { if ($this->isNewRecord) { if ($this->tipoflujo != '102') { $this->haber = $this->debe; } } else { /* echo "saliop carajo"; //$this->ultimares=" ".strtoupper(trim($this->usuario=Yii::app()->user->name))." ".date("H:i")." :".$this->ultimares; */ } if ($this->monedahaber == yii::app()->params['monedabase']) { $this->monto = $this->haber; } else { $this->monto = $this->debe * MiFactoria::TipoCambio($this->monedahaber, yii::app()->params['monedabase']); } return parent::beforesave(); }