예제 #1
0
 public static function getimpuesto($codimpuesto)
 {
     $criteria = new CDBCriteria();
     $criteria->addcondition(" finicio <= '" . date('Y-m-d') . "' AND ffinal >= '" . date('Y-m-d') . "' AND activo='1' and hcodimpuesto= '" . $codimpuesto . "'");
     //$criteria->addcondition(" activo='1' ");
     //$criteria->params=array(" :vfactual "=>date('Y-m-d')," :vfactual2 "=>date('Y-m-d'));
     $registro = self::model()->find($criteria);
     if (is_null($registro)) {
         throw new CHttpException(500, __CLASS__ . '--' . __FUNCTION__ . '--' . __LINE__ . '   El impuesto ' . Impuestos::model()->findByPk($codimpuesto)->descripcion . '  No se ha actualizado a la fecha , pro favor actualizarlo  ');
     }
     ///vwrificando que este enporcentaje
     return $registro->valor / 100;
 }
예제 #2
0
파일: _form.php 프로젝트: hipogea/zega
$form = $this->beginWidget('CActiveForm', array('id' => 'valorimpuestos-form', 'enableAjaxValidation' => false));
?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php 
echo $form->errorSummary($model);
?>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'hcodimpuesto');
?>

		<?php 
$datos1 = CHtml::listData(Impuestos::model()->findAll(array('order' => 'descripcion')), 'codimpuesto', 'descripcion');
echo $form->DropDownList($model, 'hcodimpuesto', $datos1, array('empty' => '--Seleccione un impuesto--'));
?>

		<?php 
echo $form->error($model, 'hcodimpuesto');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'valor');
?>
		<?php 
echo $form->textField($model, 'valor', array('size' => 6, 'maxlength' => 6));
?>
예제 #3
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Impuestos the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Impuestos::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }