$(function () {

	$('.btn_reenviar').on('click', function() {
		var id = $(this).data("id"); 
        $.requestApi('/xml/reenviarNota', {"id" : id}, 'GET', function (resolve) {
	        if (resolve) {
	            $.showMessages(resolve, true, APP_URL+'/nota/detalles/'+id );
	        }
	    });
        
        return false;
	});

	$('.btn_cdr').on('click', function() {
		var id = $(this).data("id"); 
        $.requestApi('/xml/cdrNota', {"id" : id}, 'GET', function (resolve) {
	        if (resolve) {
	            $.showMessages(resolve, true, APP_URL+'/nota/detalles/'+id );
	        }
	    });
        
        return false;
	});

	$('.btn_imprimir_a4').on('click', function() {
        var id = $(this).data("id");
        window.open(APP_URL+'/../pdf/imprimeNotaA4.php?id_nota='+id, '_blank');
    });

});
