<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Rphonorarios excelt</title>
    <style>
        th{
            border: 1px solid black;
        }
    </style>
</head>
<body>
   <table border="1">
    <tr>
        <td colspan="20" style="text-align: center; font-size: 13px; color: #0000FF;" >FORMATO 8.1: REGISTRO DE HONORARIOS</td>
    </tr>
    <tr>
        <td colspan="20" style="font-size: 13px; color: #0000FF;" >{{$empresa->nempresa}}</td>
    </tr>
    <tr>
        <td colspan="20" style="font-size: 13px; color: #0000FF;" >{{$empresa->direccion}}</td>
    </tr>
    <tr>
        <td colspan="20" style="font-size: 13px; color: #0000FF;" >Ruc: {{$empresa->ruc}}</td>
    </tr>
    <tr>
        <td colspan="20" style="text-align: center; font-size: 12px; color: #0000FF;"><b >Registros de recibo por honorarios</b></td>
    </tr>
    <tr>
        <td colspan="20" style="text-align: center; font-size: 11px; color: #0000FF;">{{$fecha_spanish}}</td>
    </tr>
    <tr>
        <td colspan="20"></td>
    </tr>
    <thead>
        <tr>
            <th style="border: 1px solid black; font-size: 9px;text-align: center;">R/C</th>
            <th style="border: 1px solid black; font-size: 9px;text-align: center;">fec_emision</th>
            <th style="border: 1px solid black; font-size: 9px;text-align: center;">fec_vencimiento</th>
            <th style="border: 1px solid black; font-size: 9px;text-align: center;">Td</th>           
            <th style="border: 1px solid black; font-size: 9px;text-align: center;">Serie</th> 
            <th style="border: 1px solid black; font-size: 9px;text-align: center;">Numero</th>
            <th style="border: 1px solid black; font-size: 9px;text-align: center;">Tipo</th>
            <th style="border: 1px solid black; font-size: 9px;text-align: center;">Numero</th>
            <th style="border: 1px solid black; font-size: 9px;text-align: center;">Nombre o Razon Social</th>
            <th style="border: 1px solid black; font-size: 9px;text-align: center;">Importe en dolares</th>
            <th style="border: 1px solid black; font-size: 9px;text-align: center;">T/C</th>
            <th style="border: 1px solid black; font-size: 9px;text-align: center;">Base Imponible</th>
            <th style="border: 1px solid black; font-size: 9px;text-align: center;">Impuesto A la Renta</th>
            <th style="border: 1px solid black; font-size: 9px;text-align: center;">Total</th>
        </tr>
    </thead>
    <tbody>
        <?php 
            $total1=0;
            $total2=0;
            $total3=0;
            $total4=0;
        ?>
        @foreach($data as $c)
            <tr>
                <td style="font-size:8px; text-align: right;">{{$mes}}-{{ $c->codigo_num }}</td>
                <td style="font-size:8px; text-align: right;">{{ $c->fec_emision }}</td>
                <td style="font-size:8px; text-align: right;">{{ $c->fec_vencimiento }}</td>

                <td style="font-size:8px; text-align: right;">{{ $c->doc_cod }}</td>
                <td style="font-size:8px; text-align: right;">{{ $c->serie }}</td>
                <td style="font-size:8px; text-align: right;">{{ $c->numero }}</td>

                <td style="font-size:8px; text-align: right;">{{ $c->identidad_document_id }}</td>
                <td style="font-size:8px; text-align: right;">{{ $c->numero_identidad }}</td>
                <td style="font-size:8px; text-align: right;">{{ $c->nombre }}</td>
                <td style="font-size:8px; text-align: right;">{{ number_format($c->dolares,'2','.',',') }}</td>
                <td style="font-size:8px; text-align: right;">{{ $c->cambio }}</td>
                <td style="font-size:8px; text-align: right;">{{ number_format($c->totales,'2','.',',') }}</td>
                <td style="font-size:8px; text-align: right;">{{ number_format($c->hvalue,'2','.',',') }}</td>
                <td style="font-size:8px; text-align: right;">{{ number_format($c->totales,'2','.',',') }}</td>
            </tr>
              <?php 
                $total1+=$c->dolares;
                $total2+=$c->totales;
                $total3+=$c->hvalue;
            ?>
        @endforeach
        <tr>
            <td colspan="9">
                
            </td>
            <td style="text-align:right; border:1px solid black;">{{number_format($total1,'2','.',',')}}</td>
            <td style="text-align:right; border:1px solid black;"></td>
            <td style="text-align:right; border:1px solid black;">{{number_format($total2,'2','.',',')}}</td>
            <td style="text-align:right; border:1px solid black;">{{number_format($total3,'2','.',',')}}</td>
            <td style="text-align:right; border:1px solid black;">{{number_format($total2,'2','.',',')}}</td>
        </tr>
        <tr>
            <td colspan="22"></td>
        </tr>
    </tbody>
</table> 

</body>
</html>