<?php
$this->breadcrumbs=array(
	'Comprobante Pagos'=>array('index'),
	$model->id,
);

$this->menu=array(
	array('label'=>'List ComprobantePago','url'=>array('index')),
	array('label'=>'Create ComprobantePago','url'=>array('create')),
	array('label'=>'Update ComprobantePago','url'=>array('update','id'=>$model->id)),
	array('label'=>'Delete ComprobantePago','url'=>'#','linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage ComprobantePago','url'=>array('admin')),
);
?>

<h1>Comprobante de pago #<?php echo $model->id; ?></h1>

<?php  echo CHtml::link('Ir a bandeja de histial de pago', Yii::app()->createUrl('/comprobantePago/admin'),array('class'=>'btn btn-inverse')); ?>
<br>
     <table class="table table-bordered">
        <tr>
            <td><b>Banco</b></td>
            <td><?php echo ($model->idParametroBanco)?$model->idParametroBanco->banco:""?></td>
            <td><b>Tipo de cuenta</b></td>
            <td><?php echo ($model->idParametroBanco)?$model->idParametroBanco->tipo_cuenta:""?></td>

        </tr>
        <tr>
            <td ><b>Cuenta</b></td>
            <td colspan="3"><?php echo ($model->idParametroBanco)?$model->idParametroBanco->num_cuenta:""?></td>
        </tr>
        <tr>
            <td><b><?php echo $model->getAttributeLabel('referencia')?></b></td>
            <td><?php echo $model->referencia?></td>
            <td><b><?php echo $model->getAttributeLabel('fecha_operacion')?></b></td>
            <td><?php echo date('d-m-Y',  strtotime($model->fecha_operacion))?></td>
        </tr>
        <tr>
            <td><b>Monto cancelado por RRHH</b></td>
            <td><?php echo number_format($model->monto_pagado, 2, ',', '.')?></td>
            <td><b>Observacion</b></td>
            <td><?php echo $model->observacion?></td>
        </tr>
      <tr>
            <td ><b>Concepto</b></td>
            <td colspan="3"><?php 
                $pago = '';
                $aporteNomina = DatosTxtIntegrado::model()->with('comprobantePagos')->find('id_comprobante_pago=:id_comprobante_pago',array(':id_comprobante_pago'=>$model->id));
                if($aporteNomina){
                    $pago = 'Nomina de '.$aporteNomina->idCarga->nombre.' "'.$aporteNomina->nombre_archivo. '" a la unidad '.$aporteNomina->idUnidad->descripcion;
                }
                echo $pago?></td>
        </tr>
    </table>