Commit 2c530b35ed09a893c5fb70206201cf8ddcc6aa1a

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

solo valida capacidad al guardar el vehiculo

Showing 1 changed file with 3 additions and 11 deletions   Show diff stats
src/js/controllerCisterna.js
... ... @@ -58,7 +58,7 @@ angular.module('focaAbmVehiculo')
58 58 focaModalService.alert('Ingrese unidad de medida');
59 59 return;
60 60 }
61   - validaCodigoCapacidad()
  61 + validaCodigo()
62 62 .then(function() {
63 63 $scope.cisterna.idVehiculo = parseInt($routeParams.idVehiculo);
64 64 delete $scope.cisterna.vehiculo;
... ... @@ -89,7 +89,7 @@ angular.module('focaAbmVehiculo')
89 89 });
90 90 };
91 91  
92   - function validaCodigoCapacidad() {
  92 + function validaCodigo() {
93 93 return new Promise(function(resolve, reject) {
94 94 focaAbmVehiculoService
95 95 .getCisternas($routeParams.idVehiculo)
... ... @@ -108,15 +108,7 @@ angular.module('focaAbmVehiculo')
108 108 totalCargado += cisterna.capacidad;
109 109 }
110 110 });
111   -
112   - //SI EL TOTAL DE CAPACIDAD DE CISTERNAS ES MAYOR QUE LA DEL VEHICULO
113   - totalCargado = totalCargado + parseInt($scope.cisterna.capacidad);
114   - if(totalCargado > $scope.capacidadVechiulo) {
115   - reject('La capacidad total de las cisternas' +
116   - ' no debe ser mayor a la del vehiculo');
117   - }else {
118   - resolve();
119   - }
  111 + resolve();
120 112 });
121 113 });
122 114 }