<?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 COMPROBANTE DADO DE BAJA</h4>
            
            <div class="ui warning message">
                <div class="ui equal width grid">
                    <div class="row" style="padding-bottom: 0px !important">
                        <div class="sixteen wide mobile seven wide tablet  five wide computer column message_header">Personal que registró la baja :</div>
                        <div class="sixteen wide mobile nine wide tablet  eleven wide computer column"><?php echo e(ucwords(mb_strtolower($data->usuario->nombres))); ?> <?php echo e(ucwords(mb_strtolower($data->usuario->apellidos))); ?> (<?php echo e($data->usuario->username); ?>)</div>
                    </div>
                    <div class="row" style="padding-bottom: 0px !important">
                        <div class="sixteen wide mobile seven wide tablet  five wide computer column message_header">Fecha que se dio de baja :</div>
                        <div class="sixteen wide mobile nine wide tablet  eleven wide computer column"><?php echo e(ucwords(mb_strtolower($data->created_at))); ?></div>
                    </div>
                    <div class="row" style="padding-bottom: 0px !important">
                        <div class="sixteen wide mobile eight wide tablet  five wide computer column message_header">Tienda donde se realizó se dio de baja:</div>
                        <div class="sixteen wide mobile eight wide tablet  eleven wide computer column"><?php echo e(ucwords(mb_strtolower($data->local->nombre))); ?> (<?php echo e(ucwords(mb_strtolower($data->local->direccion))); ?>)</div>
                    </div>
                </div>
            </div>    

            <div class="ui info message">
                <div class="ui equal width grid">
                    <div class="row" style="padding-bottom: 0px !important">
                        <div class="sixteen wide mobile eight wide tablet four wide computer column message_header">Tipo de Comprobante :</div>
                        <div class="sixteen wide mobile eight wide tablet four wide computer column"><?php echo e($data->tipo_comprobante->nombre); ?></div>

                        <div class="sixteen wide mobile eight wide tablet four wide computer column message_header">N° Comprobante :</div>

                        <?php if($data->id_tipo_comprobante == 1 ||  $data->id_tipo_comprobante == 2): ?>
                        <div class="sixteen wide mobile eight wide tablet four wide computer column"><a href="<?php echo e(url('venta/detalles/'.$data->id_venta)); ?>"><?php echo e($data->serie); ?>-<?php echo e($data->numero); ?></a></div>
                        <?php endif; ?>
                        <?php if($data->id_tipo_comprobante == 3 ||  $data->id_tipo_comprobante == 4): ?>
                        <div class="sixteen wide mobile eight wide tablet four wide computer column"><a href="<?php echo e(url('nota/detalles/'.$data->id_nota)); ?>"><?php echo e($data->serie); ?>-<?php echo e($data->numero); ?></a></div>
                        <?php endif; ?>
                    </div>
                    <div class="row" style="padding-bottom: 0px !important">
                        <div class="sixteen wide mobile eight wide tablet four wide computer column message_header">Motivo de Baja :</div>
                        <div class="sixteen wide mobile eight wide tablet four wide computer column"><?php echo e($data->motivo); ?></div>
                        <div class="sixteen wide mobile eight wide tablet four wide computer column message_header">Fecha de Referencia:</div>
                         <div class="sixteen wide mobile eight wide tablet four wide computer column"><?php echo e($data->fecha_referencia); ?></div>
                    </div>
                </div>
            </div>
             
            <div class="ui success message">
                <div class="ui equal width grid">    
                    
                
                    
                    <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>


            <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 == "PENDIENTE"): ?>
                    <div class="ui small right floated orange button btn_cdr" data-id="<?php echo e($data->id_baja); ?>"><i class="sync alternate icon"></i>Obtener CDR</div>
                <?php endif; ?> 
                <?php if($data->estado_envio == "NO ENVIADO" || $data->estado_envio == "PENDIENTE"): ?>
                    <div class="ui small right floated red button btn_reenviar" data-id="<?php echo e($data->id_baja); ?>"><i class="sync alternate icon"></i>Reenviar</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/bajas/R-'.$empresa->ruc.'-'.$data->nombre_baja.'.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/bajas/'.$empresa->ruc.'-'.$data->nombre_baja.'.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/baja/detalles.js')); ?>"></script>
<?php $__env->stopSection(); ?>




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