Exemple #1
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 Iva the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Iva::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemple #2
0
                                    'placeholder' => 'Seleccionar unidad',
                                    // 'width' => '40%', 
                                    'tokenSeparators' => array(',', ' ')
                                )
                            )
                        )
                    );
	?>
</td>
<td>
	<?php //echo $form->textFieldGroup($model,'iva_id',array('widgetOptions'=>array('htmlOptions'=>array('class'=>'span5')))); 

	$criteria = new CDbCriteria();
	$activo = true;
	$criteria->condition = "sys_status='$activo'";      
	$list = CHtml::listData(Iva::model()->findAll($criteria), 'id', 'porcentaje');
			echo $form->dropDownListGroup(
					$model,
					'iva_id',
					array(
						'wrapperHtmlOptions' => array(
							'class' => 'col-sm-5',
						),
						'widgetOptions' => array(
							'data' => $list,
							'htmlOptions' => array(),
						)
					)
				);
		?>
		</td>
Exemple #3
0
    echo $form->textField($model, 'importo_dettaglio', array('size' => 9, 'maxlength' => 9, 'class' => 'form-control', 'placeholder' => 'Es. 1000.00'));
    ?>
                    <div class="errorMessage">Utilizzare il punto per la parte decimale.</div>
                    <?php 
    echo $form->error($model, 'importo_dettaglio');
    ?>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label"><?php 
    echo $form->labelEx($model, 'id_iva');
    ?>
</label>
                <div class="col-sm-8">
                    <?php 
    echo $form->dropDownList($model, 'id_iva', CHtml::listData(Iva::model()->findAll(), 'id_iva', 'percentuale'), array('empty' => 'Seleziona un\'aliquota', 'class' => 'form-control'));
    ?>
                    <?php 
    echo $form->error($model, 'id_iva');
    ?>
                </div>
            </div>
                    
        </div> 


    
<?php 
    $id_ordine = $_GET['id_ordine'];
    echo CHtml::textField('DettOrdini[id_ordine]', $id_ordine, array('hidden' => 'true'));
    echo $form->hiddenField($model, $primaryKey);
Exemple #4
0
 public function getMenuIva()
 {
     return CHtml::listData(Iva::model()->findAll(), "id", "descripcion", "porcentaje");
 }
 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionFilaProducto()
 {
     $model = new FacturasProductos();
     //echo '<tr>';
     $form = $this->beginWidget('booster.widgets.TbActiveForm', array('id' => 'facturas-productos-fila', 'enableAjaxValidation' => false));
     //echo '<div id="retorno">';
     echo '<td>';
     echo '<div class="form-group">';
     $list = CHtml::listData(PresupuestoPartidas::model()->findAllByAttributes(array('ente_organo_id' => Usuarios::model()->findByPk(Yii::app()->user->getId())->enteOrgano->ente_organo_id, 'anho' => Yii::app()->params['trimestresFechas'][Yii::app()->session['trimestreSeleccionado']]['anho'])), 'partida_id', function ($presuPartida) {
         return $presuPartida->partida->etiquetaPartida();
     });
     echo CHtml::label('Seleccionar partida', 'partida');
     echo "<br>";
     $this->widget('booster.widgets.TbSelect2', array('asDropDownList' => true, 'model' => $model, 'attribute' => 'presupuesto_partida_id', 'data' => $list, 'htmlOptions' => array('id' => 'partida', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('facturasProductos/buscarProductosPartida'), 'update' => '#producto')), 'options' => array('placeholder' => 'Partida', 'width' => '40%', 'tokenSeparators' => array(',', ' '))));
     echo '</div>';
     echo '</td>';
     echo '<td>';
     echo '<div class="form-group">';
     echo CHtml::label('Seleccionar producto', 'producto');
     echo "<br>";
     $this->widget('booster.widgets.TbSelect2', array('asDropDownList' => true, 'model' => $model, 'attribute' => 'producto_id', 'data' => array(), 'htmlOptions' => array('id' => 'producto'), 'options' => array('placeholder' => 'Producto', 'width' => '40%', 'tokenSeparators' => array(',', ' '))));
     echo '</div>';
     echo '</td>';
     echo '<td>';
     echo $form->textFieldGroup($model, 'costo_unitario', array('widgetOptions' => array('htmlOptions' => array('class' => 'span5', 'maxlength' => 38))));
     echo '</td>';
     echo '<td>';
     echo $form->textFieldGroup($model, 'cantidad_adquirida', array('widgetOptions' => array('htmlOptions' => array('class' => 'span5'))));
     echo '</td>';
     echo '<td>';
     $list = CHtml::listData(Iva::model()->findAll(), 'id', 'porcentaje');
     echo $form->dropDownListGroup($model, 'iva_id', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => $list, 'htmlOptions' => array())));
     echo '</td>';
     echo '</div>';
     $this->endWidget();
     //echo '</tr>';
 }