@extends('cr_blank')

@section('content')
{{-- <div class="text-center title">{{ $title }}</div> --}}
{{-- <div class="text-center">Periodo: {{ $mes }} - {{ $gestion }}</div> --}}
@php
    $label_fecha = 'Periodo: ' . $mes . ' - ' . $gestion;
@endphp
@include('reportes.components.pdf_header_reporte',[
    'titulo' => $title,
    'fechas' => $label_fecha,
])
{{-- <div>Mes: {{ $mes }}</div> --}}
{{-- <div>Gestión: {{ $gestion }}</div> --}}
@php
    $total = $data->sum('total');
@endphp
<table class="table-data bordes">
  <tr>
    <th>N.</th>
    <th>Fecha</th>
    <th>Código</th>
    <th>N° Comp.</th>
    <th>Contribuyente</th>
    <th>CI/NIT</th>
    <th>OTB</th>
    <th>Registrado por:</th>
    <th>Total</th>
  </tr>
  @foreach ($data as $item)
    <tr>
      <td class="text-center">{{ ++$i }}</td>
      <td class="text-center">{{ date('d/m/y H:i', strtotime($item->fecha)) }}</td>
      <td class="text-center">{{ $item->medidor->codigo }}</td>
      <td class="text-center">{{ $item->txt_nro }}</td>
      <td class="text-">{{ $item->razon_social }}</td>
      <td>{{ $item->ci_nit }}</td>
      <td>{{ $item->medidor->zona->nombre }}</td>
      <td>{{ $item->usuario->nombre_completo }}</td>
      <td class="text-center">{{ number_format($item->total,2) }}</td>
    </tr>
  @endforeach
    <tr>
        <td class="text-right no-margin-bottom no-margin-left negrita" colspan="8">TOTAL</td>
        <td class="text-center negrita">{{ number_format($total,2) }}</td>
    </tr>
</table>

{{-- <div>{{ $txt_total }}</div> --}}
    
@endsection

@section('scripts')
  <style>
    .title {
      font-size: 18px;
      font-weight: bold;
      text-transform: uppercase;
    }
    .table-data {
      width: 100%;
      font-size: 11px;
    }
    .bordes .no-margin {
      margin-top: 0;
      margin-bottom: 0;
      margin-left: 0;
      border: none;
    }
    .bordes .no-margin-top {
      margin-top: 0;
      border: none;
    }
    .bordes .no-margin-bottom {
      margin-bottom: 0;
      border: none;
    }
    .bordes .no-margin-left {
      margin-left: 0;
      border: none;
    }
  </style>
    
@endsection
