<div>
    <!--*******************************************************************-->
    <!--** NOMBRE DEL COMPOTENTE: PANEL DE pago                       **-->
    <!--** AUTOR: JOUNNERTH TORRES                                       **-->
    <!--** FECHA DE ACTUALIZACION: 08/04/2023                            **-->
    <!--**---------------------------------------------------------------**-->
    <!--** CONTROLADOR:  pago/Listadopago                        **-->
    <!--**---------------------------------------------------------------**-->
    <!--** ESTE COMPONENTE SIRVE PARA LISTAR TODOSLOS  pagoS DEL      **-->
    <!--** SISTEMA Y ESTA COMPUESTO POR:                                 **-->
    <!--**   # TABLA DONDE SE DESPLIEGA LA LISTA DE pagoS             **-->
    <!--**   # BARRA DE BUSQUEDA                                         **-->
    <!--**   # PANEL ADMINISTRATIVO                                      **-->
    <!--*******************************************************************-->
    <?php $__env->startSection('titulo'); ?>
        Pagos
    <?php $__env->stopSection(); ?>
    <img src="/public/img/fotos_perfil/gravatar_user.png" alt="">
    <div class="container-fluid">
        <div class="py-0">
            <!--*******************************************************************-->
            <!--** MENSAJE O NOTIFICACION                                        **-->
            <!--*******************************************************************-->
            <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.card.pago','data' => []]); ?>
<?php $component->withName('card.pago'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
                 <?php $__env->slot('card_head', null, []); ?> 
                    <!--****************************************************-->
                    <!--** TABLA PC                                    **-->
                    <!--****************************************************-->
                    <div class="d-none d-sm-block">
                        <table class="table table-sm">
                            <tr class="alert-primary azul-intenzo">
                                <td>
                                    <small><strong>Datos del paciente</strong></small>
                                </td>
                                <td>
                                    <small><strong>NRO Factura</strong></small>
                                </td>
                                <td>
                                    <small><strong>Monto total</strong></small>
                                </td>
                                <td>
                                    <small><strong>Monto pagado</strong></small>
                                </td>
                                <td>
                                    <small><strong>Diferencia</strong></small>
                                </td>
                            </tr>
                            <tr class="bg-white azul-intenzo">
                                <td>
                                    <small><?php echo e($datos_paciente); ?></small>
                                </td>
                                <td>
                                    <small><?php echo e($factura_registro); ?></small>
                                </td>
                                <td>
                                    <small><?php echo e(number_format($monto_registro, 2, ',', '.')); ?> Bsf </small>
                                </td>
                                <td>
                                    <small><?php echo e(number_format($monto_registro_pagado, 2, ',', '.')); ?> Bsf </small>
                                </td>
                                <td>
                                    <small> <?php echo e(number_format($monto_registro_diferencia, 2, ',', '.')); ?> Bsf</small>
                                </td>
                            </tr>
                            <tr class="alert-primary azul-intenzo">
                                <td>
                                    <small><strong>Datos de la intervencion</strong></small>
                                </td>
                                <td>
                                    <small><strong>Tasa del registro</strong></small>
                                </td>
                                <td>
                                    <small><strong>Monto total en divisa</strong></small>
                                </td>
                                <td>
                                    <small><strong>Monto pagado en divisa</strong></small>
                                </td>
                                <td>
                                    <small><strong>Diferencia en divisa</strong></small>
                                </td>
                            </tr>
                            <tr class="bg-white">
                                <td>
                                    <small><?php echo e($datos_intervencion); ?></small>
                                </td>
                                <td>
                                    <small><?php echo e($tasa_registro); ?> Bsf</small>
                                </td>
                                <td>
                                    <small>$ <?php echo e($divisa_monto_registro); ?> </small>
                                </td>
                                <td>
                                    <small>$ <?php echo e($divisa_monto_registro_pagado); ?></small>
                                </td>
                                <td>
                                    <small>$ <?php echo e($divisa_monto_registro_diferencia); ?></small>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <!--****************************************************-->
                    <!--** TABLA MOVIL                                    **-->
                    <!--****************************************************-->
                    <div class="d-block d-sm-none">
                        <table class="table table-sm">
                            <tr class="alert-primary azul-intenzo">
                                <td>
                                    <small><strong>Datos del paciente</strong></small>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <small><?php echo e($datos_paciente); ?></small>
                                </td>
                            </tr>
                            <tr class="alert-primary azul-intenzo">
                                <td>
                                    <small><strong>NRO Factura</strong></small>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <small><?php echo e($factura_registro); ?></small>
                                </td>
                            </tr>
                            <tr class="alert-primary azul-intenzo">
                                <td>
                                    <small><strong>Monto total</strong></small>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <small><?php echo e(number_format($monto_registro, 2, ',', '.')); ?></small>
                                </td>
                            </tr>
                            <tr class="alert-primary azul-intenzo">
                                <td>
                                    <small><strong>Monto pagado</strong></small>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <small><?php echo e(number_format($monto_registro_pagado, 2, ',', '.')); ?></small>
                                </td>
                            </tr>
                            <tr class="alert-primary azul-intenzo">
                                <td>
                                    <small><strong>Diferencia</strong></small>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <small><?php echo e(number_format($monto_registro_diferencia, 2, ',', '.')); ?></small>
                                </td>
                            </tr>
                            <tr class="alert-primary azul-intenzo">
                                <td>
                                    <small><strong>Datos de la intervencion</strong></small>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <small><?php echo e($datos_intervencion); ?></small>
                                </td>
                            </tr>
                            <tr class="alert-primary azul-intenzo">
                                <td>
                                    <small><strong>Tasa del registro</strong></small>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <small><?php echo e($tasa_registro); ?></small>
                                </td>
                            </tr>
                            <tr class="alert-primary azul-intenzo">
                                <td>
                                    <small><strong>Monto total en divisa</strong></small>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <small><?php echo e($divisa_monto_registro); ?></small>
                                </td>
                            </tr>
                            <tr class="alert-primary azul-intenzo">
                                <td>
                                    <small><strong>Monto pagado en divisa</strong></small>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <small><?php echo e($divisa_monto_registro_pagado); ?></small>
                                </td>
                            </tr>
                            <tr class="alert-primary azul-intenzo">
                                <td>
                                    <small><strong>Diferencia en divisa</strong></small>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <small><?php echo e($divisa_monto_registro_diferencia); ?></small>
                                </td>
                            </tr>
                        </table>
                    </div>
                    
                 <?php $__env->endSlot(); ?>
                 <?php $__env->slot('card_body', null, []); ?> 
                    <!--****************************-->
                    <!--**  -FORMULARIO           **-->
                    <!--****************************-->
                    <div class="d-none d-lg-block px-3">
                        <div><span class="h5">Agregar un pago</span>
                        </div>
                    </div>
                    <div class="row p-1">
                        <!--****************************-->
                        <!--** PRECIO                 **-->
                        <!--****************************-->
                        <div class="col-md-2">
                            <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.form.lw.inputlabel','data' => ['label' => 'Introdusca el monto','msj' => 'Inserte monto','identificador' => 'monto','maxlength' => '30']]); ?>
<?php $component->withName('form.lw.inputlabel'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['label' => 'Introdusca el monto','msj' => 'Inserte monto','identificador' => 'monto','maxlength' => '30']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                        </div>
                        <!--****************************-->
                        <!--** FECHA                  **-->
                        <!--****************************-->
                        <div class="col-md-2">
                            <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.form.lw.inputdate','data' => ['label' => 'Seleccione fecha del pago','identificador' => 'fecha_reg','maxlength' => '30']]); ?>
<?php $component->withName('form.lw.inputdate'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['label' => 'Seleccione fecha del pago','identificador' => 'fecha_reg','maxlength' => '30']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                        </div>
                        <!--****************************-->
                        <!--**  TIPO PAGO             **-->
                        <!--****************************-->
                        <div class="col-md-2">
                            <?php if (isset($component)) { $__componentOriginal9cf20384edc8ddaed63be5a8d6471db222139127 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\Form\SelectTipoPago::class, ['label' => 'Seleccione el tipo de pago','msj' => 'Seleccione..','identificador' => 'tipo_pago_id','atributo' => 'tipo_pago_id']); ?>
<?php $component->withName('form.select-tipo-pago'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
                             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9cf20384edc8ddaed63be5a8d6471db222139127)): ?>
<?php $component = $__componentOriginal9cf20384edc8ddaed63be5a8d6471db222139127; ?>
<?php unset($__componentOriginal9cf20384edc8ddaed63be5a8d6471db222139127); ?>
<?php endif; ?>
                        </div>
                        <!--****************************-->
                        <!--**  TASA                  **-->
                        <!--****************************-->
                        <div class="col-md-5">
                            <?php if (isset($component)) { $__componentOriginalcd2e7babc0588207ac4c0c160cae8a04b6b53376 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\Form\SelectTasa::class, ['label' => 'Seleccione la tasa','msj' => 'Seleccione..','identificador' => 'tasa_id','atributo' => 'tasa_id']); ?>
<?php $component->withName('form.select-tasa'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
                             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalcd2e7babc0588207ac4c0c160cae8a04b6b53376)): ?>
<?php $component = $__componentOriginalcd2e7babc0588207ac4c0c160cae8a04b6b53376; ?>
<?php unset($__componentOriginalcd2e7babc0588207ac4c0c160cae8a04b6b53376); ?>
<?php endif; ?>
                        </div>
                        <!--****************************-->
                        <!--**  BTN GUARDAR           **-->
                        <!--****************************-->
                        <div class="col-12 col-md-1 p-3 p-lg-0 mt-lg-4 ">
                            <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.btn.guardar','data' => ['accion' => 'pagar','class' => '']]); ?>
<?php $component->withName('btn.guardar'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['accion' => 'pagar','class' => '']); ?>Pagar <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                        </div>
                    </div>
                 <?php $__env->endSlot(); ?>
                 <?php $__env->slot('card_footer', null, []); ?> 
                    <div class="row px-3">
                        <div class="col-12 col-md-8">
                            <div class="d-none d-lg-block">
                                <div><span class="h5">Listado de pagos</span>
                                </div>
                            </div>
                        </div>
                        <div class="col-12 col-md-4">
                            <div class="py-2 p-lg-0">
                                <div class="d-flex justify-content-end ">
                                    <div>
                                        <span class="h6">Pagos listados:&nbsp; <span
                                                class="badge bg-secondary "><?php echo e($count_pagos); ?></span>
                                        </span>
                                    </div>
                                    &nbsp;
                                    <div>
                                        <?php switch($statu_registro):
                                            case ('N'): ?>
                                                <div class="alert alert-danger m-0 p-1 " role="alert" align="center">
                                                    <strong>DEUDA COMPLETA!</strong>
                                                </div>
                                            <?php break; ?>
                                            <?php case ('D'): ?>
                                                <div class="alert alert-warning  m-0 p-1 " role="alert" align="center">
                                                    <strong>POSEE DEUDA!</strong>
                                                </div>
                                            <?php break; ?>
                                            <?php case ('P'): ?>
                                                <div class="alert alert-success m-0 p-1 " role="alert" align="center">
                                                    <strong>PAGADO!</strong>
                                                </div>
                                            <?php break; ?>
                                            <?php default: ?>
                                                <div class="alert alert-danger m-0 p-1 " role="alert" align="center">
                                                    <strong>ERROR!</strong>
                                                </div>
                                        <?php endswitch; ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--********************************************-->
                    <!--** PANEL DE BUSQUEDA Y NUMERO DE LISTADO  **-->
                    <!--** EN PANTALLAS DE MOBILES                **-->
                    <!--********************************************-->
                    <?php if($count_pagos > 0): ?>
                        <div role="buscar_pago" wire:loading.remove wire:target="buscador_pago">
                            <div class="table-responsive-md">
                                <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.datatable.tablelg','data' => []]); ?>
<?php $component->withName('datatable.tablelg'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
                                    <!--************************************************************-->
                                    <!--** TITULO Y BUSCADOR DE pagoS                              **-->
                                    <!--************************************************************-->
                                     <?php $__env->slot('table_head', null, []); ?> 
                                        <tr>
                                            <!--*******************************************************-->
                                            <!--**  CONDICION Y MECANISMO PARA HACER EL ORDENAMIENTO **-->
                                            <!--** POR COLUNCA                                       **-->
                                            <!--** SE DEBE AJUSTAR UN TAMANO FIJO A LAS COLUMNAS     **-->
                                            <!--** CON EL FIN DE EVITAR PROBLEMAS AL HACER           **-->
                                            <!--** EL REFRSCAMIENTO DEL ORDENAMIENTO                 **-->
                                            <!--*******************************************************-->
                                            <th  style="width:100px; min-width:100px;" >
                                                <strong class="alert-primary">MONTO</strong>
                                            </th>
                                            <th  style="width:100px; min-width:100px;" >
                                                <strong class="alert-primary">MONTO EN DIVISA</strong>
                                            </th>
                                            <th  style="width:100px; min-width:100px;" >
                                                <strong class="alert-primary">TIPO DE PAGO</strong>
                                            </th>
                                            <th  style="width:100px; min-width:100px;" >
                                                <strong class="alert-primary">TASA</strong>
                                            </th>
                                            <th  style="width:100px; min-width:100px;" >
                                                <strong class="alert-primary">FECHA TASA</strong>
                                            </th>
                                            <th  style="width:100px; min-width:100px;" >
                                                <strong class="alert-primary">HORA PAGO</strong>
                                            </th>
                                            <th  style="width:100px; min-width:100px;" >
                                                <strong class="alert-primary">FECHA PAGO</strong>
                                            </th>
                                            <th  style="width:100px; min-width:100px;" >
                                                <strong class="alert-primary">OPCION</strong>
                                            </th>
                                        </tr>
                                     <?php $__env->endSlot(); ?>
                                    <!--*******************************************************-->
                                    <!--**  VALORES DE LAS  COLUNAS                          **-->
                                    <!--*******************************************************-->
                                     <?php $__env->slot('table_body', null, []); ?> 
                                        <?php $__currentLoopData = $pagos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pago): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <!-- POR ALGUNA RAZON DEL DIABLO TENGO QUE INSERTAR UNA  FILA  -->
                                            <tr></tr>
                                            <?php if($pago->activo == '0'): ?>
                                                <tr class="d-none">
                                                <?php elseif($pago->activo == '2'): ?>
                                                <tr class="text-danger">
                                                <?php else: ?>
                                                <tr>
                                            <?php endif; ?>
                                            <td class="d-none"><small><?php echo e($pago->id); ?></small></td>
                                            <td>
                                                <small>
                                                    Bsf&nbsp;<?php echo e(number_format($pago->monto, 2, ',', '.')); ?>

                                                </small>
                                            </td>
                                            <td>
                                                <small>
                                                    <i
                                                        class="fa-solid fa-dollar-sign"></i>&nbsp;<?php echo e(round(floatval($pago->monto) / floatval($pago->tasa->monto_tasa), 2)); ?>

                                                </small>
                                            </td>
                                            <td>
                                                <small>
                                                    <?php echo e($pago->tipo_pago->nombre); ?>

                                                </small>
                                            </td>
                                            <td>
                                                <small>
                                                    $<?php echo e($pago->tasa->monto_tasa); ?>

                                                </small>
                                            </td>
                                            <td>
                                                <small>
                                                    <?php echo e(date_format(date_create($pago->tasa->fecha_reg), 'd/m/Y')); ?>

                                                </small>
                                            </td>
                                            <td>
                                                <small>
                                                    <?php echo e($pago->tasa->hora_reg); ?>

                                                </small>
                                            </td>
                                            <td>
                                                <small>
                                                    <?php echo e(date_format(date_create($pago->fecha_reg), 'd/m/Y')); ?>

                                                </small>
                                            </td>
                                            <td>
                                                <?php if($pago->activo == '1'): ?>
                                                    <button class="btn btn-sm btn-warning p-1 "
                                                        wire:click="anular_pago(<?php echo e($pago->id); ?>)"><strong><i
                                                                class="fa-solid fa-rectangle-xmark"></i>&nbsp;Anular
                                                            pago</strong></button>
                                                <?php else: ?>
                                                    <span class="badge bg-danger text-dark">Pago Anulado</span>
                                                <?php endif; ?>
                                            </td>
                                            </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                     <?php $__env->endSlot(); ?>
                                     <?php $__env->slot('table_footer', null, []); ?> 
                                     <?php $__env->endSlot(); ?>
                                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                            </div>
                        </div>
                    <?php else: ?>
                        <!--******************************************************-->
                        <!--**  MENSAJE: PAGO NO ENCONTRADO                      **-->
                        <!--******************************************************-->
                        <div class="alert-secondary py-4">
                            <div class="d-flex justify-content-center">
                                <small> Este registro no posee ningun pago asociado.
                                    <strong class="text-secondary"></strong>
                                </small>
                            </div>
                        </div>
                    <?php endif; ?>
                    <br />
                 <?php $__env->endSlot(); ?>
                <br>
             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
        </div>
    </div>
</div>
<?php /**PATH /home/sociprom/public_html/smv2/resources/views/livewire/registro/pago.blade.php ENDPATH**/ ?>