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(); }
public function beforeSave() { if ($this->isNewRecord) { /* $modelocabecera=Almacendocs::model()->findByPk($this->hidvale); /*$this->codmov=$modelocabecera->codmovimiento; $this->alemi=$modelocabecera->codalmacen; $this->codcentro=$modelocabecera->codcentro;*/ $this->fecha = $this->alkardex_almacendocs->fechacont; $this->iduser = Yii::app()->user->id; $this->idusertemp = Yii::app()->user->id; //$this->coddoc='460'; if (is_null($this->codestado)) { $this->codestado = '99'; } //$this->codobjeto='001'; if (is_null($this->fechadoc)) { $this->fechadoc = date("Y-m-d H:i:s"); } //$this->valido='0'; //$gg=new Numeromaximo; //$this->numkardex=$gg->numero($this,'correlativ','maximovalor',12,'codmov'); } else { //echo "saliop carajo"; //$this->ultimares=" ".strtoupper(trim($this->usuario=Yii::app()->user->name))." ".date("H:i")." :".$this->ultimares; } return parent::beforesave(); }
public function beforeSave() { if ($this->isNewRecord) { $this->codestado = self::ESTADO_CAJA_CREADO; $this->codocu = self::CODIGO_DOC; } else { /* echo "saliop carajo"; //$this->ultimares=" ".strtoupper(trim($this->usuario=Yii::app()->user->name))." ".date("H:i")." :".$this->ultimares; */ } return parent::beforesave(); }
public function beforeSave() { if ($this->tipoflujo == self::FUJO_FONDO) { $this->debe = -1 * abs($this->debe); } $cambio = $this->monedahaber != yii::app()->settings->get('general', 'general_monedadef') ? yii::app()->tipocambio->getcambio($this->monedahaber, yii::app()->settings->get('general', 'general_monedadef')) : 1; $this->monto = $cambio * $this->debe; if ($this->tipoflujo != self::FUJO_CARGO_A_RENDIR) { $this->haber = $this->debe; } if ($this->isNewRecord) { $this->coddocu = self::CODIGO_DOCUMENTO; $this->codestado = self::ESTADO_DETALLE_CAJA_CREADO; } else { } return parent::beforesave(); }
public function beforeSave() { if ($this->isNewRecord) { $this->codestado = '10'; } else { /* echo "saliop carajo"; //$this->ultimares=" ".strtoupper(trim($this->usuario=Yii::app()->user->name))." ".date("H:i")." :".$this->ultimares; */ } return parent::beforesave(); }
public function beforeSave() { if ($this->isNewRecord) { $this->codestado = '10'; } else { /* echo "saliop carajo"; //$this->ultimares=" ".strtoupper(trim($this->usuario=Yii::app()->user->name))." ".date("H:i")." :".$this->ultimares; */ } $this->montomovido = $this->getMonto(); //var_dump($this->id); //var_dump($this->montomovido);yii::app()->end(); return parent::beforesave(); }