|
@@ -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.pedidos=[];
|
|
|
$scope.modalInstance = null;
|
|
$scope.modalInstance = null;
|
|
|
|
|
+ var aconfirmar = false;
|
|
|
|
|
+
|
|
|
var user = $routeParams.hash;
|
|
var user = $routeParams.hash;
|
|
|
if (user === undefined){
|
|
if (user === undefined){
|
|
|
$location.url("/");
|
|
$location.url("/");
|
|
@@ -13,6 +15,16 @@ app.controller('facturaCtrl', function ($scope, $http, $routeParams, $location,
|
|
|
e.fecha = new Date(e.fecha);
|
|
e.fecha = new Date(e.fecha);
|
|
|
return e;
|
|
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){
|
|
$scope.pedidos.sort(function(a,b){
|
|
|
return b.fecha - a.fecha;
|
|
return b.fecha - a.fecha;
|