<?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>
                    
                    <?php if($data->estado_envio == "REGISTRADO"): ?>
                    <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">PENDIENTE - El comprobante se encuentra pendiente de envio a la SUNAT</div>                    
                    </div>
                    <?php else: ?>
                    <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>
                    <?php endif; ?>
                </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>
                        <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>
                        <td><?php echo e($detalle->venta->fecha_venta); ?></td>
                        <td><?php echo e($detalle->subtotal); ?></td>
                        <td><?php echo e($detalle->impuesto); ?></td>
                        <td class="positive"><?php echo e($detalle->venta->total_venta); ?></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 == "REGISTRADO"): ?>
                    <div class="ui small right floated orange button btn_cdr" data-id="<?php echo e($data->id_resumen); ?>"><i class="sync alternate icon"></i>Get CDR</div>
                <?php endif; ?>
                <?php if($data->estado_envio == "NO ENVIADO"): ?>
                    <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>
                <?php endif; ?>
                <?php if($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>
                    <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>
                <?php endif; ?>
                <?php if($data->estado_envio == "ACEPTADO"): ?>
                    <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(); ?>