<?php $__env->startSection('content'); ?>

    <div class="sixteen wide tablet sixteen wide computer column ">
        <div class="ui segment">
            
            <h4 class="ui dividing header teal centered">DETALLES DE RESUMEN DIARIO DE BOLETA</h4>

            <div class="ui info message">
                <div class="ui equal width grid">
                    <div class="row" style="padding-bottom: 0px !important">
                        <div class="sixteen wide mobile seven wide tablet  four wide computer column message_header">Tipo de Comprobante  :</div>
                        <div class="sixteen wide mobile nine wide tablet  twelve wide computer column">RESUMEN DIARIO DE BOLETAS</div>
                    </div>
                    <div class="row" style="padding-bottom: 0px !important">
                        <div class="sixteen wide mobile seven wide tablet  four wide computer column message_header">N° Resumen Diario :</div>
                        <div class="sixteen wide mobile nine wide tablet  twelve wide computer column"><?php echo e($data->nombre_resumen); ?></div>
                    </div>
                    <div class="row" style="padding-bottom: 0px !important">
                        <div class="sixteen wide mobile seven wide tablet  four wide computer column message_header">Comprobantes Enviados :</div>
                        <div class="sixteen wide mobile nine wide tablet  twelve wide computer column"><?php echo e($data->tipo_comprobante->nombre); ?></div>
                    </div>
                    
                    
                    <div class="row" style="padding-bottom: 0px !important">
                        <div class="sixteen wide mobile eight wide tablet four wide computer column message_header">Mensaje de envio a SUNAT :</div>
                        <div class="sixteen wide mobile eight wide tablet  twelve wide computer column"><?php echo e(($data->estado_envio)); ?> - <?php echo e($data->mensaje_envio); ?></div>
                    </div>
                    <div class="row" style="padding-bottom: 0px !important">
                        <div class="sixteen wide mobile eight wide tablet four wide computer column message_header">Fecha de Envio:</div>
                        <div class="sixteen wide mobile eight wide tablet  twelve wide computer column"><?php echo e(($data->updated_at)); ?></div>
                    </div>
                   
                </div>
            </div>
            
            <div class="ui hidden divider"></div>
            <table class="ui table">
                <thead>
                    <tr>
                        <th class="center aligned">N°</th>
                        <th class="center aligned">Boletas Enviadas</th>
                        <th class="center aligned">Fecha de Emision</th>
                        <th class="center aligned">Subtotal S/</th>
                        <th class="center aligned">Impuesto S/</th>
                        <th class="center aligned">Total S/</th>
                    </tr>
                </thead>
                <tbody id="tbody">
                    <?php /**/ $i = 1 /**/ ?>
                    <?php $__currentLoopData = $detalle_resumen; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $detalle): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr data-table="<?php echo e($detalle->id_detalle_venta); ?>">
                        <td><?php echo e($i); ?></td>
                        <?php if($data->id_tipo_comprobante == 2): ?>
                        <td><a href="<?php echo e(url('electronico/detalles/'.$detalle->id_venta)); ?>" title="Clic para ver informacion"><?php echo e($detalle->nombre_comprobante); ?></a></td>
                        <?php elseif($data->id_tipo_comprobante == 3): ?>
                        <td><a href="<?php echo e(url('nota/detalles/'.$detalle->id_nota)); ?>" title="Clic para ver informacion"><?php echo e($detalle->nombre_comprobante); ?></a></td>
                        <?php endif; ?>
                        <td><?php echo e($detalle->venta ? $detalle->venta->fecha_venta : $detalle->nota->fecha_emision); ?></td>
                        <td><?php echo e($detalle->subtotal); ?></td>
                        <td><?php echo e($detalle->impuesto); ?></td>
                        <td class="positive"><?php echo e($detalle->subtotal + $detalle->impuesto); ?></td>
                    </tr>
                    <?php /**/ $i++ /**/ ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>

            <div class="form_footer" >
                <a class="ui small left  floated default button" href="<?php echo e(URL::previous()); ?>"><i class="arrow left icon"></i>REGRESAR</a>

             
                <?php if($data->estado_envio == "NO ENVIADO" || $data->estado_envio == "PENDIENTE" || $data->estado_envio == "RECHAZADO"): ?>
                    <div class="ui small right floated red button btn_reenviar" data-id="<?php echo e($data->id_resumen); ?>"><i class="sync alternate icon"></i>Reenviar</div>
                    <div class="ui small right floated orange button btn_cdr" data-id="<?php echo e($data->id_resumen); ?>"><i class="sync alternate icon"></i>Obtener CDR</div>
                <?php endif; ?> 
                <?php if($data->estado_envio == "ACEPTADO" || $data->estado_envio == "RECHAZADO"): ?>
                    <a class="ui small right floated primary button" href="<?php echo e(url('../sunat/cdr/resumen/R-'.$empresa->ruc.'-'.$data->nombre_resumen.'.xml')); ?>" target="_blank"><i class="download icon"></i>Descargar CDR</a>
                <?php endif; ?>
                <a class="ui small right floated green button" href="<?php echo e(url('../sunat/xml/resumen/'.$empresa->ruc.'-'.$data->nombre_resumen.'.xml')); ?>" target="_blank"><i class="download icon"></i>Descargar XML</a>
            </div>  

        </div>
    </div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo e(asset('js/resumen/detalles.js')); ?>"></script>
<?php $__env->stopSection(); ?>



<?php echo $__env->make('layout.main', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>