Selaa lähdekoodia

pester users to confirm

David 9 vuotta sitten
vanhempi
commit
8b4429bf38
1 muutettua tiedostoa jossa 13 lisäystä ja 1 poistoa
  1. 13 1
      controllers/facturaCtrl.js

+ 13 - 1
controllers/facturaCtrl.js

@@ -1,6 +1,8 @@
-app.controller('facturaCtrl', function ($scope, $http, $routeParams, $location, $uibModal ) {
+app.controller('facturaCtrl', function ($scope, $http, $routeParams, $location, $uibModal, notify ) {
 	$scope.pedidos=[];
 	$scope.modalInstance = null;
+	var aconfirmar = false;
+
 	var user = $routeParams.hash;
 	if (user === undefined){
 		$location.url("/");
@@ -13,6 +15,16 @@ app.controller('facturaCtrl', function ($scope, $http, $routeParams, $location,
 				e.fecha = new Date(e.fecha);
 				return e;
 			});
+			aconfirmar = ($scope.pedidos.filter(function(el) { return el.estado === "CREADO"  }).length > 0 );
+
+			if (aconfirmar) {
+				notify({ 
+					duration: 1000000,
+					messageTemplate: "<span>Tiene pedidos por confirmar</span>",
+					position: "right",
+					classes: "alert-danger"
+				});
+			}
 
 			$scope.pedidos.sort(function(a,b){
 				return b.fecha - a.fecha;