Commit ea81e68480f56898fa6263ac65586a138947778d

Authored by Eric Fernandez
1 parent eb556b1660
Exists in master

validación correcta

Showing 2 changed files with 3 additions and 4 deletions   Show diff stats
src/js/controller.js
... ... @@ -245,14 +245,13 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo
245 245 }
246 246  
247 247 function vehiculoEnUso(vehiculo) {
248   - $scope.fechaReparto.setHours(0, 0, 0, 0);
249 248 var idUsuario = focaLogisticaPedidoRutaService.idUsuario;
250 249 for(var i = 0; i < vehiculo.cisternas.length; i++) {
251 250 for(var j = 0; j < vehiculo.cisternas[i].cisternasCarga.length; j++) {
252 251 var cisternaCarga = vehiculo.cisternas[i].cisternasCarga[j];
253 252 if(cisternaCarga.fechaReparto.substring(0, 10) === $scope.fechaReparto
254   - .toISOString().substring(0, 10) && cisternaCarga.idUsuarioProceso !==
255   - idUsuario)
  253 + .toISOString().substring(0, 10) && cisternaCarga.idUsuarioProceso &&
  254 + cisternaCarga.idUsuarioProceso !== idUsuario)
256 255 {
257 256 focaModalService.alert('El vehículo está siendo usado por otro usuario');
258 257 return true;
... ... @@ -16,7 +16,7 @@ angular.module(&#39;focaLogisticaPedidoRuta&#39;)
16 16 return $http.get(url + '/hoja-ruta/numero-siguiente');
17 17 },
18 18 getRemitos: function(idVehiculo) {
19   - return $http.get(url + '/remito/sin-hoja-ruta/' +idVehiculo);
  19 + return $http.get(url + '/remito/sin-hoja-ruta/' + idVehiculo);
20 20 },
21 21 cerrarDistribuicion: function(remitos) {
22 22 return $http.post(url + '/vehiculo/cierre-distribuicion', remitos);