Commit d163d0153ced4d2d13e3c73838c186edba1f6ada
1 parent
3ff7da96d9
Exists in
develop
compruebo el total desde getTotal
Showing
2 changed files
with
3 additions
and
5 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -683,6 +683,7 @@ angular.module('focaCrearRemito').controller('remitoController', |
| 683 | 683 | for (var i = 0; i < arrayTempArticulos.length; i++) { |
| 684 | 684 | total += arrayTempArticulos[i].precio * arrayTempArticulos[i].cantidad; |
| 685 | 685 | } |
| 686 | + $scope.comprobarTotal(parseFloat(total.toFixed(2))); | |
| 686 | 687 | return parseFloat(total.toFixed(2)); |
| 687 | 688 | }; |
| 688 | 689 | |
| ... | ... | @@ -1024,14 +1025,12 @@ angular.module('focaCrearRemito').controller('remitoController', |
| 1024 | 1025 | } |
| 1025 | 1026 | }; |
| 1026 | 1027 | //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) { | |
| 1028 | + $scope.comprobarTotal = function(total) { | |
| 1029 | + if (total >= 10000000000) { | |
| 1029 | 1030 | focaModalService.alert('El monto total debe ser menor a $10.000.000.000,00, elimina un artículo o reduce las cantidades'); |
| 1030 | 1031 | $( "#guardar" ).prop( "disabled", true ); |
| 1031 | - return true; | |
| 1032 | 1032 | } else { |
| 1033 | 1033 | $( "#guardar" ).prop( "disabled", false ); |
| 1034 | - return false; | |
| 1035 | 1034 | } |
| 1036 | 1035 | }; |
| 1037 | 1036 |
src/views/remito.html