Commit 6d06dd1ca2f70c0b4d905f91f8d17d1327c698e2
1 parent
c763583dd4
Exists in
master
recibo precio sugerido
Showing
1 changed file
with
5 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 | function($scope, $uibModalInstance) { | 6 | 'sugerido', |
7 | function($scope, $uibModalInstance, sugerido) { | ||
8 | if(sugerido && sugerido < 0) { | ||
9 | $scope.efectivo = Math.abs(sugerido); | ||
10 | } | ||
7 | $scope.aceptar = function(key) { | 11 | $scope.aceptar = function(key) { |
8 | if(key === 13 && $scope.efectivo) { | 12 | if(key === 13 && $scope.efectivo) { |
9 | var efectivo = parseFloat($scope.efectivo); | 13 | var efectivo = parseFloat($scope.efectivo); |
10 | $uibModalInstance.close(efectivo); | 14 | $uibModalInstance.close(efectivo); |
11 | } | 15 | } |
12 | }; | 16 | }; |
13 | 17 | ||
14 | $scope.cancel = function() { | 18 | $scope.cancel = function() { |
15 | $uibModalInstance.dismiss('cancel'); | 19 | $uibModalInstance.dismiss('cancel'); |
16 | }; | 20 | }; |
17 | } | 21 | } |
18 | ] | 22 | ] |
19 | ); | 23 | ); |
20 | 24 |