(function() {

	'use strict';
	
	angular.module('openlmis.requisitions').config(config);

	config.$inject = ['$stateProvider'];
	function config($stateProvider) {

		$stateProvider.state('requisitions', {
			abstract: true,
			url: '/requisitions',
			template: '<div ui-view></div>'
		});

		$stateProvider.state('requisitions.requisition', {
			url: '^/requisition/:rnr',
			controller: 'RequisitionCtrl',
			templateUrl: 'requisitions/requisition.html',
			resolve: {
				requisition: function ($q, $stateParams, RequisitionFactory) {
				  var deferred = $q.defer();

				  RequisitionFactory.get($stateParams.rnr).$promise.then(function(response) {
				      deferred.resolve(response);
				    }, function(response) {
				      alert('Cannot find requisition with UUID: ' + $stateParams.rnr);
				      deferred.reject();
				  });

				  return deferred.promise;
				}
      		}
    	});
	}

})();
@@ -491,16 +491,27 @@
 nction (
+$location, 
 $q, $sta
@@ -742,99 +742,64 @@
     
-alert('Cannot find requisition with UUID: ' + $stateParams.rnr);%0A%09%09%09%09      deferred.reject(
+deferred.reject();%0A%09%09%09%09      return $location.url('/404'
 );%0A%09

Add redirecting when requisition id is not found