Commit d163d0153ced4d2d13e3c73838c186edba1f6ada

Authored by Luis Suarez
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(&#39;focaCrearRemito&#39;).controller(&#39;remitoController&#39;,
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
... ... @@ -228,7 +228,6 @@
228 228 <span class="ml-3 text-muted" ng-click="salir()">Salir</span>
229 229 <span
230 230 class="mr-3 ml-auto"
231   - ng-disabled="comprobarTotal()"
232 231 ng-class="saveLoading ? 'text-muted' : ''"
233 232 ng-click="crearRemito()"
234 233 ladda="saveLoading"