Commit 0c0ee4ad88913acc0af1dfabb19eeb6657a5ae25
Exists in
develop
Merge branch 'develop' into 'develop'
Develop See merge request !145
Showing
2 changed files
Show diff stats
src/js/controller.js
... | ... | @@ -965,13 +965,17 @@ angular.module('focaCrearRemito').controller('remitoController', |
965 | 965 | } else if ($scope.articuloACargar.cantidad < 0 || $scope.articuloACargar.precio < 0) { |
966 | 966 | focaModalService.alert('Los valores no pueden ser negativos'); |
967 | 967 | return; |
968 | - } else if (!Number.isInteger($scope.articuloACargar.cantidad)) { | |
968 | + } else if (!Number.isInteger(+$scope.articuloACargar.cantidad)) { | |
969 | 969 | focaModalService.alert('Debes introducir un número entero'); |
970 | 970 | return; |
971 | + } else if ($scope.articuloACargar.cantidad > 100000) { | |
972 | + focaModalService.alert('La cantidad máxima permitida es 100.000'); | |
973 | + return | |
974 | + } else { | |
975 | + delete $scope.articuloACargar.sectorCodigo; | |
976 | + $scope.remito.articulosRemito.push($scope.articuloACargar); | |
977 | + $scope.cargando = true; | |
971 | 978 | } |
972 | - delete $scope.articuloACargar.sectorCodigo; | |
973 | - $scope.remito.articulosRemito.push($scope.articuloACargar); | |
974 | - $scope.cargando = true; | |
975 | 979 | } |
976 | 980 | }; |
977 | 981 | |
... | ... | @@ -1005,9 +1009,12 @@ angular.module('focaCrearRemito').controller('remitoController', |
1005 | 1009 | } else if (tmpCantidad < 0 || tmpPrecio < 0) { |
1006 | 1010 | focaModalService.alert('Los valores no pueden ser negativos'); |
1007 | 1011 | return; |
1008 | - } else if (!Number.isInteger(tmpCantidad)) { | |
1012 | + } else if (!Number.isInteger(+tmpCantidad)) { | |
1009 | 1013 | focaModalService.alert('Debes introducir un número entero'); |
1010 | 1014 | return; |
1015 | + } else if (tmpCantidad > 100000) { | |
1016 | + focaModalService.alert('La cantidad máxima permitida es 100.000'); | |
1017 | + return | |
1011 | 1018 | } else { |
1012 | 1019 | articulo.cantidad = tmpCantidad; |
1013 | 1020 | articulo.precio = tmpPrecio; |
src/views/remito.html
... | ... | @@ -73,6 +73,8 @@ |
73 | 73 | class="form-control" |
74 | 74 | foca-tipo-input |
75 | 75 | min="1" |
76 | + max="100000" | |
77 | + maxlength="6" | |
76 | 78 | foca-focus="articulo.editCantidad" |
77 | 79 | ng-keypress="editarArticulo($event.keyCode, articulo, tmpCantidad, tmpPrecio);" |
78 | 80 | esc-key="cancelarEditar(articulo)" |
... | ... | @@ -157,6 +159,8 @@ |
157 | 159 | class="form-control" |
158 | 160 | foca-tipo-input |
159 | 161 | min="1" |
162 | + max="100000" | |
163 | + maxlength="6" | |
160 | 164 | ng-model="articuloACargar.cantidad" |
161 | 165 | foca-focus="!cargando" |
162 | 166 | esc-key="resetFilter()" |