Commit aed93935daf5431da84374d6bccfc0841da62e33
1 parent
68357b30ab
Exists in
develop
Agregado modal para ingresar monto en forma de pago con efectivo.
Showing
2 changed files
with
14 additions
and
14 deletions
Show diff stats
src/js/controller.js
1 | 1 | angular.module('focaModalFormaPago') |
2 | 2 | .controller('focaModalFormaPagoController', [ |
3 | 3 | '$timeout', '$filter', '$scope', '$uibModal', |
4 | - '$uibModalInstance', 'focaModalFormaPagoService', 'parametros', | |
4 | + '$uibModalInstance', 'focaModalFormaPagoService', 'parametros', 'focaModalService', | |
5 | 5 | function ($timeout, $filter, $scope, $uibModal, |
6 | - $uibModalInstance, focaModalFormaPagoService, parametros) { | |
6 | + $uibModalInstance, focaModalFormaPagoService, parametros, focaModalService) { | |
7 | 7 | |
8 | 8 | //#region Variables |
9 | 9 | $scope.botones = []; |
... | ... | @@ -16,11 +16,10 @@ angular.module('focaModalFormaPago') |
16 | 16 | } |
17 | 17 | |
18 | 18 | $scope.seleccionarEfectivo = function () { |
19 | - var modalInstance = abrirModal('modal-tarjetas.html', | |
20 | - 'focaModalTarjetasController'); | |
21 | - modalInstance.result | |
19 | + var modalInstance = focaModalService.prompt({ titulo: 'Ingrese monto' }); | |
20 | + modalInstance | |
22 | 21 | .then(function (data) { |
23 | - console.log(data); | |
22 | + $uibModalInstance.close({ data: data, tipo: 'efectivo' }); | |
24 | 23 | }) |
25 | 24 | .catch(function (e) { console.error(e); }); |
26 | 25 | }; |
... | ... | @@ -30,7 +29,7 @@ angular.module('focaModalFormaPago') |
30 | 29 | 'focaModalTarjetasController'); |
31 | 30 | modalInstance.result |
32 | 31 | .then(function (data) { |
33 | - $uibModalInstance.close({data: data, tipo: 'tarjeta'}); | |
32 | + $uibModalInstance.close({ data: data, tipo: 'tarjeta' }); | |
34 | 33 | }) |
35 | 34 | .catch(function (e) { console.error(e); }); |
36 | 35 | }; |
... | ... | @@ -71,9 +70,11 @@ angular.module('focaModalFormaPago') |
71 | 70 | templateUrl: templateUrl, |
72 | 71 | controller: controller, |
73 | 72 | resolve: { |
74 | - parametros: function () { return { | |
75 | - importe: parametros.importe | |
76 | - }; }, | |
73 | + parametros: function () { | |
74 | + return { | |
75 | + importe: parametros.importe | |
76 | + }; | |
77 | + }, | |
77 | 78 | }, |
78 | 79 | size: 'lg', |
79 | 80 | } |
... | ... | @@ -90,8 +91,7 @@ angular.module('focaModalFormaPago') |
90 | 91 | '$timeout', '$filter', '$scope', '$uibModalInstance', 'focaModalTarjetasService', |
91 | 92 | 'parametros', |
92 | 93 | function ($timeout, $filter, $scope, $uibModalInstance, focaModalTarjetasService, |
93 | - parametros) | |
94 | - { | |
94 | + parametros) { | |
95 | 95 | |
96 | 96 | $scope.parametros = parametros; |
97 | 97 | |
... | ... | @@ -105,7 +105,7 @@ angular.module('focaModalFormaPago') |
105 | 105 | |
106 | 106 | function init() { |
107 | 107 | |
108 | - focaModalTarjetasService.getTarjetas().then(function(res) { | |
108 | + focaModalTarjetasService.getTarjetas().then(function (res) { | |
109 | 109 | |
110 | 110 | res.data.forEach(function (boton) { |
111 | 111 | $scope.botonesTarjetas.push({ |