text: jQuery(document).ready(function($) {
  	$("#doaction, #doaction2").click(function (event) {
  		var actionselected = $(this).attr("id").substr(2);
  		var action = $('select[name="' + actionselected + '"]').val();
  		if ( $.inArray(action, wpo_wcpdf_ajax.bulk_actions) !== -1 ) {
  			event.preventDefault();
  			var template = action;
  			var checked = [];
  			$('tbody th.check-column input[type="checkbox"]:checked').each(
  				function() {
  					checked.push($(this).val());
  				}
  			);
  			
  			if (!checked.length) {
  				alert('You have to select order(s) first!');
  				return;
  			}
  			
  			var order_ids=checked.join('x');
  
  			if (wpo_wcpdf_ajax.ajaxurl.indexOf("?") != -1) {
  				url = wpo_wcpdf_ajax.ajaxurl+'&action=generate_wpo_wcpdf&template_type='+template+'&order_ids='+order_ids+'&_wpnonce='+wpo_wcpdf_ajax.nonce;
  			} else {
  				url = wpo_wcpdf_ajax.ajaxurl+'?action=generate_wpo_wcpdf&template_type='+template+'&order_ids='+order_ids+'&_wpnonce='+wpo_wcpdf_ajax.nonce;
  			}
  
  			window.open(url,'_blank');
  		}
  	});
  
  	$('#wpo_wcpdf-data-input-box').insertAfter('#woocommerce-order-data');
  
  	// enable invoice number edit if user initiated
  	$('#wpo_wcpdf-data-input-box label').click(function (event) {
  		input = $(this).attr('for');
  		$('#'+input).prop('disabled', false);
  	});
  	$( "#_wcpdf_invoice_number" ).on( "click", function() {
  		console.log( this );
  	});
  });
  
  