diff --git a/src/js/controller.js b/src/js/controller.js index 36da64e..bc2b60d 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -65,7 +65,6 @@ angular.module('focaAbmVehiculo') } ); }; - function elegirTransportista(transportista) { var codigo = ('00000' + transportista.COD).slice(-5); $scope.idTransportista = transportista.COD; @@ -234,7 +233,7 @@ angular.module('focaAbmVehiculo') total += parseInt(cisterna.capacidad); } }); - return $scope.vehiculo.capacidad === total; + return $scope.vehiculo.capacidad == total; } function guardarCisternas() { diff --git a/src/js/controllerCisterna.js b/src/js/controllerCisterna.js index 41d6556..28cfbdd 100644 --- a/src/js/controllerCisterna.js +++ b/src/js/controllerCisterna.js @@ -25,7 +25,7 @@ angular.module('focaAbmVehiculo') }); if($routeParams.idx !== -1) { - $scope.cisterna = [$routeParams.idx]; + $scope.cisterna = [$routeParams.idx] focaAbmVehiculoService .getCisternas($routeParams.idVehiculo) .then(function(res) { @@ -99,11 +99,11 @@ angular.module('focaAbmVehiculo') cisternas.forEach(function(cisterna, idx) { //SI EL CODIGO YA EXISTE if(cisterna.codigo === $scope.cisterna.codigo && - idx !== $routeParams.idx && + idx != $routeParams.idx && !cisterna.desactivado) { reject('Código de cisterna existente'); } - if(idx !== $routeParams.idx && + if(idx != $routeParams.idx && !cisterna.desactivado) { totalCargado += cisterna.capacidad; }