/**
 * TaskNoPriceCtrl Controller
 * Extracted from bookings module
 */

Bookings.controller('TaskNoPriceCtrl', ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {

	$scope.data = {
		selected_reason: 'Contract'
	};

	$scope.reasons = [
		'Contract',
		'The job was canceled',
		'Nothing was done',
		'Internal job',
		'Other'
	];

	$scope.submit = function () {
		if ($scope.data.selected_reason == 'Other') {
			$uibModalInstance.close($scope.data.reason);
		} else {
			$uibModalInstance.close($scope.data.selected_reason);
		}
	};

	$scope.cancel = function () {
		$uibModalInstance.dismiss('cancel');
	};

}]);
