فهرست منبع

Merge branch 'master' of ssh://git.davidventura.com.ar:443/david/eba-pedidos

Conflicts:
	controllers/editPedidoCtrl.js
David 9 سال پیش
والد
کامیت
b84bbeb2d0
3فایلهای تغییر یافته به همراه21 افزوده شده و 4 حذف شده
  1. 16 0
      .jshintrc
  2. 4 3
      controllers/editPedidoCtrl.js
  3. 1 1
      controllers/facturaCtrl.js

+ 16 - 0
.jshintrc

@@ -0,0 +1,16 @@
+{
+	"eqeqeq": true,
+	"freeze": true,
+	"latedef": "nofunc",
+	"strict": "implied",
+	"undef": true,
+	"globals": { 
+		"angular": true,
+		"app": true,
+		"document": true,
+		"window": true,
+		"console": true,
+		"setTimeout": true,
+		"setInterval": true
+	}
+}

+ 4 - 3
controllers/editPedidoCtrl.js

@@ -1,3 +1,4 @@
+/* globals pedidosService: true */
 app.controller('editPedidoCtrl', function ($scope, $http, $routeParams, notify, $location, $timeout, editing, pedidosService) {
 	$scope.cero=true;
 	$scope.total=0;
@@ -6,7 +7,7 @@ app.controller('editPedidoCtrl', function ($scope, $http, $routeParams, notify,
 
 	$scope.modificar = function() {
 		$scope.cero=true;
-	}
+	};
 
 	$scope.confirmar = function() {
 		var filtrados = $scope.listaproductos.filter(function(el) { return el.cantidad > 0; });
@@ -65,7 +66,7 @@ app.controller('editPedidoCtrl', function ($scope, $http, $routeParams, notify,
 		var total=0;
 		total=$scope.listaproductos.reduce(
 			function(acc,cur) {
-				return acc+(cur.cantidad*cur.precio)
+				return acc+(cur.cantidad*cur.precio);
 			},0);
 		$scope.total=total;
 	};
@@ -89,7 +90,7 @@ app.controller('editPedidoCtrl', function ($scope, $http, $routeParams, notify,
 		$http.post('back/pedido', { pedido: pedido } )
 	        .success(function(data, status, headers, config) {
 				notify("Actualizado correctamente");
-				$timeout(function() { $location.url("/"+$routeParams.hash) }, 2000);
+				$timeout(function() { $location.url("/"+$routeParams.hash); }, 2000);
 	        })
 	        .error(function(data, status, headers, config) {
 				notify({classes:"alert alert-danger", message:"Error: "+ data.err});

+ 1 - 1
controllers/facturaCtrl.js

@@ -2,7 +2,7 @@ app.controller('facturaCtrl', function ($scope, $http, $routeParams, $location,
 	$scope.pedidos=[];
 	$scope.modalInstance = null;
 	var user = $routeParams.hash;
-	if (user == undefined){
+	if (user === undefined){
 		$location.url("/");
 	}