Commit 3ff7da96d9f1667ef5c7108570ed2a327d260ae1
1 parent
2e56280b60
Exists in
develop
desactivar Guardar si Total > monto máximo permitido
Showing
2 changed files
with
13 additions
and
1 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -966,7 +966,7 @@ angular.module('focaCrearRemito').controller('remitoController', |
966 | 966 | focaModalService.alert('Los valores no pueden ser negativos'); |
967 | 967 | return; |
968 | 968 | } else if (!Number.isInteger(+$scope.articuloACargar.cantidad)) { |
969 | - focaModalService.alert('Debes introducir un número entero'); | |
969 | + focaModalService.alert('La cantidad debe ser un número entero'); | |
970 | 970 | return; |
971 | 971 | } else if ($scope.articuloACargar.cantidad > 100000) { |
972 | 972 | focaModalService.alert('La cantidad máxima permitida es 100.000'); |
... | ... | @@ -1023,6 +1023,17 @@ angular.module('focaCrearRemito').controller('remitoController', |
1023 | 1023 | } |
1024 | 1024 | } |
1025 | 1025 | }; |
1026 | + //Si el monto Total es superior a $10.000.000.000,00 desactivo el botón Guardar | |
1027 | + $scope.comprobarTotal = function() { | |
1028 | + if ($scope.getTotal() >= 10000000000) { | |
1029 | + focaModalService.alert('El monto total debe ser menor a $10.000.000.000,00, elimina un artículo o reduce las cantidades'); | |
1030 | + $( "#guardar" ).prop( "disabled", true ); | |
1031 | + return true; | |
1032 | + } else { | |
1033 | + $( "#guardar" ).prop( "disabled", false ); | |
1034 | + return false; | |
1035 | + } | |
1036 | + }; | |
1026 | 1037 | |
1027 | 1038 | $scope.cancelarEditar = function (articulo) { |
1028 | 1039 | $scope.tmpCantidad = articulo.cantidad; |
src/views/remito.html