Commit 7ead2bdea5f89ef8afa8d70602595057ac11cc22
Exists in
master
Merge branch 'master' into 'develop'
Master(mpuebla) See merge request !2
Showing
3 changed files
Show diff stats
src/js/controller.js
1 | angular.module('focaModalFormaPago') | 1 | angular.module('focaModalFormaPago') |
2 | .controller('focaModalFormaPagoController', [ | 2 | .controller('focaModalFormaPagoController', [ |
3 | '$timeout', '$filter', '$scope', '$uibModal', | 3 | '$timeout', '$filter', '$scope', '$uibModal', |
4 | '$uibModalInstance', 'focaModalFormaPagoService', | 4 | '$uibModalInstance', 'focaModalFormaPagoService', |
5 | function ($timeout, $filter, $scope, $uibModal, | 5 | function ($timeout, $filter, $scope, $uibModal, |
6 | $uibModalInstance, focaModalFormaPagoService) { | 6 | $uibModalInstance, focaModalFormaPagoService) { |
7 | 7 | ||
8 | //#region Variables | 8 | //#region Variables |
9 | $scope.botonesTarjetas = []; | 9 | $scope.botones = []; |
10 | //#endregion | 10 | //#endregion |
11 | 11 | ||
12 | init(); | 12 | init(); |
13 | 13 | ||
14 | function init() { | 14 | function init() { |
15 | $scope.botonesTarjetas = focaModalFormaPagoService.getBotonera(); | 15 | $scope.botones = focaModalFormaPagoService.getBotonera(); |
16 | } | 16 | } |
17 | 17 | ||
18 | $scope.seleccionarContado = function () { | 18 | $scope.seleccionarContado = function () { |
19 | var modalInstance = abrirModal('modal-tarjetas.html', | 19 | var modalInstance = abrirModal('modal-tarjetas.html', |
20 | 'focaModalTarjetasController'); | 20 | 'focaModalTarjetasController'); |
21 | modalInstance.result | 21 | modalInstance.result |
22 | .then(function (data) { | 22 | .then(function (data) { |
23 | console.log(data); | 23 | console.log(data); |
24 | }) | 24 | }) |
25 | .catch(function (e) { console.error(e); }); | 25 | .catch(function (e) { console.error(e); }); |
26 | }; | 26 | }; |
27 | 27 | ||
28 | $scope.seleccionarTarjetas = function () { | 28 | $scope.seleccionarTarjetas = function () { |
29 | var modalInstance = abrirModal('modal-tarjetas.html', | 29 | var modalInstance = abrirModal('modal-tarjetas.html', |
30 | 'focaModalTarjetasController'); | 30 | 'focaModalTarjetasController'); |
31 | modalInstance.result | 31 | modalInstance.result |
32 | .then(function (data) { | 32 | .then(function (data) { |
33 | console.log(data); | 33 | $uibModalInstance.close(data); |
34 | }) | 34 | }) |
35 | .catch(function (e) { console.error(e); }); | 35 | .catch(function (e) { console.error(e); }); |
36 | }; | 36 | }; |
37 | 37 | ||
38 | $scope.seleccionarCheque = function () { | 38 | $scope.seleccionarCheque = function () { |
39 | var modalInstance = abrirModal('modal-tarjetas.html', | 39 | var modalInstance = abrirModal('modal-tarjetas.html', |
40 | 'focaModalTarjetasController'); | 40 | 'focaModalTarjetasController'); |
41 | modalInstance.result | 41 | modalInstance.result |
42 | .then(function (data) { | 42 | .then(function (data) { |
43 | console.log(data); | 43 | console.log(data); |
44 | }) | 44 | }) |
45 | .catch(function (e) { console.error(e); }); | 45 | .catch(function (e) { console.error(e); }); |
46 | }; | 46 | }; |
47 | 47 | ||
48 | $scope.seleccionarVales = function () { | 48 | $scope.seleccionarVales = function () { |
49 | var modalInstance = abrirModal('modal-tarjetas.html', | 49 | var modalInstance = abrirModal('modal-tarjetas.html', |
50 | 'focaModalTarjetasController'); | 50 | 'focaModalTarjetasController'); |
51 | modalInstance.result | 51 | modalInstance.result |
52 | .then(function (data) { | 52 | .then(function (data) { |
53 | console.log(data); | 53 | console.log(data); |
54 | }) | 54 | }) |
55 | .catch(function (e) { console.error(e); }); | 55 | .catch(function (e) { console.error(e); }); |
56 | }; | 56 | }; |
57 | 57 | ||
58 | $scope.seleccionarPagoElectronico = function () { | 58 | $scope.seleccionarPagoElectronico = function () { |
59 | var modalInstance = abrirModal('modal-tarjetas.html', | 59 | var modalInstance = abrirModal('modal-tarjetas.html', |
60 | 'focaModalTarjetasController'); | 60 | 'focaModalTarjetasController'); |
61 | modalInstance.result | 61 | modalInstance.result |
62 | .then(function (data) { | 62 | .then(function (data) { |
63 | console.log(data); | 63 | console.log(data); |
64 | }) | 64 | }) |
65 | .catch(function (e) { console.error(e); }); | 65 | .catch(function (e) { console.error(e); }); |
66 | }; | 66 | }; |
67 | 67 | ||
68 | function abrirModal(templateUrl, controller) { | 68 | function abrirModal(templateUrl, controller) { |
69 | return $uibModal.open( | 69 | return $uibModal.open( |
70 | { | 70 | { |
71 | templateUrl: templateUrl, | 71 | templateUrl: templateUrl, |
72 | controller: controller, | 72 | controller: controller, |
73 | resolve: { | 73 | resolve: { |
74 | filters: function () { return null; }, | 74 | filters: function () { return null; }, |
75 | }, | 75 | }, |
76 | size: 'lg', | 76 | size: 'lg', |
77 | } | 77 | } |
78 | ); | 78 | ); |
79 | 79 | ||
80 | } | 80 | } |
81 | 81 | ||
82 | $scope.cancel = function () { | 82 | $scope.cancel = function () { |
83 | $uibModalInstance.dismiss('cancel'); | 83 | $uibModalInstance.dismiss('cancel'); |
84 | }; | 84 | }; |
85 | |||
86 | $scope.select = function (iva) { | ||
87 | $uibModalInstance.close(iva); | ||
88 | }; | ||
89 | }] | 85 | }] |
90 | ) | 86 | ) |
91 | .controller('focaModalTarjetasController', [ | 87 | .controller('focaModalTarjetasController', [ |
92 | '$timeout', '$filter', '$scope', '$uibModalInstance', 'focaModalTarjetasService', | 88 | '$timeout', '$filter', '$scope', '$uibModalInstance', 'focaModalTarjetasService', |
93 | function ($timeout, $filter, $scope, $uibModalInstance, focaModalTarjetasService) { | 89 | function ($timeout, $filter, $scope, $uibModalInstance, focaModalTarjetasService) { |
94 | 90 | ||
95 | //#region Variables | 91 | //#region Variables |
96 | $scope.botonesTarjetas = []; | 92 | $scope.botonesTarjetas = []; |
97 | $scope.showForm = false; | 93 | $scope.showForm = false; |
98 | 94 | ||
99 | //#endregion | 95 | //#endregion |
100 | 96 | ||
101 | init(); | 97 | init(); |
102 | 98 | ||
103 | function init() { | 99 | function init() { |
104 | $scope.botonesTarjetas = focaModalTarjetasService.getBotonera(); | 100 | $scope.botonesTarjetas = focaModalTarjetasService.getBotonera(); |
105 | } | 101 | } |
106 | 102 | ||
107 | $scope.seleccionarTarjeta = function () { | 103 | $scope.seleccionarTarjeta = function () { |
108 | animateForm(); | 104 | animateForm(); |
109 | }; | 105 | }; |
110 | 106 | ||
111 | $scope.cancel = function () { | 107 | $scope.cancel = function () { |
112 | $uibModalInstance.dismiss('cancel'); | 108 | $uibModalInstance.dismiss('cancel'); |
113 | }; | 109 | }; |
114 | 110 | ||
115 | $scope.select = function (iva) { | 111 | $scope.aceptarFormaDePago = function () { |
116 | $uibModalInstance.close(iva); | 112 | $uibModalInstance.close('data de tarjeta'); |
117 | }; | 113 | }; |
118 | 114 | ||
119 | function animateForm() { | 115 | function animateForm() { |
120 | $scope.showForm = false; | 116 | $scope.showForm = false; |
121 | $timeout(function () { | 117 | $timeout(function () { |
122 | $scope.showForm = true; | 118 | $scope.showForm = true; |
123 | }, 100); | 119 | }, 100); |
124 | } | 120 | } |
125 | }] | 121 | }] |
126 | ); | 122 | ); |
127 | 123 |
src/views/modal-forma-pago.html
1 | <div class="modal-header"> | 1 | <div class="modal-header"> |
2 | <h5 class="modal-title">Formas de pago</h5> | 2 | <h5 class="modal-title">Formas de pago</h5> |
3 | </div> | 3 | </div> |
4 | 4 | ||
5 | <div class="modal-body" id="modal-body"> | 5 | <div class="modal-body" id="modal-body"> |
6 | <div class="row"> | 6 | <div class="row"> |
7 | <div class="col-12 p-0"> | 7 | <div class="col-12 p-0"> |
8 | <div class="row mx-0 botonera-secundaria"> | 8 | <div class="row mx-0 botonera-secundaria"> |
9 | <div class="col-12"> | 9 | <div class="col-12"> |
10 | <foca-botonera-forma-pago | 10 | <foca-botonera-forma-pago |
11 | botones="botonesTarjetas" | 11 | botones="botones" |
12 | max="1" | 12 | max="1" |
13 | class="row justify-content-start mx-0" | 13 | class="row justify-content-start mx-0" |
14 | > | 14 | > |
15 | </foca-botonera-forma-pago> | 15 | </foca-botonera-forma-pago> |
16 | </div> | 16 | </div> |
17 | </div> | 17 | </div> |
18 | </div> | 18 | </div> |
19 | </div> | 19 | </div> |
20 | </div> | 20 | </div> |
21 | 21 | ||
22 | <div class="modal-footer"> | 22 | <div class="modal-footer"> |
23 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> | 23 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> |
24 | </div> | 24 | </div> |
25 | 25 |
src/views/modal-tarjetas.html
1 | <div class="modal-header"> | 1 | <div class="modal-header"> |
2 | <h5 class="modal-title">Pago con Tarjeta</h5> | 2 | <h5 class="modal-title">Pago con Tarjeta</h5> |
3 | </div> | 3 | </div> |
4 | 4 | ||
5 | <div class="modal-body" id="modal-body"> | 5 | <div class="modal-body" id="modal-body"> |
6 | <div class="row mb-2"> | 6 | <div class="row mb-2"> |
7 | <div class="col-12 p-0"> | 7 | <div class="col-12 p-0"> |
8 | <div class="row mx-0 botonera-secundaria"> | 8 | <div class="row mx-0 botonera-secundaria"> |
9 | <div class="col-12"> | 9 | <div class="col-12"> |
10 | <foca-botonera-tarjetas | 10 | <foca-botonera-tarjetas |
11 | botones="botonesTarjetas" | 11 | botones="botonesTarjetas" |
12 | max="1" | 12 | max="1" |
13 | class="row justify-content-start mx-0" | 13 | class="row justify-content-start mx-0" |
14 | > | 14 | > |
15 | </foca-botonera-tarjetas> | 15 | </foca-botonera-tarjetas> |
16 | </div> | 16 | </div> |
17 | </div> | 17 | </div> |
18 | </div> | 18 | </div> |
19 | </div> | 19 | </div> |
20 | <div class="border-top" ng-show="showForm"> | 20 | <div class="border-top" ng-show="showForm"> |
21 | <div class="row mt-4 fadeIn"> | 21 | <div class="row mt-4 fadeIn"> |
22 | <div class="col"> | 22 | <div class="col"> |
23 | <form> | 23 | <form> |
24 | <div class="row pb-3"> | 24 | <div class="row pb-3"> |
25 | <div class="col-3 col-sm-2 pr-1"> | 25 | <div class="col-3 col-sm-2 pr-1"> |
26 | <input class="form-control form-control-sm"> | 26 | <input class="form-control form-control-sm"> |
27 | </div> | 27 | </div> |
28 | <div class="col-9 col-sm-4 pl-2"> | 28 | <div class="col-9 col-sm-4 pl-2"> |
29 | <input class="form-control form-control-sm"> | 29 | <input class="form-control form-control-sm"> |
30 | </div> | 30 | </div> |
31 | </div> | 31 | </div> |
32 | <div class="row pb-3"> | 32 | <div class="row pb-3"> |
33 | <div class="col"> | 33 | <div class="col"> |
34 | <span>Importe</span> | 34 | <span>Importe</span> |
35 | <strong>$1560.45</strong> | 35 | <strong>$1560.45</strong> |
36 | </div> | 36 | </div> |
37 | </div> | 37 | </div> |
38 | <div class="row pb-3"> | 38 | <div class="row pb-3"> |
39 | <div class="col-auto pr-1 my-auto"> | 39 | <div class="col-auto pr-1 my-auto"> |
40 | <span>Cuotas</span> | 40 | <span>Cuotas</span> |
41 | </div> | 41 | </div> |
42 | <div class="col col-sm-5 pl-1"> | 42 | <div class="col col-sm-5 pl-1"> |
43 | <input | 43 | <input |
44 | class="form-control form-control-sm" | 44 | class="form-control form-control-sm" |
45 | type="number" | 45 | type="number" |
46 | ng-disabled="readonly"> | 46 | ng-disabled="readonly"> |
47 | </div> | 47 | </div> |
48 | </div> | 48 | </div> |
49 | <div class="row pb-3"> | 49 | <div class="row pb-3"> |
50 | <div class="col-auto pr-1 my-auto"> | 50 | <div class="col-auto pr-1 my-auto"> |
51 | <span>Terminal Nº</span> | 51 | <span>Terminal Nº</span> |
52 | </div> | 52 | </div> |
53 | <div class="col col-sm-5 pl-1"> | 53 | <div class="col col-sm-5 pl-1"> |
54 | <input | 54 | <input |
55 | class="form-control form-control-sm" | 55 | class="form-control form-control-sm" |
56 | type="number" | 56 | type="number" |
57 | ng-disabled="readonly"> | 57 | ng-disabled="readonly"> |
58 | </div> | 58 | </div> |
59 | </div> | 59 | </div> |
60 | </form> | 60 | </form> |
61 | </div> | 61 | </div> |
62 | </div> | 62 | </div> |
63 | </div> | 63 | </div> |
64 | </div> | 64 | </div> |
65 | 65 | ||
66 | 66 | ||
67 | <div class="modal-footer d-flex justify-content-between"> | 67 | <div class="modal-footer d-flex" ng-class="{ 'justify-content-between': showForm }"> |
68 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> | 68 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> |
69 | <button class="btn btn-sm btn-primary" type="button" ng-click="cancel()">Aceptar</button> | 69 | <button |
70 | class="btn btn-sm btn-primary" | ||
71 | type="button" | ||
72 | ng-click="aceptarFormaDePago()" | ||
73 | ng-show="showForm">Aceptar | ||
74 | </button> | ||
70 | </div> | 75 | </div> |
71 | 76 |