<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Recibo</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <style>
        .cabecera {
            background-color: rgb(177, 177, 177);
            align-items: center;
            text-align: center;
            border-bottom: 2px solid;
            /* height: '150'; */
        }

        .detalle {
            border-bottom: 1px;
            align-items: center;
            text-align: center;
        }

        .detalle td {
            border-bottom: 1px solid;
        }

        .barcod {
            max-width: 400px;
            display: block;
        }

        .line {
            width: 112px;
            height: 47px;
            border-bottom: 1px solid black;
            position: absolute;
        }
    </style>
</head>

<body style="margin: 0; padding: 0;">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td>
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td width="30%" height="120px" align="center">

                            {{-- <img src="{{ storage_path() . '\app\public\documentos\logo\logo.PNG' }}" alt=""
                                style="max-height: 120px;"> --}}
                            <img src="{{ route('image.displayImage','jjj') }}" alt=""
                                style="max-height: 120px;">
                        </td>
                        <td width="70%">
                            <table cellpadding="0" cellspacing="0" width="100%"
                                style="border-radius:6px;border-collapse:separate;border:solid black 1px">
                                <tr style="border: 2px solid black">
                                <tr>
                                    {{-- <td align="center"><strong>{{ $parametrobo->nombrecia }}</strong></td> --}}
                                    <td align="center"><strong>COOPERATIVA DE TRANSPORTE DE PASAJEROS EN TAXI</strong>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        <h2>" 5 ESTRELLAS " .LTDA</h2>
                                    </td>
                                </tr>
                                <tr>
                                    <td><strong> Dirección: </strong><span style="font-size: 16px">{{ $parametro->direccion }}</span>
                                    </td>
                                </tr>
                                <tr>
                                    <td><strong> Telefono: </strong><span style="font-size: 16px">{{ $parametro->telefono1 }}</span><span
                                            style="font-size: 16px"> - {{ $parametro->email }}</span>
                                    </td>
                                </tr>
                                <tr>
                                    <td><strong> Ruc:</strong><span style="font-size: 16px">{{ $parametro->ruc }}</span>
                                    </td>
                                </tr>
                                <br>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="center">
                <h2>RECIBO DE INGRESO No. <span style="color: brown">{{ substr("000000000{$factura->num_documento}", -9) }}</span></h2>
            </td>
        </tr>
        <tr>
            <td>
                <table cellpadding="0" cellspacing="0" width="100%"
                    style="font-size:12px; border-radius:6px;border-collapse:separate;border:solid black 1px">
                    <tr>
                        <td width="33%">
                            <table>
                                <tr>
                                    <td><strong style="font-size: 16px">Cod Socio: </strong><span style="font-size: 15px">
                                        {{ $factura->id_socio }}     </span>
                                    </td>
                                </tr>
                                <tr>
                                    <td><strong style="font-size: 16px">Dirección: </strong><span
                                            style="font-size: 15px">{{ $factura->direccion }}</span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td width="33%">
                            <table>
                                <tr>
                                    <td><strong style="font-size: 16px">Nombre: </strong><span
                                            style="font-size: 15px">{{ $factura->cliente }}</span>
                                    </td>
                                </tr>
                                <tr>
                                    <td><strong style="font-size: 16px">Cedula: </strong><span
                                            style="font-size: 15px">{{ $factura->cedula }}</span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td width="33%">
                            <table>
                                <tr>
                                    <td><strong style="font-size: 16px">Fecha: </strong><span
                                            style="font-size: 15px">{{ $factura->fecha_ingreso }}</span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table style="margin-top:15px; font-size:10px;" width="100%">
                    <tr class="cabecera">
                        <td><strong style="font-size: 16px">Código</strong></td>
                        <td><strong style="font-size: 16px">Descripción</strong></td>
                        {{-- <td><strong style="font-size: 16px">Cantidad</strong></td> --}}
                        <td><strong style="font-size: 16px">Desc.</strong></td>
                        <td><strong style="font-size: 16px">IVA</strong></td>
                        <td><strong style="font-size: 16px">Total</strong></td>
                    </tr>
                    <br>
                    @foreach ($detalle as $item)
                        <tr class="detalle">
                            <td><span style="font-size: 13px">{{ $item->id_item }}</span></td>
                            <td><span style="font-size: 14px">{{ $item->item }}</span></td>
                            {{-- <td><span style="font-size: 13px">{{ $item->cantidad }}</span></td> --}}
                            <td><span style="font-size: 13px">{{ $item->descuento }}</span></td>
                            <td><span style="font-size: 13px">{{ $item->iva }}</span></td>
                            <td><span style="font-size: 13px">{{ $item->total }}</span></td>
                        </tr>
                    @endforeach
                    {{-- <tr class="detalle">
                        <td><span style="font-size: 14px">1</span></td>
                        <td><span style="font-size: 13px">CUOTAS ADMINISTRATIVAS1</span></td>
                        <td><span style="font-size: 14px">25.001</span></td>
                    </tr> --}}
                    {{-- @foreach ($detalles as $item)
                        <tr class="detalle">
                            <td>{{$item->ITEM}}</td>
                            <td>{{\App\ADMITEM::where(['ITEM' => $item->ITEM])->pluck('NOMBRE')->first()}}</td>
                            <td>{{intval($item->CANTFUN)}}</td>
                            <td>
                            @php 
                                if ($cabecera->TIPO == 'FAC') {
                                    echo(number_format($item->PRECIO,2,'.',','));
                                }else{
                                    if ($item->GRAVAIVA == 'S') {
                                        echo(number_format(($item->SUBTOTAL / intval($item->CANTFUN) * 1.12),2,'.',','));
                                    } else {
                                        echo(number_format($item->SUBTOTAL / intval($item->CANTFUN),2,'.',','));
                                    }
                                }
                            @endphp
                           </td>
                            <td>{{number_format($item->DESCUENTO,2,'.',',')}}</td>
                            <td>
                            @php
                                if ($cabecera->TIPO == 'FAC') {
                                    number_format($item->SUBTOTAL,2,'.',',');
                                }else{
                                    if ($item->GRAVAIVA == 'S') {
                                       echo(number_format($item->SUBTOTAL * (1.12),2,'.',','));
                                    } else {
                                        echo(number_format($item->SUBTOTAL,2,'.',','));
                                    }
                                }
                                @endphp
                            
                            </td>
                        </tr>   
                        @endforeach --}}
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table style="margin-top:15px; font-size:10px;" width="100%">
                    <tr>
                        <td align="left"><strong style="font-size: 14px">VALOR TOTAL</strong> </td>
                        <td align="left"><span style="font-size: 15px">  </span></td>
                        <td align="rigth"><span style="font-size: 15px"> {{ $factura->total }} </span></td>
                    </tr>
                </table>
            </td>
        </tr>
        <br>
        <tr>
            <td>
                <strong style="font-size: 14px">CONCEPTO: </strong><span style="font-size: 15px"> {{ $factura->concepto }} </span>
            </td>
        </tr>
        <tr>
            <td>
                <strong style="font-size: 14px">FORMA DE PAGO: </strong><span style="font-size: 15px">{{ $factura->metodo_pago=="CRE"?"CREDITO":"CONTADO" }}</span>
            </td>
        </tr>
        <br>
        <br>
        <br>
        <tr>
            <td>
                <table style="margin-top:15px; font-size:10px;" width="100%">
                    <tr>
                        <td align="left"><strong>RECIBI CONFORME</strong></td>
                        <td align="left"><strong>GERENTE</strong></td>
                    </tr>
                    <tr>
                        <td align="center">
                            <div class="line"></div>
                        </td>
                        <td align="center">
                            <div class="line"></div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>

</body>

</html>
