<?php $__env->startSection('content'); ?>
<style>
  .form-check{
    display: inline-block;
    top: -15px;
    left: 13px;
  }
  .verTotal22{
    text-align: right;
    margin-right: 400px;
    font-size: 17px;
    font-weight: 700;
  }
  .regresar{
    margin-top: -10px;
    padding-left: 6px;
  }
  .eliminar{
    margin-top: -10px;
    padding-left: 6px;
  }
  .nota_{
    margin-top: -10px;
    padding-left: 6px;
  }

  .fa-upload {
    padding-top: 5px;
    padding-left: 6px;
  }
</style>
<div class="container date-consult">
    <div class="row">
        <div class="md-col-4 my-4">
            <form action="<?php echo e(route('contabilidad.dashboard_facturas')); ?>" method="POST">
                <?php echo csrf_field(); ?>
                <div class="d-flex flex-column justify-content-center">
                    <div class="d-flex justify-content-center align-items-center">
                        <p class="font-weight-bolder text-uppercase">Fecha Inicio: <input class="date-picker"
                                type="date" name="fechaInicio" id="datepicker"></p>
                        <p class="font-weight-bolder text-uppercase">Fecha Final: <input class="date-picker"
                                type="date" name="fechaFin" id="datepicker2"></p>
                    </div>
                    <div class="d-flex">
                      
                            <div class="d-flex justify-content-center align-items-center">
                                <div>
                                  <button type="submit" class="btn btn-dark mx-auto">Consultar</button>
                                </div>
                                <?php if(isset($salidasAlmacen->fechaInicio)): ?>
                                <div class="d-flex">
                                  <p class="blockquote mx-2">Fecha consultada</p>
                                  <p class="blockquote"> del  <strong><?php echo e($salidasAlmacen->fechaInicio); ?>  </strong></p>
                                  <p class="blockquote">- al -<strong><?php echo e($salidasAlmacen->fechaFin); ?> </strong></p>
                                </div>
                                <?php endif; ?>
                            </div>
                    </div>
                    
                </div>
            </form>
        </div>
    </div>
  </div>
  <form action="<?php echo e(route('contabilidad.recibo_caja_facturas')); ?>" method="POST">
    <?php echo csrf_field(); ?>
  <div id="contenedor-dashboard" class="container-fluid">
    <div class="row mb-5">
      <div class="col-md-12 mb-5">
        <h2>Notas de Crédito / Débito</h2>
        <input type="hidden"  class="botonColorNaranja" value="RECIBO DE CAJA.">
        <input type="hidden"  class="botonColorNaranja" value="RECIBO DE CAJA.">
      </div>
    </div>
  
    <div class="mt-5">
      <table id="example2" class="table">
          <thead>
            <tr>
              <th scope="col">NO.</th>
              <th scope="col">Usuario</th>
              <th scope="col">Factura</th>
              <th scope="col">Cliente</th>
              <th scope="col">Tipo</th>
              <th scope="col">Valor</th>
              <th scope="col">Motivo</th>
              <th scope="col">Estatus</th>
              <th scope="col">Fecha</th>
              <th scope="col">Acciones</th>

            </tr>
          </thead>
          <tbody>
            <?php $__currentLoopData = $notas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $nota): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            
            <tr>
                <td scope="col"><?php echo e($nota->id); ?></td>
                <td scope="col"><?php echo e($nota->usuarios->name); ?></td>
                <td scope="col"><?php echo e($nota->facturacion->no_sat??""); ?></td>
                <td scope="col"><?php echo e($nota->facturacion->cliente->nombre??""); ?></td>
                <td scope="col"><?php echo e($nota->id_tipo == 1?"Débito":"Crédito"); ?></td>
                <td scope="col">Q <?php echo e(number_format($nota->cantidad,2,'.',',')); ?></td>
                <td scope="col"><?php echo e($nota->observaciones); ?></td>
                <td scope="col"><?php echo e($nota->estatus == 1?"Pendiente de autorización":"Autorizado"); ?></td>
                <td scope="col"><?php echo e($nota->created_at->format('d-m-Y')); ?></td>
                <td>
                  <a href="<?php echo e(route('contabilidad.editar_notas',$nota->id)); ?>" title="Editar Nota"><i class="fas fa-edit"></i></a>
                  <a href="<?php echo e(route('contabilidad.regresar_notas',$nota->id)); ?>" class="revertir_recibo" title="Revertir nota"><i class="fas fa-undo-alt"></i></a>
                  <a href="<?php echo e(route('contabilidad.imprimir_nota',$nota->id)); ?>" title="Imprimir Nota"><i class="fas fa-print"></i></a>
                </td>
            </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
          </tbody>
        </table>
    </div>
  </div>
</div>
<script>
     $(document).ready(function(){
 $.fn.dataTable.moment( 'DD/MM/YYYY' );
  $('#example2').dataTable( {
    "paging": false,
    "order":[[ 0, "desc" ]],
              dom: 'Bfrtip',
              buttons: [
                  'excel', 'print'
              ],
      drawCallback: function () {
        var api = this.api();

        let dollarUSLocale = Intl.NumberFormat('en-IN');
        $( "#data7" ).html(
          api.column( 8, {page:'current'} ).data().sum().toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,')
        );
        
      }
  });
})
</script>

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

<?php echo $__env->make('contabilidad.menu', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/devpwg5/laravelrp.com/resources/views/contabilidad/dashboard_notas_credito_debito.blade.php ENDPATH**/ ?>