function buscarDocProrrat(b, a, DocProrrat=false){
  const parametros = new FormData();

  $.ajax({
    data:  parametros,
    url:   "busDocProrratmp/data.php",
    type:  "post",
    contentType: false,
    processData: false,
    beforeSend: function () {
      alLoad("Consultando...")
    },
    success: function (jsonPhp) {
      console.log(jsonPhp);

      const jsonJS = JSON.parse(jsonPhp);

      tblClear("tblDocProrrat");
      jsonJS.doctose.forEach(function(i){
        addRowDocProrrat(i.td_nom, i.de_num, i.de_fec);
      });

      $("#tblDocProrrat tbody tr").dblclick(function() {
        selectDocProrrat(a, $(this), DocProrrat);
      });

      $("#tblDocProrrat tbody #btnSelecDocProrrat").click(function() {
        selectDocProrrat(a, $(this).parents("tr"), DocProrrat);
      });

      alClose();
    }
  });
}

function addRowDocProrrat(tipod, num, fecha) {
  const markup =  "<tr>"
                    +"<td>"+tipod+"</td>"
                    +"<td>"+num+"</td>"
                    +"<td>"+fecha+"</td>"
                    +"<td><button class='btn btn-sm btn-warning badge' id='btnSelecDocProrrat'>"+textBtnSelec+"</button></td>"
                  +"</tr>";
  $("#tblDocProrrat tbody").append(markup);
}

function selectDocProrrat(a, tr, DocProrrat) {
  $("#pills-"+a+"-tab").click();
  /*if (inputProvcp == "txtNit") {
    document.thisform.txtNit.value = tr.find("td:eq(0)").text();
    $("form[name='thisform'] #txtNit").trigger("change");
  } else {*/
    $("#"+inputDocimp).val(tr.find("td:eq(1)").text());
    $("#"+inputArtic).val(tr.find("td:eq(1)").text());

   // if (!DocProrrat) {
    $("#"+inputDocimp).trigger("change");
   // } else {
   //   $("#"+input+"Nom").val(tr.find("td:eq(1)").text());
   // }
  //}

  //$('html, body').animate( { scrollTop : 0 }, 500 );
  tblClear("tblDocProrrat");
}