Commit 8c554e03bb498567c23b3a00f7b7a4fcc75662ae

Authored by Eric Fernandez
1 parent 358a1bae1c
Exists in master

valido que no se ingrese 0

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
src/js/controller.js
1 angular.module('focaModalEfectivo') 1 angular.module('focaModalEfectivo')
2 .controller('focaModalEfectivoController', 2 .controller('focaModalEfectivoController',
3 [ 3 [
4 '$scope', 4 '$scope',
5 '$uibModalInstance', 5 '$uibModalInstance',
6 'sugerido', 6 'sugerido',
7 function($scope, $uibModalInstance, sugerido) { 7 function($scope, $uibModalInstance, sugerido) {
8 if(sugerido && sugerido < 0) { 8 if(sugerido && sugerido < 0) {
9 $scope.efectivo = Math.abs(sugerido); 9 $scope.efectivo = Math.abs(sugerido);
10 } 10 }
11 $scope.aceptar = function(key) { 11 $scope.aceptar = function(key) {
12 if(key === 13 && $scope.efectivo) { 12 if(key === 13 && parseFloat($scope.efectivo)) {
13 var efectivo = parseFloat($scope.efectivo); 13 var efectivo = parseFloat($scope.efectivo);
14 $uibModalInstance.close(efectivo); 14 $uibModalInstance.close(efectivo);
15 } 15 }
16 }; 16 };
17 17
18 $scope.cancel = function() { 18 $scope.cancel = function() {
19 $uibModalInstance.dismiss('cancel'); 19 $uibModalInstance.dismiss('cancel');
20 }; 20 };
21 } 21 }
22 ] 22 ]
23 ); 23 );
24 24