var reporteAcumulateBuysService = function($filter, $http, $q){
	return{
		
		obtenerEstudios : function(){
			var defered = $q.defer();
		
			$http({
				method : "POST",
	            url : contextPath + '/reporte/acumulatebuys/obtenEstudios.action'
			}).then(function mySucces(response) {
				defered.resolve(response.data);
			}, function myError(response) {
				console.log("Error : "+response);
				console.log("Error : "+response.data);
			});

	    	return defered.promise;
		},
		obtenerEstudiosConfig : function(){
			var defered = $q.defer();
		
			$http({
				method : "POST",
	            url : contextPath + '/reporte/acumulatebuys/obtenEstudiosConfigurados.action'
			}).then(function mySucces(response) {
				defered.resolve(response.data);
			}, function myError(response) {
				console.log("Error : "+response);
				console.log("Error : "+response.data);
			});

	    	return defered.promise;
		},
		
		reporteAcumulateBuys : function(origen,id_estudio,typeAbono,fechaInicio,fechaFin){
			var defered = $q.defer();
		
			$http({
				method : "POST",
	            url : contextPath + '/reporte/acumulatebuys/reporteAcumulateBuys.action',
	            data :{"origen":origen,"id_estudio":id_estudio, "typeAbono":typeAbono, "fechaInicio":fechaInicio,"fechaFin":fechaFin}
			}).then(function mySucces(response) {
				defered.resolve(response.data);
			}, function myError(response) {
				console.log("Error : "+response);
				console.log("Error : "+response.data);
			});

	    	return defered.promise;
		}


		
	};
};


registraService("reporteAcumulateBuysService", reporteAcumulateBuysService);