/**
  * 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 BancosCuentas the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = BancosCuentas::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemplo n.º 2
0
echo $form->textField($model, 'credito_fecha', array('size' => 10, 'maxlength' => 10, 'class' => 'input-small', 'readonly' => 'readonly'));
?>
					<?php 
echo $form->error($model, 'credito_fecha');
?>
				</div>
			</div>

			<div id="consignacion" style="display: none">
				<div>
					<b>Cuenta Origen</b>
					<?php 
echo $form->labelEx($model, 'banco_cuenta_id');
?>
					<?php 
echo $form->dropDownList($model, 'banco_cuenta_id', CHtml::listData(BancosCuentas::model()->findAll("estado = 'Activo'"), 'id', 'numero', 'idBanco.nombre'), array('class' => 'input-normal', 'id' => 'id'));
?>
					<?php 
echo $form->error($model, 'banco_cuenta_id');
?>
				</div>
				<hr>
				<div>
					<b>Cuenta Destino</b>
					<?php 
echo $form->labelEx($model, 'banco_destino');
?>
					<?php 
echo $form->textField($model, 'banco_destino', array('size' => 30, 'maxlength' => 30, 'class' => 'input-normal'));
?>
					<?php 
// 	//array('label'=>'Crear Ingreso', 'url'=>array('create')),
// );
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$('#ingresos-grid').yiiGridView('update', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1>Buscar Ingresos - Transferencias a Paciente - <a href="#exportar" class="btn btn-warning" role="button" data-toggle="modal"><i class="icon-share-alt icon-white"></i> Exportar</a></h1>

<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<DIV style='width:150%; overflow:scroll;'>
<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'ingresos-grid', 'template' => '{items}{summary}{pager}', 'dataProvider' => $model->searchTransferencias(), 'afterAjaxUpdate' => 'reinstallDatePickerIngresos', 'filter' => $model, 'columns' => array(array('header' => 'ID.', 'name' => 'id', 'value' => '$data->id', 'htmlOptions' => array('width' => '30')), array('name' => 'nombre_paciente', 'value' => '$data->paciente->nombre', 'htmlOptions' => array('width' => '100'), 'headerHtmlOptions' => array('style' => 'width:150px;text-align:center;')), array('name' => 'apellido_paciente', 'value' => '$data->paciente->apellido', 'htmlOptions' => array('width' => '100'), 'headerHtmlOptions' => array('style' => 'width:150px;text-align:center;')), 'n_identificacion', array('name' => 'valor', 'value' => 'number_format($data->valor,2)', 'htmlOptions' => array('width' => '100'), 'footer' => $model->searchSumaTransferencia()->itemCount === 0 ? '' : "<h6>\$ " . number_format($model->getTotal($model->searchSumaTransferencia()), 2) . '</h6>'), array('header' => 'Fecha', 'name' => 'fecha_sola', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('language' => 'es', 'model' => $model, 'attribute' => 'fecha_sola', 'options' => array('showAnim' => 'fold', 'language' => 'es', 'dateFormat' => 'dd-mm-yy', 'changeMonth' => true, 'changeYear' => true, 'yearRange' => '2014:2025'), 'htmlOptions' => array('id' => 'datepicker_for_fecha_sola', 'style' => 'height:20px;width:80px;'), 'defaultOptions' => array('showOn' => 'focus', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true), 'value' => 'Yii::app()->dateformatter->format("dd-MM-yyyy",$data[\'fecha_sola\']);', 'htmlOptions' => array('width' => '80')), 'descripcion', 'forma_pago', array('header' => 'Vendido por:', 'name' => 'vendedor_id', 'filter' => CHtml::listData(Personal::model()->findAll(array('order' => 'nombres ASC', 'condition' => "activo = 'SI'")), 'id', 'nombreCompleto'), 'value' => '$data->vendedor->nombreCompleto', 'htmlOptions' => array('width' => '150')), array('header' => 'Contrato', 'name' => 'contrato_id', 'value' => '$data->contrato_id', 'htmlOptions' => array('width' => '40')), array('name' => 'estado', 'filter' => array('Activo' => 'Activo', 'Anulado' => 'Anulado'), 'value' => '$data->estado'), array('name' => 'tarjeta_tipo', 'filter' => array('American Express' => 'American Express', 'Debito Maestro' => 'Debito Maestro', 'Diners Club' => 'Diners Club', 'Mastercard' => 'Mastercard', 'VISA' => 'VISA'), 'value' => '$data->tarjeta_tipo'), array('header' => 'Número de Autorización', 'name' => 'tarjeta_aprobacion', 'value' => '$data->tarjeta_aprobacion'), array('header' => 'Cuenta de Ingreso', 'name' => 'tarjeta_banco_cuenta_id', 'filter' => CHtml::listData(BancosCuentas::model()->findAll(array('order' => 'numero ASC')), 'id', 'numero'), 'value' => '$data[\'tarjetaBancoCuenta\'][\'numero\']', 'htmlOptions' => array('width' => '150')), array('header' => 'Realizado por:', 'name' => 'personal_id', 'filter' => CHtml::listData(Personal::model()->findAll(array('order' => 'nombres ASC', 'condition' => "activo = 'SI'")), 'id', 'nombreCompleto'), 'value' => '$data->personal->nombreCompleto', 'htmlOptions' => array('width' => '150')), array('header' => 'Seguimiento:', 'name' => 'personal_seguimiento', 'filter' => CHtml::listData(Personal::model()->findAll(array('order' => 'nombres ASC', 'condition' => "activo = 'SI'")), 'id', 'nombreCompleto'), 'value' => '$data->personalSeguimiento->nombreCompleto', 'htmlOptions' => array('width' => '150')), array('class' => 'CButtonColumn', 'template' => '{view}'))));
Yii::app()->clientScript->registerScript('re-install-date-picker', "\nfunction reinstallDatePickerIngresos(id, data) {\n        //use the same parameters that you had set in your widget else the datepicker will be refreshed by default\n    \$('#datepicker_for_fecha_sola').datepicker(jQuery.extend({showMonthAfterYear:false},jQuery.datepicker.regional['es'],{'dateFormat':'dd-mm-yy'}));\n    //\$('#datepicker_for_fecha_sola').datepicker(\$.datepicker.regional[ 'es' ]);\n  //\$('#datepicker_for_fecha_sola').datepicker({dateFormat: 'dd-mm-yy'});\n}\n");
// $countData = $model->search();
// $elTotal = 0;
// foreach ($countData->data as $count_data)
// {
// 	$elTotal = $elTotal + $count_data->valor;
// }
// echo "La suma: ".$elTotal;
?>
</div>

<div id="exportar" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Exportar a un archivo de Excel </h3>
Exemplo n.º 4
0
/* @var $this VentasController */
/* @var $model Ventas */
$this->menu = array(array('label' => 'Crear Venta', 'url' => array('create')));
?>

<h1>Buscar Ventas - <a href="#exportar" class="btn btn-warning" role="button" data-toggle="modal"><i class="icon-share-alt icon-white"></i> Exportar</a> - <a href="index.php?r=ventas/create" class="btn btn-success" role="button" ><i class="icon-plus icon-white"></i> Crear Venta</a></h1>

<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<DIV style='width:150%; overflow:scroll;'>
<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'ventas-grid', 'dataProvider' => $model->search(), 'afterAjaxUpdate' => 'reinstallDatePickerVentas', 'filter' => $model, 'columns' => array(array('header' => 'ID.', 'name' => 'id', 'value' => '$data->id', 'htmlOptions' => array('width' => '30')), array('header' => 'Paciente', 'name' => 'paciente_id', 'filter' => CHtml::listData(Paciente::model()->findAll(array('order' => 'nombre ASC')), 'id', 'nombreCompleto'), 'value' => '$data[\'paciente\'][\'nombreCompleto\']', 'htmlOptions' => array('width' => '220')), array('name' => 'n_identificacion', 'value' => '$data->n_identificacion', 'htmlOptions' => array('width' => '100')), 'descripcion', array('name' => 'forma_pago', 'value' => '$data->forma_pago', 'filter' => array('Cheque' => 'Cheque', 'Crédito' => 'Crédito', 'Consignación' => 'Consignación', 'Efectivo' => 'Efectivo', 'Tarjeta' => 'Tarjeta')), array('name' => 'total1', 'value' => 'number_format($data->total1,2)', 'htmlOptions' => array('width' => '120'), 'footer' => "<h6>\$ " . number_format($model->getTotal6($model->searchSuma()), 2) . '</h6>'), array('name' => 'forma_pago2', 'value' => '$data->forma_pago2', 'filter' => array('Crédito' => 'Crédito', 'Consignación' => 'Consignación', 'Tarjeta' => 'Tarjeta'), 'htmlOptions' => array('width' => '80')), array('name' => 'total2', 'value' => 'number_format($data->total2,2)', 'htmlOptions' => array('width' => '120'), 'footer' => "<h6>\$ " . number_format($model->getTotal7($model->searchSuma()), 2) . '</h6>'), array('name' => 'tarjeta_tipo', 'value' => '$data->tarjeta_tipo', 'filter' => array('Debito Maestro' => 'Debito Maestro', 'Mastercard' => 'Mastercard', 'VISA' => 'VISA', 'American Express' => 'American Express', 'Diners Club' => 'Diners Club')), array('name' => 'tarjeta_aprobacion', 'value' => '$data->tarjeta_aprobacion'), array('name' => 'tarjeta_cuenta_banco', 'filter' => CHtml::listData(BancosCuentas::model()->findAll(array('order' => 'numero ASC')), 'id', 'numero'), 'value' => '$data[\'tarjetaCuentaBanco\'][\'numero\']', 'htmlOptions' => array('width' => '150')), array('name' => 'tarjeta_tipo2', 'value' => '$data->tarjeta_tipo2', 'filter' => array('Debito Maestro' => 'Debito Maestro', 'Mastercard' => 'Mastercard', 'VISA' => 'VISA', 'American Express' => 'American Express', 'Diners Club' => 'Diners Club')), array('name' => 'tarjeta_aprobacion2', 'value' => '$data->tarjeta_aprobacion2'), array('name' => 'tarjeta_cuenta_banco2', 'filter' => CHtml::listData(BancosCuentas::model()->findAll(array('order' => 'numero ASC')), 'id', 'numero'), 'value' => '$data[\'tarjetaCuentaBanco2\'][\'numero\']', 'htmlOptions' => array('width' => '150')), array('name' => 'sub_total', 'value' => 'number_format($data->sub_total,2)', 'htmlOptions' => array('width' => '120'), 'footer' => "<h6>\$ " . number_format($model->getTotal5($model->searchSuma()), 2) . '</h6>'), array('name' => 'total_iva', 'value' => 'number_format($data->total_iva,2)', 'htmlOptions' => array('width' => '120'), 'footer' => "<h6>\$ " . number_format($model->getTotal4($model->searchSuma()), 2) . '</h6>'), array('name' => 'descuento', 'filter' => array('Si' => 'Si', 'No' => 'No'), 'value' => '$data->descuento'), array('name' => 'descuento_valor', 'value' => 'number_format($data->descuento_valor,2)', 'htmlOptions' => array('width' => '120'), 'footer' => "<h6>\$ " . number_format($model->getTotal3($model->searchSuma()), 2) . '</h6>'), array('name' => 'descuento_total', 'value' => 'number_format($data->descuento_total,2)', 'htmlOptions' => array('width' => '120'), 'footer' => "<h6>\$ " . number_format($model->getTotal2($model->searchSuma()), 2) . '</h6>'), array('name' => 'total_venta', 'value' => 'number_format($data->total_venta,2)', 'htmlOptions' => array('width' => '120'), 'footer' => "<h6>\$ " . number_format($model->getTotal($model->searchSuma()), 2) . '</h6>'), array('header' => 'Vendido por:', 'name' => 'vendedor_id', 'filter' => CHtml::listData(Personal::model()->findAll(array('order' => 'nombres ASC', 'condition' => "activo = 'SI'")), 'id', 'nombreCompleto'), 'value' => '$data->vendedor->nombreCompleto', 'htmlOptions' => array('width' => '180')), array('header' => 'Realizado por:', 'name' => 'personal', 'filter' => CHtml::listData(Personal::model()->findAll(array('order' => 'nombres ASC', 'condition' => "activo = 'SI'")), 'id', 'nombreCompleto'), 'value' => '$data->personal0->nombreCompleto', 'htmlOptions' => array('width' => '180')), array('header' => 'Fecha', 'name' => 'fecha', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('language' => 'es', 'model' => $model, 'attribute' => 'fecha', 'options' => array('showAnim' => 'fold', 'language' => 'es', 'dateFormat' => 'dd-mm-yy', 'changeMonth' => true, 'changeYear' => true, 'yearRange' => '2014:2025'), 'htmlOptions' => array('id' => 'datepicker_for_fecha', 'style' => 'height:20px;width:80px;'), 'defaultOptions' => array('showOn' => 'focus', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true), 'value' => 'Yii::app()->dateformatter->format("dd-MM-yyyy",$data[\'fecha\']);', 'htmlOptions' => array('width' => '80')), array('name' => 'estado', 'filter' => array('Activo' => 'Activo', 'Anulada' => 'Anulada'), 'value' => '$data->estado', 'htmlOptions' => array('width' => '150')), array('class' => 'CButtonColumn', 'template' => '{view}'))));
Yii::app()->clientScript->registerScript('re-install-date-picker', "\nfunction reinstallDatePickerVentas(id, data) {\n        //use the same parameters that you had set in your widget else the datepicker will be refreshed by default\n    \$('#datepicker_for_fecha').datepicker(jQuery.extend({showMonthAfterYear:false},jQuery.datepicker.regional['es'],{'dateFormat':'dd-mm-yy'}));\n    //\$('#datepicker_for_fecha').datepicker(\$.datepicker.regional[ 'es' ]);\n  //\$('#datepicker_for_fecha').datepicker({dateFormat: 'dd-mm-yy'});\n}\n");
?>

</div>


<div id="exportar" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Exportar a un archivo de Excel </h3>
  </div>
  <div class="modal-body">
  	<p>Seleccione las opciones de Exportar</p>
 	<form id="frmExportar" name="frmExportar" action="index.php?r=Ventas/exportar&tipo=<?php 
$elTipo;
Exemplo n.º 5
0
?>
					<?php 
echo $form->textField($model, 'consignacion_cuenta_banco2', array('size' => 25, 'maxlength' => 25));
?>
					<?php 
echo $form->error($model, 'consignacion_cuenta_banco2');
?>
				</div>
				<hr>
				<div class="row">
					<div class="span6">
						<?php 
echo $form->labelEx($model, 'consignacion_banco2');
?>
						<?php 
echo $form->dropDownList($model, 'consignacion_banco2', CHtml::listData(BancosCuentas::model()->findAll("estado = 'Activo'"), 'id', 'numero', 'idBanco.nombre'), array('class' => 'input-normal', 'id' => 'id', 'empty' => '(Seleccionar)'));
?>
						<?php 
echo $form->error($model, 'consignacion_banco2');
?>
					</div>

					<div class="span6">
						<?php 
echo $form->labelEx($model, 'consignacion_cuenta2');
?>
						<?php 
echo $form->textField($model, 'consignacion_cuenta2', array('size' => 25, 'maxlength' => 25));
?>
						<?php 
echo $form->error($model, 'consignacion_cuenta2');
Exemplo n.º 6
0
<div class="row">
	<div class="span12"></div>
	<div class="span12 text-center">
		<h3>Cuentas de Banco</h3>		
	</div>
	<div class="span12">
		<div class="span4"></div>
		<div class="span4">
			<table class="table table-striped">
			<tr>
				<th>Cuenta</th>
				<th>Estado</th>
			</tr>
		<?php 
$lasCuentas = BancosCuentas::model()->findAll("id_banco = {$model->id}");
?>
		<?php 
foreach ($lasCuentas as $las_cuentas) {
    ?>
				<tr>
					<td><a href="index.php?r=BancosCuentas/view&id=<?php 
    echo $las_cuentas->id;
    ?>
"><?php 
    echo $las_cuentas->numero;
    ?>
</a></td>
					<td><?php 
    echo $las_cuentas->estado;
    ?>