Commit 14c1200cc88b5659a9a592b328cb7ed876f04713

Authored by Jose Pinto
1 parent 16b1be81c4
Exists in master and in 1 other branch develop

fix guardar vehiculo y cisterna

src/js/controller.js
... ... @@ -65,7 +65,6 @@ angular.module('focaAbmVehiculo')
65 65 }
66 66 );
67 67 };
68   -
69 68 function elegirTransportista(transportista) {
70 69 var codigo = ('00000' + transportista.COD).slice(-5);
71 70 $scope.idTransportista = transportista.COD;
... ... @@ -234,7 +233,7 @@ angular.module('focaAbmVehiculo')
234 233 total += parseInt(cisterna.capacidad);
235 234 }
236 235 });
237   - return $scope.vehiculo.capacidad === total;
  236 + return $scope.vehiculo.capacidad == total;
238 237 }
239 238  
240 239 function guardarCisternas() {
src/js/controllerCisterna.js
... ... @@ -25,7 +25,7 @@ angular.module('focaAbmVehiculo')
25 25 });
26 26  
27 27 if($routeParams.idx !== -1) {
28   - $scope.cisterna = [$routeParams.idx];
  28 + $scope.cisterna = [$routeParams.idx]
29 29 focaAbmVehiculoService
30 30 .getCisternas($routeParams.idVehiculo)
31 31 .then(function(res) {
... ... @@ -99,11 +99,11 @@ angular.module('focaAbmVehiculo')
99 99 cisternas.forEach(function(cisterna, idx) {
100 100 //SI EL CODIGO YA EXISTE
101 101 if(cisterna.codigo === $scope.cisterna.codigo &&
102   - idx !== $routeParams.idx &&
  102 + idx != $routeParams.idx &&
103 103 !cisterna.desactivado) {
104 104 reject('Código de cisterna existente');
105 105 }
106   - if(idx !== $routeParams.idx &&
  106 + if(idx != $routeParams.idx &&
107 107 !cisterna.desactivado) {
108 108 totalCargado += cisterna.capacidad;
109 109 }