angular.module('supplieritemsService',[]).factory('Supplieritems',function($http){
	
	return {
		getPaging:function(filter){
			
			return $http({method:'POST',
				headers:headers,
				url:url_server + 'supplieritemspaging',
				data:filter,
				withCredentials: true});
			// return $http({method:'POST',url:url_server + 'supplieritemspaging',data:filter});
		},
		getSelect:function(){
			
			return $http({method:'POST',
				headers:headers,
				url:url_server + 'supplieritems/getall',
				withCredentials: true});
			// return $http({method:'POST',url:url_server + 'supplieritems/getall'});
		},
		getSelect2:function(filter){
			return $http({method:'POST',url:url_server + 'supplieritems/search',data:filter});
		},
		show:function(id){
			return $http({method:'GET',
				headers:headers,
				url:url_server +  'supplieritems/'+id,
				withCredentials: true});
			// return $http.get(url_server+ 'supplieritems/'+id);
		},
		save:function(supplieritemsData){
			return $http({method:'POST',
				headers:headers,
				url:url_server + 'supplieritems',
				data:supplieritemsData,
				withCredentials: true});
			// return $http({method:'POST',
			// 				url:url_server+'supplieritems',
			// 				data:supplieritemsData});
		},
		update:function(id, supplieritemsData){
			return $http.put(url_server+'supplieritems/'+id,supplieritemsData,{headers:headers, withCredentials: true });
			// return $http.put(url_server+'supplieritems/'+id,supplieritemsData);
		},
		destroy:function(id, status){
			return $http({method:'POST',
				headers:headers,
				url:url_server + 'supplieritems/active',
				data:{id:id, status:status},
				withCredentials: true});
			// return $http({method:'POST',
			// 				url:url_server+'supplieritems/active',
			// 				data:{id:id, status:status}});
		}
	};
});
