<?php if (isset($component)) { $__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da = $component; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\AppLayout::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>

    <div class="col-md-12">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="/">Dasboard</a></li>
            <li class="breadcrumb-item active" aria-current="page">Configuración de data contable</li>
          </ol>
    </div>
    <div class="col-md-12">
        <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.alert','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?> <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
    </div>

    <div class="col-md-12">
        <h5>Configuración para copiar información contable</h5>
        <p>
            Apartado que nos permite copiar la información de una empresa a otra, esto incluye copiar
            catalogo de cuentas contables, tipos de cuentas, clasificación, etc.
        </p>
    </div>

    <div class="col-md-12">
        <div class="row">
            <?php $__currentLoopData = $empresas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="col-md-4">
                    <div class="card">
                        <div class="card-body">
                            <h6><?php echo e($item->empresa); ?></h6>

                            <div class="">
                                <form method="post" id="form-tipo-<?php echo e($item->id); ?>"
                                    action="<?php echo e(route('contabilidad.copiar-data-store')); ?>">
                                    <?php echo csrf_field(); ?>


                                    <input type="hidden" name="emp_de_copiar" id="emp_de_copiar_<?php echo e($item->id); ?>">
                                    <input type="hidden" name="emp_a_pasar" value="<?php echo e($item->id); ?>" id="">
                                    <input type="hidden" name="op" value="tipo">
                                    <table class="table">
                                        <tbody>
                                            <tr>
                                                <th scope="row"> Tipo partida:</th>
                                                <td width="50">
                                                    <?php if(count($item->contaTiposPartidas) > 0): ?>
                                                        <button class="btn btn-success" disabled>
                                                            <i style="color:aliceblue" class="fas fa-check-circle"></i>
                                                        </button>
                                                    <?php else: ?>
                                                        <button onclick="submitformTipo(<?php echo e($item->id); ?>);"
                                                            type="button" class="btn btn-danger">
                                                            <i style="color:aliceblue" class="fas fa-times-circle "></i>
                                                        </button>
                                                    <?php endif; ?>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </form>
                            </div>


                            <div>
                                <form method="post" id="form-clasificacion-<?php echo e($item->id); ?>"
                                    action="<?php echo e(route('contabilidad.copiar-data-store')); ?>">

                                    <?php echo csrf_field(); ?>


                                    <input type="hidden" name="emp_de_copiar"
                                        id="emp_de_copiar_cla<?php echo e($item->id); ?>">
                                    <input type="hidden" name="emp_a_pasar" value="<?php echo e($item->id); ?>" id="">
                                    <input type="hidden" name="op" value="clasificacion">


                                    <table class="table">
                                        <tbody>
                                            <tr>
                                                <th scope="row"> Clasificación de cuentas contables:</th>
                                                <td width="50">
                                                    <?php if(count($item->contaClasificacion) > 0): ?>
                                                        <button class="btn btn-success" disabled>
                                                            <i style="color:aliceblue" class="fas fa-check-circle"></i>
                                                        </button>
                                                    <?php else: ?>
                                                        <button onclick="submitformClasificacion(<?php echo e($item->id); ?>);"
                                                            type="button" class="btn btn-danger">
                                                            <i style="color:aliceblue" class="fas fa-times-circle "></i>
                                                        </button>
                                                    <?php endif; ?>
                                                </td>
                                            </tr>

                                        </tbody>
                                    </table>
                                </form>
                            </div>



                            <div>
                                <form id="form-nivel-<?php echo e($item->id); ?>" method="post"
                                    action="<?php echo e(route('contabilidad.copiar-data-store')); ?>">
                                    <?php echo csrf_field(); ?>

                                    <input type="hidden" name="emp_de_copiar"
                                        id="emp_de_copiar_ni<?php echo e($item->id); ?>">
                                    <input type="hidden" name="emp_a_pasar" value="<?php echo e($item->id); ?>"
                                        id="">
                                    <input type="hidden" name="op" value="nivel">

                                    <table class="table">
                                        <tbody>
                                            <tr>
                                                <th scope="row">Nivel de cuentas contables:</th>
                                                <td width="50">
                                                    <?php if(count($item->contaNivel) > 0): ?>
                                                    <button class="btn btn-success" disabled>
                                                        <i style="color:aliceblue" class="fas fa-check-circle"></i>
                                                    </button>
                                                <?php else: ?>
                                                    <button onclick="submitformNivel(<?php echo e($item->id); ?>);" type="button"
                                                        class="btn btn-danger">
                                                        <i style="color:aliceblue" class="fas fa-times-circle "></i>
                                                    </button>
                                                <?php endif; ?>
                                                </td>
                                            </tr>

                                        </tbody>
                                    </table>
                                </form>

                            </div>

                            <label for="" class="mt-2"> <strong>Copiar de: </strong></label>


                            <select name="" id="emp<?php echo e($item->id); ?>" class="form-control mt-2">
                                <option disabled value="" selected>Seleccione..</option>
                                <?php $__currentLoopData = $empresas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $e): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($item->id != $e->id): ?>
                                        <option value="<?php echo e($e->id); ?>"><?php echo e($e->empresa); ?></option>
                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>


                        </div>
                    </div>

                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </div>

    <script>
        function submitformTipo(id) {
            let select = $('#emp' + id).val();
            $('#emp_de_copiar_' + id).val(select);
            document.getElementById('form-tipo-' + id).submit();
        }

        function submitformClasificacion(id) {
            let select = $('#emp' + id).val();
            $('#emp_de_copiar_cla' + id).val(select);
            document.getElementById('form-clasificacion-' + id).submit();
        }

        function submitformNivel(id) {
            let select = $('#emp' + id).val();
            $('#emp_de_copiar_ni' + id).val(select);
            document.getElementById('form-nivel-' + id).submit();
        }
    </script>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da)): ?>
<?php $component = $__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da; ?>
<?php unset($__componentOriginal8e2ce59650f81721f93fef32250174d77c3531da); ?>
<?php endif; ?>
<?php /**PATH C:\laragon\www\sistema-contable-laravel\resources\views/contabilidad/configuracion/copiar_informacion_contable.blade.php ENDPATH**/ ?>