<div class="x_content">
  <form id="form-nuevo">
    
      @if ($vauchers[0]->lote_pagos->observaciones->count()>0)
        <ul class="list-group">
            <li class="list-group-item list-group-item-dark" style="padding:3px 10px;">Observaciones:</li>

          @foreach ($vauchers[0]->lote_pagos->observaciones as $o)
            <li class="list-group-item" style="padding:3px 10px;"><b>{{ $o->created_at->format('d/m/Y H:i') }}</b>: {{ $o->observacion }}</li>
          @endforeach
        </ul>
      @endif

    <div class="row mt-3">
      <div class="col-lg-8 col-md-12 col-sm-12">

        <div class="row">
          <div class="col-lg-3 col-md-3 col-4 font-weight-bold"><label>No. Control:</label></div>  
          <div class="col-lg-9 col-md-9 col-8"><label>{{ $vauchers[0]->fk_idAlumno }}</label><input type="hidden" name="no_control" id="no_control" value="{{ $vauchers[0]->fk_idAlumno }}"></div>  
        </div>

        <div class="row"> 
          <div class="col-lg-3 col-md-3 col-4 font-weight-bold"><label>Nombre:</label></div>  
          <div class="col-lg-9 col-md-9 col-8"><label>{{ $vau->nombre }} {{ $vau->ap_paterno }} {{ $vau->ap_materno }}</label></div>  
        </div>

        <div class="row">
          <div class="col-lg-3 col-md-3 col-4 font-weight-bold"><label>Carrera:</label></div>  
          <div class="col-lg-9 col-md-9 col-8"><label>{{ $vau->nombre_carrera }}</label></div>
        </div>

        <div class="row">
          <div class="col-lg-3 col-md-3 col-4 font-weight-bold"><label for="celular">Celular:</label></div>  
          <div class="col-lg-9 col-md-9 col-8"><label>{{ $vau->celular }}</label></div>  
        </div>

        

        <div class="row">
          <div class="col-lg-3 col-md-3 col-4 font-weight-bold"><label for="referencia">Servicio(s):</label></div>  
          <div class="col-lg-9 col-md-9 col-8"><label>{{ $vau->nombre_servicios }}</label></div>  
        </div>


      </div>    

      <div class="col-lg-4 col-md-12 col-sm-12">
        <div class="row">
          <div class="col-lg-6 col-md-6 col-4 text-lg-right text-sm-left font-weight-bold"><label for="referencia">Fecha de Subida:</label></div>  
          <div class="col-lg-6 col-md-6 col-8"><label>{{ $vau->created_at->format('d/m/Y') }}</label></div>  
        </div>

        <div class="row">
          <div class="col-lg-6 col-md-6 col-4 text-lg-right text-sm-left font-weight-bold"><label for="total">Total:</label></div>  
          <div class="col-lg-6 col-md-6 col-8"><label>$ {{ number_format($vau->total,2) }}</label></div>  
        </div>
      </div>  
    </div>

    
    <div class="row mt-3">
      @foreach($vauchers as $vaucher )
        @if($vauchers->count()==1)<div class="col-lg-12 col-md-12 col-sm-12 text-center">@else <div class="col-lg-6 col-md-12 col-sm-12 text-center"> @endif
          <a href="https://portal.itzitacuaro.edu.mx/pago/nuevo/public/vaucher/{{ $vaucher->periodo->nombre }}/{{ $vaucher->imagen }}" class="zoom"><img src="https://portal.itzitacuaro.edu.mx/pago/nuevo/public/vaucher/{{ $vaucher->periodo->nombre }}/{{ $vaucher->imagen }}" height="400px" style="max-width:300px; object-fit:contain;" /></a>
          <!--<a href="https://portal.itzitacuaro.edu.mx/pago/nuevo/public/vaucher/2021-1/10650121.jpg" class="zoom"><img src="https://portal.itzitacuaro.edu.mx/pago/nuevo/public/vaucher/2021-1/10650121.jpg" height="400px" style="max-width: 300px;" /></a>-->

          <div class="row mt-1">
            <div class="col-lg-6 col-md-6 col-4 text-right font-weight-bold"><label for="celular">Método de pago:</label></div>  
            <div class="col-lg-6 col-md-6 col-8 text-left"><label>{{ $vaucher->forma_pago->nombre }}</label></div>  
          </div>

          <div class="row mt-1">
            <div class="col-lg-6 col-md-6 col-4 text-right font-weight-bold"><label for="referencia">Referencia:</label></div>  
            <div class="col-lg-6 col-md-6 col-8 text-left"><label>{{ $vaucher->referencia }}</label></div>  
          </div>

          <div class="row mt-1">  
            <div class="col-lg-6 col-md-6 col-4 text-right font-weight-bold"><label for="importe">Importe:</label></div>  
            <div class="col-lg-6 col-md-6 col-8 text-left"><label>${{ number_format($vaucher->importe,2) }}</label></div>  
          </div>

          <div class="row mt-1">
            <div class="col-lg-6 col-md-6 col-4 text-right font-weight-bold"><label for="fecha_pago">Fecha de pago:</label></div>  
            <div class="col-lg-6 col-md-6 col-8 text-left"><label>{{ $vaucher->fecha_pago->format('d/m/Y') }}</label></div>  
          </div>

        </div>  
      @endforeach    
    </div>
    
    <div class="row mt-3">
      <div class="col-lg-12 col-md-12 col-sm-12 text-center">

        @if ($vaucher->fk_idEstado=='1' || $vaucher->fk_idEstado=='4')
          <div class="row mt-1">
            <div class="col-lg-2 col-md-2 col-1">&nbsp;</div>  
            <div class="col-lg-8 col-md-8 col-10"><textarea id="observacion" name="observacion" placeholder="Observación" class="form-control"></textarea></div>
            <div class="col-lg-2 col-md-2 col-1">&nbsp;</div>
          </div>

          <div class="row mt-3">
            <div class="col-md-3">&nbsp;</div>  
            @can('pagos_autorizar')
              <div class="col-md-3"><button type="button" class="btn btn-sm btn-success btn-block" onclick="autorizar_vaucher({{ $vaucher->id }},'alumno');">Autorizar</button></div>  
            @endcan
            @can('pagos_rechazar') 
              <div class="col-md-3"><button type="button" class="btn btn-sm btn-secondary btn-block" onclick="rechazar_vaucher('{{ $vau->ids_pagos }}','alumno');">Rechazar</button></div>  
            @endcan 
            <div class="col-md-3">&nbsp;</div>  
          </div>
        @endif

      </div>      
    </div>

  </form>
      
</div>