<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/datepicker.min.css" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/datepicker3.min.css" />
<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/bootstrap-datepicker.min.js"></script>

<script type="text/javascript">
$(document).ready(function () {
	$('.datepicker').datepicker({
		format: "dd-mm-yyyy",
		endDate: "0d",
		todayBtn: "linked",
		forceParse: false,
		daysOfWeekDisabled: "0,6",
		orientation: "bottom auto",
		todayHighlight: true,
		toggleActive: true,
		language:'es',
        autoclose: true
	});
});
</script>

<h3 style="text-align: center">Aprobar solicitud de ajustes de haberes</h3>
<div class="form">

<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'id'=>'liquidacion-form',
        'enableAjaxValidation' => false,
        'enableClientValidation' => true,
        'clientOptions' => array(
        'validateOnSubmit' => true,
        'validateOnChange' => true,
        'validateOnType' => true,
        ),
));?>
    <div class="well" >
      <fieldset><legend style=" font-size: 17px;"><b>Datos del solicitante</b></legend>            
<table class="table table-bordered">
        <tr>
            <td style="width: 25%"><b><?= $model->getAttributeLabel('cedula'); ?></b></td>
            <td style="width: 25%"><?= $model->cedula ;?></td>
            <td style="width: 20%"><b>Nombres y apellidos</b></td>
            <td style="width: 30%"><?= $model->idAsociado->nombre.' '.$model->idAsociado->apellidos;?></td>
        </tr>
        <tr>
            <td><b>Empresa</b></td>
            <td><?= $model->idAsociado->lugartrabajo0->descripcion;?></td>
            <td><b>Unidad</b></td>
            <td><?= $model->idAsociado->unidad->descripcion;?></td>
        </tr>
        <tr>
            <td><b>&Uacute;ltimo sueldo</b></td>
            <td><?= $model->idAsociado->utltimoSueldoPorcentajeAporte($model->idasociado);?></td>
            <td><b>Porcentaje de aporte</b></td>
            <td><?php
                $modelPorcentajeAporte = PorcentajeDescuentoAsociadoPatrono::model()->find('idasociado=:idasociado AND actual = true',array(':idasociado'=>$model->idasociado));
                if($modelPorcentajeAporte)
                    $porcentaje = $modelPorcentajeAporte->idPorcentajeAsociado->descripcion;        
                else 
                    $porcentaje = 10; 

                 echo $porcentaje.'%'?>
            </td>
        </tr>
        <tr>
            <td><b>Fecha de inscripci&oacute;n</b></td>
            <td><?=  $model->idAsociado->fechaingreso ?></td>
            <td><b>Estatus</b></td>
            <td><?=  $model->idAsociado->blnborrado=="1"?"Inacivo":"Activo"?></td>
        </tr>
    </table>
</fieldset>
<fieldset><legend style=" font-size: 17px;"><b>Datos del ajuste</b></legend>            
  <table class="table table-bordered" id="datos_prestamos_calculadora">
        <tr>
            <td style="width: 25%"><b><?= $model->getAttributeLabel('id_tipo_ajuste'); ?></b></td>
            <td> <?=$model->idTipoAjuste->descripcion?></td>
        </tr>
        <tr>
            <td style="width: 25%"><b><?= $model->getAttributeLabel('id_concepto_ajuste'); ?></b></td>
            <td> <?= $model->idConceptoAjuste->descripcion;?></td>
        </tr>
        <tr>
            <td style="width: 25%"><b><?= $model->getAttributeLabel('id_tipo_movimiento'); ?></b></td>
            <td> <?= $model->idTipoMovimiento->descripcion?></td>
        </tr>
        <?php if($model->id_tipo_movimiento ==1 || $model->id_tipo_movimiento ==3){?>
          <tr>
              <td><b><?= $model->getAttributeLabel('monto_asociado'); ?></b></td>
              <td>Bs. <?= number_format($model->monto_asociado,2,',','.'); ?></td>
          </tr>
      <?php 
        }

        if($model->id_tipo_movimiento ==2 || $model->id_tipo_movimiento ==3){?>
          <tr>
              <td><b><?= $model->getAttributeLabel('monto_patrono'); ?></b></td>
              <td>Bs. <?= number_format($model->monto_patrono,2,',','.')?></td>
          </tr>
        <?php }?>
        <tr>
            <td style="width: 25%"><b><?= $model->getAttributeLabel('numero_operacion'); ?></b></td>
            <td> <?= $model->numero_operacion; ?></td>
        </tr>
        <tr>
            <td style="width: 25%"><b><?= $model->getAttributeLabel('fecha_operacion'); ?></b></td>
            <td> <?= date('d-m-Y',strtotime($model->fecha_operacion))?></td>
        </tr>
        <tr>
            <td style="width: 25%"><b><?= $model->getAttributeLabel('observacion'); ?></b></td>
            <td> <?= $model->observacion ?></td>
        </tr>
    </table>
</fieldset>

    </div>
    <div class="alert alert-info">
            <?= $form->textFieldRow($modelSeguimiento, 'fecha_registro', array('class' => 'input-small datepicker', 'readOnly' => 'readOnly')) ?>
            <?php Yii::import('application.modules.contable.models.*', true); ?>
            <?php if (ParamEscenarios::fechaComprobante(['aprobacion_ajuste_haberes' => 11])): ?>
            <?= $form->textFieldRow($model, 'fecha_comprobante', array('class' => 'input-small datepicker', 'readOnly' => 'readOnly')) ?>
            <?php endif ?>
           <div class="row">
               <div class="span11">
                   <?php echo $form->labelEx($modelSeguimiento,'observacion'); ?>
                   <?php echo $form->textarea($modelSeguimiento,'observacion', array('class' => 'span9')); ?>
                   <?php echo $form->error($modelSeguimiento,'observacion'); ?>
               </div>
           </div>
        
    </div>
    
    <div class="form-actions text-center">
		<?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType' => 'submit',
			'type' => 'success',
			'id' => 'btn_registrar',
                        'icon'=>'icon-ok',
			'label' => 'Aprobar',

                ));?>

                 <?php $this->widget('bootstrap.widgets.TbButton', array(
                                    'buttonType' => 'submit',
                                    'type' => 'danger',
                                    'id' => 'btn_denegar',
                                    'icon'=>'icon-remove',
                                    'label' => 'Denegar',

                ));?>
	</div>
    
    
    
<?php $this->endWidget(); ?>

</div>
