$(document).ready(function(){

  $(document).on('click', '.invoice_trashbtnRestore', function () {
    
    var gettingid=$(this).data('id');
    
    restoreinvoice(gettingid);

  });

});


function restoreinvoice(gettingid)
{
  $.ajaxSetup({

    headers: {

        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')

    } 

  });
 

  $.ajax({ 
  
    url:url_restoreinvoice,

    method:"POST",

    data:{gettingid:gettingid},

    success:function(result)

    {
      $("#invoice-trash").modal('hide');

      $('#invoice_trashedlist').empty();

      var success="";

      success=success+
      
      '<p style="text-align:center;"><b>Invoice Restore Successfully !!!</b></p>';
      
      $('#invoice_success').append(success);
      $('#invoice_success').removeClass("hide");
      
      setTimeout(function(){
        location.reload();
      }, 200);

    }

 });

}