<table style="width: 100%;">
    <tr>
        <td style="width: 20%;">
            @if ($config->foto_comp)
                <img style="height: 100px" src="{{ public_path($config->foto_comp) }}">
            @endif
        </td>
        <td style="width: 60%;">
            <div class="text-center title">servicio de agua y alcantarillado</div>
            <div class="text-center subtitle" style="font-size: 14px;">Copia {{ $subtitle }}</div>
            <div class="text-center title">{{ $title }}</div>
            @if ($data->estado == 'ANULADO')
                <div class="text-center txt-anulado">ANULADO</div>
            @endif
        </td>
        <td style="width: 20%;"></td>
    </tr>
</table>
<table style="width: 100%;">
    <tr class="text-center subtitle">
        <td style="width: 30%;">CI/NIT</td>
        <td style="width: 40%;">Nombre o Razón Social</td>
        <td style="width: 30%;">N° de comprobante</td>
    </tr>
    <tr class="text-center">
        <td>{{ $data->ci_nit }}</td>
        <td>{{ $data->razon_social }}</td>
        <td class="nro-comprobante">{{ $data->txt_nro }}</td>
    </tr>
</table>
<table style="width: 100%;">
    <tr class="text-center subtitle">
        <td style="width: 30%;">OTB</td>
        <td style="width: 20%;">Código</td>
        <td style="width: 25%;">Número de medidor</td>
        <td style="width: 25%;">Fecha de emisión</td>
    </tr>
    <tr class="text-center">
        <td>{{ $data->medidor->zona->nombre }}</td>
        <td>M{{ $data->medidor->manzano->nombre }} - {{ $data->medidor->lote }}{{ $data->medidor->sufijo }}</td>
        <td>{{ $data->medidor->numero }}</td>
        <td>{{ date('d/m/Y H:i', strtotime($data->fecha)) }}</td>
    </tr>
</table>

@php
    $total = $data->detalle->sum('monto');
    $consumo = $data->detalle->sum('consumo');
@endphp

<table class="table-data bordes">
  <tr>
    <th style="width: 4%;">N.</th>
    <th style="width: 71%;">Concepto</th>
    <th style="width: 10%;">Consumo (m3)</th>
    <th style="width: 15%;">Importe (Bs)</th>
  </tr>
  @foreach ($data->detalle as $item)
    <tr>
      <td class="text-center">{{ $loop->iteration }}</td>
      <td>{{ $item->detalle }}</td>
      <td class="text-center">{{ $item->consumo }}</td>
      <td class="text-center">{{ number_format($item->monto, 2) }}</td>
    </tr>
  @endforeach
  <tr>
    <td class="text-right no-margin-bottom no-margin-left negrita" colspan="2">TOTAL</td>
    <td class="text-center negrita">{{ $consumo }}</td>
    <td class="text-center negrita">{{ number_format($total, 2) }}</td>
  </tr>
</table>

<div>{{ $txt_total }}</div>

<table class="table-firmas">
    <tr class="text-center">
        <td style="width: 35%;"></td>
        <td style="width: 30%;">_______________________</td>
        <td style="width: 35%;"></td>
    </tr>
    <tr class="text-center cargo">
        {{-- <td style="width: 35%;">Contribuyente</td> --}}
        <td style="width: 35%;"></td>
        <td style="width: 30%;">Cajero</td>
        {{-- <td style="width: 35%;">G.A.M. Vinto</td> --}}
        <td style="width: 35%;"></td>
    </tr>
    <tr class="text-center">
        <td></td>
        <td>{{ $firmas[0] }}</td>
        <td></td>
        {{-- <td>{{ $firmas[1] }}</td> --}}
    </tr>
</table>
