Commit 8fb99df68fca24cbc84c7733fe1dbba9a75b744f
1 parent
13b669e94b
Exists in
master
validación
Showing
2 changed files
with
13 additions
and
2 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -186,6 +186,17 @@ angular.module('focaModalDescarga') |
| 186 | 186 | return importe; |
| 187 | 187 | }; |
| 188 | 188 | function validarDescarga() { |
| 189 | + | |
| 190 | + if ($scope.nroRemito > 99999999) { | |
| 191 | + focaModalService.alert('Numero remito mayor al permitido máximo 8'); | |
| 192 | + return true; | |
| 193 | + } | |
| 194 | + | |
| 195 | + if ($scope.nroSucursal > 9999) { | |
| 196 | + focaModalService.alert('Numero sucursal mayor a la permitida máximo 4'); | |
| 197 | + return true; | |
| 198 | + } | |
| 199 | + | |
| 189 | 200 | for (var i = 0; i < $scope.cisternas.length; i++) { |
| 190 | 201 | if (parseInt($scope.cisternas[i].cisternaCarga.descargar) > |
| 191 | 202 | $scope.cisternas[i].cisternaCarga.cantidad || |
src/views/foca-modal-descarga.html
| ... | ... | @@ -44,7 +44,7 @@ |
| 44 | 44 | ng-focus="$event.target.select();" |
| 45 | 45 | ng-model="nroSucursal" |
| 46 | 46 | ng-change="validateSucursalRemito(nroSucursal, nroRemito)" |
| 47 | - limite-numeros-max="4"> | |
| 47 | + > | |
| 48 | 48 | </div> |
| 49 | 49 | <div class="col-6 mt-1"> |
| 50 | 50 | <input |
| ... | ... | @@ -52,7 +52,7 @@ |
| 52 | 52 | ng-focus="$event.target.select();" |
| 53 | 53 | ng-model="nroRemito" |
| 54 | 54 | ng-change="validateSucursalRemito(nroSucursal, nroRemito)" |
| 55 | - limite-numeros-max="8"> | |
| 55 | + > | |
| 56 | 56 | </div> |
| 57 | 57 | <div |
| 58 | 58 | class="col-12 mt-1 alert alert-danger text-center" role="alert" |