From ea81e68480f56898fa6263ac65586a138947778d Mon Sep 17 00:00:00 2001 From: efernandez Date: Tue, 29 Jan 2019 11:20:33 -0300 Subject: [PATCH] =?UTF-8?q?validaci=C3=B3n=20correcta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/controller.js | 5 ++--- src/js/service.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/js/controller.js b/src/js/controller.js index df17619..171dc37 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -245,14 +245,13 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo } function vehiculoEnUso(vehiculo) { - $scope.fechaReparto.setHours(0, 0, 0, 0); var idUsuario = focaLogisticaPedidoRutaService.idUsuario; for(var i = 0; i < vehiculo.cisternas.length; i++) { for(var j = 0; j < vehiculo.cisternas[i].cisternasCarga.length; j++) { var cisternaCarga = vehiculo.cisternas[i].cisternasCarga[j]; if(cisternaCarga.fechaReparto.substring(0, 10) === $scope.fechaReparto - .toISOString().substring(0, 10) && cisternaCarga.idUsuarioProceso !== - idUsuario) + .toISOString().substring(0, 10) && cisternaCarga.idUsuarioProceso && + cisternaCarga.idUsuarioProceso !== idUsuario) { focaModalService.alert('El vehículo está siendo usado por otro usuario'); return true; diff --git a/src/js/service.js b/src/js/service.js index 7f863c8..a69cf1a 100644 --- a/src/js/service.js +++ b/src/js/service.js @@ -16,7 +16,7 @@ angular.module('focaLogisticaPedidoRuta') return $http.get(url + '/hoja-ruta/numero-siguiente'); }, getRemitos: function(idVehiculo) { - return $http.get(url + '/remito/sin-hoja-ruta/' +idVehiculo); + return $http.get(url + '/remito/sin-hoja-ruta/' + idVehiculo); }, cerrarDistribuicion: function(remitos) { return $http.post(url + '/vehiculo/cierre-distribuicion', remitos); -- 1.9.1