<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Reporte</title>
<style type='text/css'>
    <? require('./Assets/css/' . $data['estilo']) ?>
</style>

</head>

<body style="padding: 0;">

    <table id="datos-empresa" cellpadding='5' style='margin-bottom:0px;'>
        <tr>
            <td class="logo" width='20%'>
                <img src="<?php echo base_url . 'Assets/img/logo-factura.png'; ?>" alt="" width='152'>
            </td>
            <td class="info-empresa" width='40%'>
                <table>
                    <tr><td style='background:#000;font-size:5mm;color:#fff;font-weight:bold;'>FACTURA</td></tr>
                    <tr><td style='font-size:4mm;color:#000;font-weight:bold;'><?php echo $data['empresa']['nombre']; ?></td></tr>
                    <tr><td style='font-size:4mm;color:#000;font-weight:bold;'>Distribuidora Multiversal AD, Sociedad Anonima</td></tr>                    
                    <tr><td style='font-size:3mm;color:#000;line-height:4mm;'>
                        <?php echo $data['empresa']['direccion']; ?><br/>
                        PBX: <?php echo $data['empresa']['telefono']; ?><br/>
                        <strong>NIT: <?php echo $data['empresa']['identidad']; ?></strong><br/>
                        <strong>PATENTE DE COMERCIO No. <span>13346-369-21</span></strong>
                    </td></tr>
                </table>
            </td>

            <td class="info-detalle" width='40%'>
                <table align='right'>
                    <tr><td style='font-size:4mm;color:#000;font-weight:bold;border-bottom:1px solid #333;' colspan='2'>Documento Tributario Electrónico</td></tr>
                    <tr><td style='font-size:3.5mm;color:#000;font-weight:bold;padding:0px;' colspan='2'>NÚMERO AUTORIZACIÓN</td></tr>
                    <tr><td style='font-size:3mm;color:#000;font-weight:bold;padding:0px;' colspan='2'><?php echo $data['venta']['autorizacion']; ?></td></tr>
                    <tr><td style='font-size:3.5mm;color:#000;font-weight:bold;padding:0px;'>Serie:</td><td style='font-size:3mm;color:#000;font-weight:bold;width:30mm;'><?php echo $data['venta']['seriefel']; ?></td></tr>
                    <tr><td style='font-size:3.5mm;color:#000;font-weight:bold;padding:0px;'>Número de DTE:</td><td style='font-size:3mm;color:#000;font-weight:bold;width:30mm;'><?php echo $data['venta']['numfel']; ?></td></tr>
                    <tr><td style='font-size:3.5mm;color:#000;font-weight:bold;padding:0px;' colspan='2'>Fecha y Hora de Certificación:</td></tr>
                    <tr><td style='font-size:3mm;color:#000;font-weight:bold;padding:0px;' colspan='2'><?php echo date('d/m/Y h:i:s A',strtotime($data['venta']['fechaproc'])); ?></td></tr>
                </table>
            </td>

        </tr>
    </table>

    <div id="container-info">
        <table>
            <tr>
                <td width='70%' style='vertical-align:top;'>
                    <p style='font-size:3.5mm;'><strong>DIA:</strong> <?php echo date('d',strtotime($data['venta']['fecha'])); ?>&nbsp;&nbsp;<strong>MES:</strong> <?php echo date('m',strtotime($data['venta']['fecha'])); ?>&nbsp;&nbsp;<strong>AÑO:</strong> <?php echo date('Y',strtotime($data['venta']['fecha'])); ?></p>
                    <p style='font-size:1mm;'>&nbsp;</p>
                    <p style='font-size:3.5mm;'><strong>NOMBRE:</strong> <?php echo $data['venta']['nomcliente']; ?></p>
                    <p style='font-size:3.5mm;'><strong>NIT:</strong> <?php echo $data['venta']['nitcliente']; ?></p>
                    <p style='font-size:3.5mm;'><strong>DIRECCIÓN:</strong> <?php echo $data['venta']['direccion']; ?></p><br/>
                    <p style='font-size:3.5mm;'><strong>CODIGO: </strong><span><?php echo $data['venta']['id_cliente']; ?></span>
                    &nbsp;&nbsp;&nbsp;&nbsp;<strong>VENDEDOR:</strong> <span><?php echo $data['venta']['id_vendedor']; ?></span>
                    &nbsp;&nbsp;&nbsp;&nbsp;<strong>FORMA DE PAGO:</strong><span>
                    
                    <?php 
                        if ($data['venta']['forma_pago'] == 1) 
                        {
                            $dataformapago = '<span class="badge badge-info">CONTADO</span>';
                        } else {
                            $dataformapago = '<span class="badge badge-warning">CREDITO</span>';
                        };
                    ?>
                    
                    <?php echo $dataformapago; ?></span></p><br/>

                </td>
                <td width='30%' style='text-align:center;'>
<!--                    <p style='font-size:3mm;'><strong>(LIBRE DE PROTESTO)</strong><br/>
                    ESTA FACTURA NO ES COMPROBANTE DE
                    PAGO, EXIJA EL RECIBO DE CAJA
                    CORRESPONDIENTE</p><br/>
-->                    
                    <p style='font-size:3.5mm;'><strong>SUJETO A PAGOS TRIMESTRALES ISR</strong></p><br/>
                    <p style='font-size:3.5mm;'><strong>CORRELATIVO # <span><?php echo $data['venta']['id']; ?></span></strong></p><br/>
                </td>                
            </tr>

        </table>
    </div>

    <div id="detalle-factura">
        <table id="container-producto" cellpadding='0' cellspacing='0'>
            <thead>
                <tr>
                    <th style='width:15mm;'>CODIGO</th>
                    <th style='width:18mm;'>CANTIDAD</th>
                    <th>DESCRIPCION</th>
                    <th style='width:20mm;'>PRECIO<BR/>UNITARIO</th>
                    <th style='width:20mm;'>IMPORTE</th>
                    <th style='width:23mm;border-right:0 none;'>IMPUESTO</th>
                </tr>
            </thead>
            <tbody>

                <?php
                $descuento = 0;
                $padding_init='padding-top:0.5mm;';
                foreach ($data['detalle'] as $producto) {
                    $descuento += $producto['descuento']; ?>
                    <tr>
                        <td style='text-align:right;<?php echo $padding_init;?>'><?php echo $producto['codigo']; ?></td>
                        <td style='text-align:right;<?php echo $padding_init;?>'><?php echo $producto['cantidad']; ?></td>
                        <td style='<?php echo $padding_init;?>'><?php echo $producto['descripcion']; ?></td>
                        <td style='text-align:right;<?php echo $padding_init;?>'>Q.<?php echo number_format($producto['precio'], 2); ?></td>
                        <td style='text-align:right;<?php echo $padding_init;?>'>Q.<?php echo number_format($producto['cantidad'] * $producto['precio'], 2); ?></td>
                        <td style='text-align:right;border-right:0 none;<?php echo $padding_init;?>'><small style='font-size:2mm;'>IVA</small> Q.<?php echo number_format($producto['iva'], 2); ?></td>
                    </tr>
                <?php
                        $padding_init='';
                    } 
                ?>
                <?php
                for($n=0;$n<(25-count($data['detalle']));$n++)
                {
                    ?>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td style='border-right:0 none;'>&nbsp;</td>
                    </tr>                    
                    <?php
                }
                ?>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td style='text-align:center;font-size:2.8mm;font-weight:bold;'>NO SE ACEPTAN CAMBIOS NI DEVOLUCIONES</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td style='border-right:0 none;'>&nbsp;</td>
                </tr>                
                
                <tr>
                    <td style='border-right:0.25mm solid #000;border-top:0.25mm solid #000;font-size:2.5mm;line-height:3mm;padding-top:1mm;padding-bottom:1mm;' colspan='3'>
                    <STRONG>TOTAL EN LETRAS</STRONG><BR/><?php echo $data['total_letras']; ?>
                    </td>
                    <td style='background-color:#b3b3b3;border-top:0.25mm solid #000;font-weight:bold;font-size:3mm;text-align:right'>TOTAL</td>
                    <td style='border-right:0.25mm solid #000;border-top:0.25mm solid #000;text-align:right;font-weight:bold;font-size:3mm;'>Q.<?php echo number_format($data['venta']['total'], 2); ?></td>
                    <td style='background-color:#b3b3b3;border-right:0 none;border-top:0.25mm solid #000;'>&nbsp;</td>
                </tr>                

            </tbody>
        </table>
    </div>
    
    <div id='anotacion_qr'>
<!--
        <strong style='font-size:4mm;'>CONDICIONES DE ENTREGA:</strong><br/>
        <strong>TRANSPORTE:</strong><br/>
-->        
        <strong>OBSERVACIONES:</strong><br/><br/><?php echo nl2br($data['venta']['anotacion']); ?>
    </div>
    <div id='certificador'>
        <strong>CERTIFICADOR:</strong> MEGAPRINT, S.A. <strong>NIT:</strong> 50510231
    </div>

    <div id='firma_sello'>FIRMA Y SELLO DEL COMPRADOR-CLIENTE</div>
    <div id='firma_nombre'>NOMBRE:</div>
    <div id='firma_dpi'>DPI No.:</div>
    <div id='por_divemosa'>POR DIVEMOSA</div>
    <div id='hoja'>1. ORIGINAL CLIENTE</div>

    <div id='qrimage'>
        <BR></BR>
        <BR></BR>
        <BR></BR>
        <img src='<?php echo $data['qr']; ?>'/><br/>VERIFICACIÓN SAT
    </div>

<pagebreak />

<table id="datos-empresa" cellpadding='5' style='margin-bottom:0px;'>
        <tr>
            <td class="logo" width='20%'>
                <img src="<?php echo base_url . 'Assets/img/logo-factura.png'; ?>" alt="" width='152'>
            </td>
            <td class="info-empresa" width='40%'>
                <table>
                    <tr><td style='background:#000;font-size:5mm;color:#fff;font-weight:bold;'>FACTURA</td></tr>
                    <tr><td style='font-size:4mm;color:#000;font-weight:bold;'><?php echo $data['empresa']['nombre']; ?></td></tr>
                    <tr><td style='font-size:4mm;color:#000;font-weight:bold;'>Distribuidora Multiversal AD, Sociedad Anonima</td></tr>                    
                    <tr><td style='font-size:3mm;color:#000;line-height:4mm;'>
                        <?php echo $data['empresa']['direccion']; ?><br/>
                        PBX: <?php echo $data['empresa']['telefono']; ?><br/>
                        <strong>NIT: <?php echo $data['empresa']['identidad']; ?></strong><br/>
                        <strong>PATENTE DE COMERCIO No. <span>13346-369-21</span></strong>
                    </td></tr>
                </table>
            </td>

            <td class="info-detalle" width='40%'>
                <table align='right'>
                    <tr><td style='font-size:4mm;color:#000;font-weight:bold;border-bottom:1px solid #333;' colspan='2'>Documento Tributario Electrónico</td></tr>
                    <tr><td style='font-size:3.5mm;color:#000;font-weight:bold;padding:0px;' colspan='2'>NÚMERO AUTORIZACIÓN</td></tr>
                    <tr><td style='font-size:3mm;color:#000;font-weight:bold;padding:0px;' colspan='2'><?php echo $data['venta']['autorizacion']; ?></td></tr>
                    <tr><td style='font-size:3.5mm;color:#000;font-weight:bold;padding:0px;'>Serie:</td><td style='font-size:3mm;color:#000;font-weight:bold;width:30mm;'><?php echo $data['venta']['seriefel']; ?></td></tr>
                    <tr><td style='font-size:3.5mm;color:#000;font-weight:bold;padding:0px;'>Número de DTE:</td><td style='font-size:3mm;color:#000;font-weight:bold;width:30mm;'><?php echo $data['venta']['numfel']; ?></td></tr>
                    <tr><td style='font-size:3.5mm;color:#000;font-weight:bold;padding:0px;' colspan='2'>Fecha y Hora de Certificación:</td></tr>
                    <tr><td style='font-size:3mm;color:#000;font-weight:bold;padding:0px;' colspan='2'><?php echo date('d/m/Y h:i:s A',strtotime($data['venta']['fechaproc'])); ?></td></tr>
                </table>
            </td>

        </tr>
    </table>

    <div id="container-info">
        <table>
            <tr>
                <td width='70%' style='vertical-align:top;'>
                    <p style='font-size:3.5mm;'><strong>DIA:</strong> <?php echo date('d',strtotime($data['venta']['fecha'])); ?>&nbsp;&nbsp;<strong>MES:</strong> <?php echo date('m',strtotime($data['venta']['fecha'])); ?>&nbsp;&nbsp;<strong>AÑO:</strong> <?php echo date('Y',strtotime($data['venta']['fecha'])); ?></p>
                    <p style='font-size:1mm;'>&nbsp;</p>
                    <p style='font-size:3.5mm;'><strong>NOMBRE:</strong> <?php echo $data['venta']['nomcliente']; ?></p>
                    <p style='font-size:3.5mm;'><strong>NIT:</strong> <?php echo $data['venta']['nitcliente']; ?></p>
                    <p style='font-size:3.5mm;'><strong>DIRECCIÓN:</strong> <?php echo $data['venta']['direccion']; ?></p><br/>
                    <p style='font-size:3.5mm;'><strong>CODIGO: </strong><span><?php echo $data['venta']['id_cliente']; ?></span>
                    &nbsp;&nbsp;&nbsp;&nbsp;<strong>VENDEDOR:</strong> <span><?php echo $data['venta']['id_vendedor']; ?></span>
                    &nbsp;&nbsp;&nbsp;&nbsp;<strong>FORMA DE PAGO:</strong><span>
                    
                    <?php 
                        if ($data['venta']['forma_pago'] == 1) 
                        {
                            $dataformapago = '<span class="badge badge-info">CONTADO</span>';
                        } else {
                            $dataformapago = '<span class="badge badge-warning">CREDITO</span>';
                        };
                    ?>
                    
                    <?php echo $dataformapago; ?></span></p><br/>


                </td>
                    <td width='30%' style='text-align:center;'>
<!--                    <p style='font-size:3mm;'><strong>(LIBRE DE PROTESTO)</strong><br/>
                    ESTA FACTURA NO ES COMPROBANTE DE
                    PAGO, EXIJA EL RECIBO DE CAJA
                    CORRESPONDIENTE</p><br/>
                    -->                    
                    <p style='font-size:3.5mm;'><strong>SUJETO A PAGOS TRIMESTRALES</strong></p><br/>
                    <p style='font-size:3.5mm;'><strong>CORRELATIVO # <span><?php echo $data['venta']['id']; ?></span></strong></p><br/>
                </td>                
            </tr>

        </table>
    </div>

    <div id="detalle-factura">
        <table id="container-producto" cellpadding='0' cellspacing='0'>
            <thead>
                <tr>
                    <th style='width:15mm;'>CODIGO</th>
                    <th style='width:18mm;'>CANTIDAD</th>
                    <th>DESCRIPCION</th>
                    <th style='width:20mm;'>PRECIO<BR/>UNITARIO</th>
                    <th style='width:20mm;'>IMPORTE</th>
                    <th style='width:23mm;border-right:0 none;'>IMPUESTO</th>
                </tr>
            </thead>
            <tbody>

                <?php
                $descuento = 0;
                $padding_init='padding-top:0.5mm;';
                foreach ($data['detalle'] as $producto) {
                    $descuento += $producto['descuento']; ?>
                    <tr>
                        <td style='text-align:right;<?php echo $padding_init;?>'><?php echo $producto['codigo']; ?></td>
                        <td style='text-align:right;<?php echo $padding_init;?>'><?php echo $producto['cantidad']; ?></td>
                        <td style='<?php echo $padding_init;?>'><?php echo $producto['descripcion']; ?></td>
                        <td style='text-align:right;<?php echo $padding_init;?>'>Q.<?php echo number_format($producto['precio'], 2); ?></td>
                        <td style='text-align:right;<?php echo $padding_init;?>'>Q.<?php echo number_format($producto['cantidad'] * $producto['precio'], 2); ?></td>
                        <td style='text-align:right;border-right:0 none;<?php echo $padding_init;?>'><small style='font-size:2mm;'>IVA</small> Q.<?php echo number_format($producto['iva'], 2); ?></td>
                    </tr>
                <?php
                        $padding_init='';
                    } 
                ?>
                <?php
                for($n=0;$n<(25-count($data['detalle']));$n++)
                {
                    ?>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td style='border-right:0 none;'>&nbsp;</td>
                    </tr>                    
                    <?php
                }
                ?>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td style='text-align:center;font-size:2.8mm;font-weight:bold;'>NO SE ACEPTAN CAMBIOS NI DEVOLUCIONES</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td style='border-right:0 none;'>&nbsp;</td>
                </tr>                
                
                <tr>
                    <td style='border-right:0.25mm solid #000;border-top:0.25mm solid #000;font-size:2.5mm;line-height:3mm;padding-top:1mm;padding-bottom:1mm;' colspan='3'>
                    <STRONG>TOTAL EN LETRAS</STRONG><BR/><?php echo $data['total_letras']; ?>
                    </td>
                    <td style='background-color:#b3b3b3;border-top:0.25mm solid #000;font-weight:bold;font-size:3mm;text-align:right'>TOTAL</td>
                    <td style='border-right:0.25mm solid #000;border-top:0.25mm solid #000;text-align:right;font-weight:bold;font-size:3mm;'>Q.<?php echo number_format($data['venta']['total'], 2); ?></td>
                    <td style='background-color:#b3b3b3;border-right:0 none;border-top:0.25mm solid #000;'>&nbsp;</td>
                </tr>                

            </tbody>
        </table>
    </div>
    
    <div id='anotacion_qr'>
<!--
        <strong style='font-size:4mm;'>CONDICIONES DE ENTREGA:</strong><br/>
        <strong>TRANSPORTE:</strong><br/>
-->        
        <strong>OBSERVACIONES:</strong><br/><br/> <?php echo nl2br($data['venta']['anotacion']); ?>
    </div>
    <div id='certificador'>
        <strong>CERTIFICADOR:</strong> MEGAPRINT, S.A. <strong>NIT:</strong> 50510231
    </div>

    <div id='firma_sello'>FIRMA Y SELLO DEL COMPRADOR-CLIENTE</div>
    <div id='firma_nombre'>NOMBRE:</div>
    <div id='firma_dpi'>DPI No.:</div>
    <div id='por_divemosa'>POR DIVEMOSA</div>
    <div id='hoja'>2. DUPLICADO CONTABILIDAD-BODEGA</div>

    <div id='qrimage'>
    <BR></BR>
    <BR></BR>
    <BR></BR>

        <img src='<?php echo $data['qr']; ?>'/><br/>VERIFICACIÓN SAT
    </div>

<pagebreak />

<table id="datos-empresa" cellpadding='5' style='margin-bottom:0px;'>
        <tr>
            <td class="logo" width='20%'>
                <img src="<?php echo base_url . 'Assets/img/logo-factura.png'; ?>" alt="" width='152'>
            </td>
            <td class="info-empresa" width='40%'>
                <table>
                    <tr><td style='background:#000;font-size:5mm;color:#fff;font-weight:bold;'>FACTURA</td></tr>
                    <tr><td style='font-size:4mm;color:#000;font-weight:bold;'><?php echo $data['empresa']['nombre']; ?></td></tr>
                    <tr><td style='font-size:4mm;color:#000;font-weight:bold;'>Distribuidora Multiversal AD, Sociedad Anonima</td></tr>                    
                    <tr><td style='font-size:3mm;color:#000;line-height:4mm;'>
                        <?php echo $data['empresa']['direccion']; ?><br/>
                        PBX: <?php echo $data['empresa']['telefono']; ?><br/>
                        <strong>NIT: <?php echo $data['empresa']['identidad']; ?></strong><br/>
                        <strong>PATENTE DE COMERCIO No. <span>13346-369-21</span></strong>
                    </td></tr>
                </table>
            </td>

            <td class="info-detalle" width='40%'>
                <table align='right'>
                    <tr><td style='font-size:4mm;color:#000;font-weight:bold;border-bottom:1px solid #333;' colspan='2'>Documento Tributario Electrónico</td></tr>
                    <tr><td style='font-size:3.5mm;color:#000;font-weight:bold;padding:0px;' colspan='2'>NÚMERO AUTORIZACIÓN</td></tr>
                    <tr><td style='font-size:3mm;color:#000;font-weight:bold;padding:0px;' colspan='2'><?php echo $data['venta']['autorizacion']; ?></td></tr>
                    <tr><td style='font-size:3.5mm;color:#000;font-weight:bold;padding:0px;'>Serie:</td><td style='font-size:3mm;color:#000;font-weight:bold;width:30mm;'><?php echo $data['venta']['seriefel']; ?></td></tr>
                    <tr><td style='font-size:3.5mm;color:#000;font-weight:bold;padding:0px;'>Número de DTE:</td><td style='font-size:3mm;color:#000;font-weight:bold;width:30mm;'><?php echo $data['venta']['numfel']; ?></td></tr>
                    <tr><td style='font-size:3.5mm;color:#000;font-weight:bold;padding:0px;' colspan='2'>Fecha y Hora de Certificación:</td></tr>
                    <tr><td style='font-size:3mm;color:#000;font-weight:bold;padding:0px;' colspan='2'><?php echo date('d/m/Y h:i:s A',strtotime($data['venta']['fechaproc'])); ?></td></tr>
                </table>
            </td>

        </tr>
    </table>

    <div id="container-info">
        <table>
            <tr>
                <td width='70%' style='vertical-align:top;'>
                    <p style='font-size:3.5mm;'><strong>DIA:</strong> <?php echo date('d',strtotime($data['venta']['fecha'])); ?>&nbsp;&nbsp;<strong>MES:</strong> <?php echo date('m',strtotime($data['venta']['fecha'])); ?>&nbsp;&nbsp;<strong>AÑO:</strong> <?php echo date('Y',strtotime($data['venta']['fecha'])); ?></p>
                    <p style='font-size:1mm;'>&nbsp;</p>
                    <p style='font-size:3.5mm;'><strong>NOMBRE:</strong> <?php echo $data['venta']['nomcliente']; ?></p>
                    <p style='font-size:3.5mm;'><strong>NIT:</strong> <?php echo $data['venta']['nitcliente']; ?></p>
                    <p style='font-size:3.5mm;'><strong>DIRECCIÓN:</strong> <?php echo $data['venta']['direccion']; ?></p><br/>
                    <p style='font-size:3.5mm;'><strong>CODIGO: </strong><span><?php echo $data['venta']['id_cliente']; ?></span>
                    &nbsp;&nbsp;&nbsp;&nbsp;<strong>VENDEDOR:</strong> <span><?php echo $data['venta']['id_vendedor']; ?></span>
                    &nbsp;&nbsp;&nbsp;&nbsp;<strong>FORMA DE PAGO:</strong><span>
                    
                    <?php 
                        if ($data['venta']['forma_pago'] == 1) 
                        {
                            $dataformapago = '<span class="badge badge-info">CONTADO</span>';
                        } else {
                            $dataformapago = '<span class="badge badge-warning">CREDITO</span>';
                        };
                    ?>
                    
                    <?php echo $dataformapago; ?></span></p><br/>


                </td>
                    <td width='30%' style='text-align:center;'>
<!--                    <p style='font-size:3mm;'><strong>(LIBRE DE PROTESTO)</strong><br/>
                    ESTA FACTURA NO ES COMPROBANTE DE
                    PAGO, EXIJA EL RECIBO DE CAJA
                    CORRESPONDIENTE</p><br/>
                    -->                    
                    <p style='font-size:3.5mm;'><strong>SUJETO A PAGOS TRIMESTRALES</strong></p><br/>
                    <p style='font-size:3.5mm;'><strong>CORRELATIVO # <span><?php echo $data['venta']['id']; ?></span></strong></p><br/>
                </td>                
            </tr>

        </table>
    </div>

    <div id="detalle-factura">
        <table id="container-producto" cellpadding='0' cellspacing='0'>
            <thead>
                <tr>
                    <th style='width:15mm;'>CODIGO</th>
                    <th style='width:18mm;'>CANTIDAD</th>
                    <th>DESCRIPCION</th>
                    <th style='width:20mm;'>PRECIO<BR/>UNITARIO</th>
                    <th style='width:20mm;'>IMPORTE</th>
                    <th style='width:23mm;border-right:0 none;'>IMPUESTO</th>
                </tr>
            </thead>
            <tbody>

                <?php
                $descuento = 0;
                $padding_init='padding-top:0.5mm;';
                foreach ($data['detalle'] as $producto) {
                    $descuento += $producto['descuento']; ?>
                    <tr>
                        <td style='text-align:right;<?php echo $padding_init;?>'><?php echo $producto['codigo']; ?></td>
                        <td style='text-align:right;<?php echo $padding_init;?>'><?php echo $producto['cantidad']; ?></td>
                        <td style='<?php echo $padding_init;?>'><?php echo $producto['descripcion']; ?></td>
                        <td style='text-align:right;<?php echo $padding_init;?>'>Q.<?php echo number_format($producto['precio'], 2); ?></td>
                        <td style='text-align:right;<?php echo $padding_init;?>'>Q.<?php echo number_format($producto['cantidad'] * $producto['precio'], 2); ?></td>
                        <td style='text-align:right;border-right:0 none;<?php echo $padding_init;?>'><small style='font-size:2mm;'>IVA</small> Q.<?php echo number_format($producto['iva'], 2); ?></td>
                    </tr>
                <?php
                        $padding_init='';
                    } 
                ?>
                <?php
                for($n=0;$n<(25-count($data['detalle']));$n++)
                {
                    ?>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td style='border-right:0 none;'>&nbsp;</td>
                    </tr>                    
                    <?php
                }
                ?>
                <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td style='text-align:center;font-size:2.8mm;font-weight:bold;'>NO SE ACEPTAN CAMBIOS NI DEVOLUCIONES</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td style='border-right:0 none;'>&nbsp;</td>
                </tr>                
                
                <tr>
                    <td style='border-right:0.25mm solid #000;border-top:0.25mm solid #000;font-size:2.5mm;line-height:3mm;padding-top:1mm;padding-bottom:1mm;' colspan='3'>
                    <STRONG>TOTAL EN LETRAS</STRONG><BR/><?php echo $data['total_letras']; ?>
                    </td>
                    <td style='background-color:#b3b3b3;border-top:0.25mm solid #000;font-weight:bold;font-size:3mm;text-align:right'>TOTAL</td>
                    <td style='border-right:0.25mm solid #000;border-top:0.25mm solid #000;text-align:right;font-weight:bold;font-size:3mm;'>Q.<?php echo number_format($data['venta']['total'], 2); ?></td>
                    <td style='background-color:#b3b3b3;border-right:0 none;border-top:0.25mm solid #000;'>&nbsp;</td>
                </tr>                

            </tbody>
        </table>
    </div>
    
    <div id='anotacion_qr'>
<!--
        <strong style='font-size:4mm;'>CONDICIONES DE ENTREGA:</strong><br/>
        <strong>TRANSPORTE:</strong><br/>
-->        
        <strong>OBSERVACIONES:</strong><br/><br/> <?php echo nl2br($data['venta']['anotacion']); ?>
    </div>
    <div id='certificador'>
        <strong>CERTIFICADOR:</strong> MEGAPRINT, S.A. <strong>NIT:</strong> 50510231
    </div>

    <div id='firma_sello'>FIRMA Y SELLO DEL COMPRADOR-CLIENTE</div>
    <div id='firma_nombre'>NOMBRE:</div>
    <div id='firma_dpi'>DPI No.:</div>
    <div id='por_divemosa'>POR DIVEMOSA</div>
    <div id='hoja'>3. TRIPLICADO CLIENTE</div>

    <div id='qrimage'>
    <BR></BR>
    <BR></BR>
    <BR></BR>

        <img src='<?php echo $data['qr']; ?>'/><br/>VERIFICACIÓN SAT
    </div>


</body>

</html>
