Commit 28d144ab4e6c6684847c957b81446a6e9c7e76d1
1 parent
3e9bc33af9
Exists in
master
and in
2 other branches
rellenar no supera lo máximo
Showing
2 changed files
with
5 additions
and
2 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -214,7 +214,7 @@ angular.module('focaModalDetalleCisternas') |
| 214 | 214 | $scope.cisternas[i].disabled = false; |
| 215 | 215 | } |
| 216 | 216 | }; |
| 217 | - $scope.rellenarInput = function(input) { | |
| 217 | + $scope.rellenarInput = function(input, cisterna) { | |
| 218 | 218 | if(!$scope.articuloSeleccionado) return; |
| 219 | 219 | if($scope.articuloSeleccionado.cantidad - |
| 220 | 220 | $scope.articuloSeleccionado.cantidadCargada === 0) { |
| ... | ... | @@ -224,6 +224,9 @@ angular.module('focaModalDetalleCisternas') |
| 224 | 224 | input = parseFloat(input); |
| 225 | 225 | input += parseFloat($scope.articuloSeleccionado.cantidad - |
| 226 | 226 | $scope.articuloSeleccionado.cantidadCargada); |
| 227 | + if(input > cisterna.disponible) { | |
| 228 | + input = cisterna.disponible; | |
| 229 | + } | |
| 227 | 230 | return input; |
| 228 | 231 | }; |
| 229 | 232 | $scope.distribucionDisponible = function() { |
src/views/foca-detalle-vehiculo.html
| ... | ... | @@ -69,7 +69,7 @@ |
| 69 | 69 | placeholder="A cargar..." |
| 70 | 70 | ng-model="aCargar[key]" |
| 71 | 71 | ng-disabled="cisterna.disabled || !tieneArticulosPendientes()" |
| 72 | - ng-focus="aCargar[key] = rellenarInput(aCargar[key]); actualizarArticulo()" | |
| 72 | + ng-focus="aCargar[key] = rellenarInput(aCargar[key], cisterna); actualizarArticulo()" | |
| 73 | 73 | ng-change="actualizarArticulo()" |
| 74 | 74 | > |
| 75 | 75 | </td> |