<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
$(".tablaVentas").on("click","#getcdr1, #getcdr2, #getcdr3", function(e){
e.preventDefault();
    let idVenta = $(this).attr("idVenta");
   var activo = $('#active').attr("idP");

    let datos = {"idVenta": idVenta};
  
   $.ajax({
       method: "POST",
       url: "ajax/envio-sunat.ajax.php",
       data: datos,
       beforeSend: function(){
        $(".reload-all").fadeIn(50).html("&lt;img src='vistas/img/reload.svg' width='80px'&gt; ");
       },
       success: function(respuesta){
        console.log(respuesta);
        Swal.fire({
            title: 'El comprobante ha sido enviado',
            text: 'Â¡Gracias!',
            icon: 'success',
            html:
              '&lt;div id="successCO"&gt;&lt;/div&gt;',
            showCancelButton: true,
            showConfirmButton: false,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            cancelButtonText: 'Cerrar',
          })
          $(".reload-all").fadeOut(50);
          $('#successCO').html(respuesta);
          loadVentas(activo);
          loadComrobantesNoEnviados();
       }

   })
});

$(".tablaVentas").on("click","#bajaDoc", function(e){
  Swal.fire({
    title: 'Â¿EstÃ¡s seguro de anular el comprobante?',
    text: "Â¡Verifica todo antes de confirmar!",
    icon: 'question',
    showCancelButton: true,
    confirmButtonColor: '#3085d6',
    cancelButtonColor: '#d33',
    confirmButtonText: 'SÃ­, guardar!',
    cancelButtonText: 'Cancelar',
  }).then((result) =&gt; {
    if (result.isConfirmed) {

  let idComprobante = $(this).attr("idDoc");
  var activo = $('#active').attr("idP");
  let datos ={"idComprobante":idComprobante};

  $.ajax({
    method: "POST",
    url: "ajax/envio-sunat.ajax.php",
    data: datos,
    beforeSend: function(){
      $(".reload-all").fadeIn(50).html("&lt;img src='vistas/img/reload.svg' width='80px'&gt; ");
    },
    success: function(respuesta){

     Swal.fire({
         title: 'COMUNICACIÃ“N DE BAJA',
         text: 'Â¡Gracias!',
         icon: 'success',
         html:
           '&lt;div id="successCO"&gt;&lt;/div&gt;',
         showCancelButton: true,
         showConfirmButton: false,
         confirmButtonColor: '#3085d6',
         cancelButtonColor: '#d33',
         cancelButtonText: 'Cerrar',
       })
       $(".reload-all").fadeOut(50);
       $('#successCO').html(respuesta);
          loadVentas(activo);
    }
  })
}
})
})
</pre></body></html>