<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <style type="text/css">
        {% include 'assets/style.css' %}
    </style>
</head>
<body class="white-bg">
{% set cp = doc.company %}
{% set fecGen = doc.fecGeneracion|date('d/m/Y') %}
<table width="100%">
    <tbody><tr>
        <td style="padding:30px; !important">
            <table width="100%" height="200px" border="0" aling="center" cellpadding="0" cellspacing="0">
                <tbody><tr>
                    <td width="50%" height="90" align="center">
                        <span><img src="{{ params.system.logo|image_b64 }}" height="80" style="text-align:center" border="0"></span>
                    </td>
                    <td width="5%" height="40" align="center"></td>
                    <td width="45%" rowspan="2" valign="bottom" style="padding-left:0">
                        <div class="tabla_borde">
                            <table width="100%" border="0" height="200" cellpadding="6" cellspacing="0">
                                <tbody><tr><td align="center">
                                    {% if 'RA' in doc.name %}
                                        <span style="font-family:Tahoma, Geneva, sans-serif; font-size:29px" text-align="center">COMUNICACIÓN</span>
                                        <br>
                                        <span style="font-family:Tahoma, Geneva, sans-serif; font-size:19px" text-align="center">D E&nbsp;&nbsp;&nbsp;B A J A S</span>
                                    {% else %}
                                        <span style="font-family:Tahoma, Geneva, sans-serif; font-size:29px" text-align="center">RESUMEN DIARIO DE</span>
                                        <br>
                                        <span style="font-family:Tahoma, Geneva, sans-serif; font-size:19px" text-align="center">REVERSIONES</span>
                                    {% endif %}
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        <span style="font-size:15px" text-align="center">R.U.C.: {{ cp.ruc }}</span>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        No.: <span>{{ doc.correlativo }}</span>
                                    </td>
                                </tr>
                                </tbody></table>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td valign="bottom" style="padding-left:0">
                        <div class="tabla_borde">
                            <table width="96%" height="100%" border="0" border-radius="" cellpadding="9" cellspacing="0">
                                <tbody><tr>
                                    <td align="center">
                                        <strong><span style="font-size:15px">{{ cp.razonSocial }}</span></strong>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="left">
                                        <strong>Dirección: </strong>{{ cp.address.direccion }}
                                    </td>
                                </tr>
                                <tr>
                                    <td align="left">
                                        {{ params.user.header|raw }}
                                    </td>
                                </tr>
                                </tbody></table>
                        </div>
                    </td>
                </tr>
                </tbody></table>
            <div class="tabla_borde">
                <table width="100%" border="0" cellpadding="5" cellspacing="0">
                    <tbody><tr>
                        <td width="60%" height="15" align="left"><strong>Fecha de Comunicación:</strong>  {{ doc.fecComunicacion|date('d/m/Y') }}</td>
                        <td width="40%" height="15" align="left"><strong>Fecha de Generación:</strong>  {{ fecGen }}</td>
                    </tr>
                    </tbody></table>
            </div><br>
            <div class="tabla_borde">
                <table width="100%" border="0" cellpadding="5" cellspacing="0">
                    <tbody>
                    <tr>
                        <td align="center" class="bold">Fecha</td>
                        <td align="center" class="bold">Tipo de Documento</td>
                        <td align="center" class="bold">Nro. de Documento</td>
                        <td align="center" class="bold">Motivo</td>
                    </tr>
                    {% for det in doc.details %}
                        <tr class="border_top">
                            <td align="center">{{ fecGen }}</td>
                            <td align="center">{{ det.tipoDoc|catalog('01') }}</td>
                            <td align="center">{{ det.serie }}-{{ det.correlativo }}</td>
                            <td align="center" width="300px">{{ det.desMotivoBaja }}</td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table></div>
            <br>
            {% if max_items is defined and doc.details|length > max_items %}
                <div style="page-break-after:always;"></div>
            {% endif %}
            {% if params.system.hash is defined and params.system.hash %}
            <div>
                <blockquote>
                    <strong>Resumen:</strong>   {{ params.system.hash }}
                </blockquote>
            </div>
            {% endif %}
        </td>
    </tr>
    </tbody></table>
</body></html>