{"size": 4212, "ext": "js", "max_stars_repo_path": "public/assets/js/myScript.js", "max_stars_repo_name": "joserph/app-retenciones", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "public/assets/js/myScript.js", "max_issues_repo_name": "joserph/app-retenciones", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public/assets/js/myScript.js", "max_forks_repo_name": "joserph/app-retenciones", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.0857142857, "max_line_length": 120, "alphanum_fraction": 0.4622507123}
$(document).ready(function()
{
	/*
	** Agregar factura iva mediante ajax jquery.
	*/
	var form = $('.create_factura_iva');
	form.bind('submit', function()
	{
		$.ajax({
			type: form.attr('method'),
			url: form.attr('action'),
			data: form.serialize(),
			beforeSend: function(){
                $('.before').append('<img src="assets/img/before.gif" />');
            },
            complete: function(data){
            	
            },
            success: function (data) {	
            	$(".before").hide();
				$(".errors_form").html("");
				$(".success_message").hide().html("");
            	if(data.success == false){
	            	var errores = "";
	            	for(datos in data.errors){
	            		errores += "<div class='alert alert-warning'>";
	            		errores += "<h6><b><i class='fa fa-exclamation-triangle fa-fw'></i> " + data.errors[datos] + "</b></h6>";
	            		errores += "</div>";
	            	}
	            	$(".errors_form").html(errores)
	            }else{
	            	$(form)[0].reset();//limpiamos el formulario
	            	$(".success_message").show().html(data.message)
	            	location.reload();

	            }
            },
            error: function(errors){
            	$(".before").hide();
				$(".errors_form").html("");
            	$(".errors_form").html(errors);
            }
		});
		return false;
	});
	/*
	** Fin Agregar factura iva mediante ajax jquery.
	*/
});
$(document).ready(function(){
	/*
	** Agregar factura islr mediante ajax jquery.
	*/
	var form = $('.create_factura_islr');
	form.bind('submit', function()
	{
		$.ajax({
			type: form.attr('method'),
			url: form.attr('action'),
			data: form.serialize(),
			beforeSend: function(){
                $('.before').append('<img src="assets/img/before.gif" />');
            },
            complete: function(data){
            	
            },
            success: function (data) {	
            	$(".before").hide();
				$(".errors_form").html("");
				$(".success_message").hide().html("");
            	if(data.success == false){
	            	var errores = "";
	            	for(datos in data.errors){
	            		errores += "<div class='alert alert-warning'>";
	            		errores += "<h6><b><i class='fa fa-exclamation-triangle fa-fw'></i> " + data.errors[datos] + "</b></h6>";
	            		errores += "</div>";
	            	}
	            	$(".errors_form").html(errores)
	            }else{
	            	$(form)[0].reset();//limpiamos el formulario
	            	$(".success_message").show().html(data.message)
	            	location.reload();

	            }
            },
            error: function(errors){
            	$(".before").hide();
				$(".errors_form").html("");
            	$(".errors_form").html(errors);
            }
		});
		return false;
	});
});

$(document).ready(function(){
	/*
	*	Agregar reportes de ventas mediante ajax jquery.
	*/
	var form = $('.create_reporte_venta');
	form.bind('submit', function()
	{
		$.ajax({
			type: form.attr('method'),
			url: form.attr('action'),
			data: form.serialize(),
			beforeSend: function(){
                $('.before').append('<img src="assets/img/before.gif" />');
            },
            complete: function(data){
            	
            },
            success: function (data) {	
            	$(".before").hide();
				$(".errors_form").html("");
				$(".success_message").hide().html("");
            	if(data.success == false){
	            	var errores = "";
	            	for(datos in data.errors){
	            		errores += "<div class='alert alert-warning'>";
	            		errores += "<h6><b><i class='fa fa-exclamation-triangle fa-fw'></i> " + data.errors[datos] + "</b></h6>";
	            		errores += "</div>";
	            	}
	            	$(".errors_form").html(errores)
	            }else{
	            	$(form)[0].reset();//limpiamos el formulario
	            	$(".success_message").show().html(data.message)
	            	location.reload();

	            }
            },
            error: function(errors){
            	$(".before").hide();
				$(".errors_form").html("");
            	$(".errors_form").html(errors);
            }
		});
		return false;
	});
});