Commit 92a728e90618defede0a6dca2f6064613a237c16
Exists in
master
Merge branch 'develop' into 'master'
Develop See merge request !10
Showing
4 changed files
Show diff stats
package.json
1 | { | 1 | { |
2 | "name": "foca-modal-resumen-cuenta", | 2 | "name": "foca-modal-resumen-cuenta", |
3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
4 | "description": "Modal para resumen de cuenta en cobranzas", | 4 | "description": "Modal para resumen de cuenta en cobranzas", |
5 | "main": "index.js", | 5 | "main": "index.js", |
6 | "scripts": { | 6 | "scripts": { |
7 | "refresh" : "gulp uglify && cp tmp/foca-modal-resumen-cuenta.js ../wrapper-demo/node_modules/foca-modal-resumen-cuenta/dist/foca-modal-resumen-cuenta.min.js", | ||
7 | "test": "echo \"Error: no test specified\" && exit 1", | 8 | "test": "echo \"Error: no test specified\" && exit 1", |
8 | "gulp-pre-commit": "gulp pre-commit", | 9 | "gulp-pre-commit": "gulp pre-commit", |
9 | "compile": "gulp uglify", | 10 | "compile": "gulp uglify", |
10 | "postinstall": "npm run compile && gulp clean-post-install", | 11 | "postinstall": "npm run compile && gulp clean-post-install", |
11 | "install-dev": "npm install --ignore-scripts" | 12 | "install-dev": "npm install --ignore-scripts" |
12 | }, | 13 | }, |
13 | "pre-commit": [ | 14 | "pre-commit": [ |
14 | "gulp-pre-commit" | 15 | "gulp-pre-commit" |
15 | ], | 16 | ], |
16 | "repository": { | 17 | "repository": { |
17 | "type": "git", | 18 | "type": "git", |
18 | "url": "http://git.focasoftware.com/npm/foca-modal-resumen-cuenta" | 19 | "url": "http://git.focasoftware.com/npm/foca-modal-resumen-cuenta" |
19 | }, | 20 | }, |
20 | "author": "Foca Software", | 21 | "author": "Foca Software", |
21 | "license": "ISC", | 22 | "license": "ISC", |
22 | "peerDependencies": { | 23 | "peerDependencies": { |
23 | "angular": "^1.7.4", | 24 | "angular": "^1.7.4", |
24 | "bootstrap": "^4.1.3", | 25 | "bootstrap": "^4.1.3", |
25 | "font-awesome": "^4.7.0", | 26 | "font-awesome": "^4.7.0", |
26 | "ui-bootstrap4": "^3.0.4", | 27 | "ui-bootstrap4": "^3.0.4", |
27 | "gulp": "^3.9.1", | 28 | "gulp": "^3.9.1", |
28 | "gulp-angular-templatecache": "^2.2.1", | 29 | "gulp-angular-templatecache": "^2.2.1", |
29 | "gulp-concat": "^2.6.1", | 30 | "gulp-concat": "^2.6.1", |
30 | "gulp-connect": "^5.6.1", | 31 | "gulp-connect": "^5.6.1", |
31 | "gulp-htmlmin": "^5.0.1", | 32 | "gulp-htmlmin": "^5.0.1", |
32 | "gulp-rename": "^1.4.0", | 33 | "gulp-rename": "^1.4.0", |
33 | "gulp-replace": "^1.0.0", | 34 | "gulp-replace": "^1.0.0", |
34 | "gulp-uglify": "^3.0.1", | 35 | "gulp-uglify": "^3.0.1", |
35 | "jquery": "^3.3.1", | 36 | "jquery": "^3.3.1", |
36 | "pump": "^3.0.0", | 37 | "pump": "^3.0.0", |
37 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git" | 38 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git" |
38 | }, | 39 | }, |
39 | "devDependencies": { | 40 | "devDependencies": { |
40 | "angular": "1.7.5", | 41 | "angular": "1.7.5", |
41 | "angular-ladda": "0.4.3", | 42 | "angular-ladda": "0.4.3", |
42 | "bootstrap": "4.1.3", | 43 | "bootstrap": "4.1.3", |
43 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git", | 44 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git", |
44 | "font-awesome": "4.7.0", | 45 | "font-awesome": "4.7.0", |
45 | "gulp": "3.9.1", | 46 | "gulp": "3.9.1", |
46 | "gulp-angular-templatecache": "2.2.5", | 47 | "gulp-angular-templatecache": "2.2.5", |
47 | "gulp-clean": "0.4.0", | 48 | "gulp-clean": "0.4.0", |
48 | "gulp-concat": "2.6.1", | 49 | "gulp-concat": "2.6.1", |
49 | "gulp-connect": "5.6.1", | 50 | "gulp-connect": "5.6.1", |
50 | "gulp-htmlmin": "5.0.1", | 51 | "gulp-htmlmin": "5.0.1", |
51 | "gulp-jshint": "2.1.0", | 52 | "gulp-jshint": "2.1.0", |
52 | "gulp-rename": "1.4.0", | 53 | "gulp-rename": "1.4.0", |
53 | "gulp-replace": "1.0.0", | 54 | "gulp-replace": "1.0.0", |
54 | "gulp-uglify": "3.0.1", | 55 | "gulp-uglify": "3.0.1", |
55 | "jasmine-core": "3.3.0", | 56 | "jasmine-core": "3.3.0", |
56 | "jquery": "3.3.1", | 57 | "jquery": "3.3.1", |
57 | "jshint": "2.9.6", | 58 | "jshint": "2.9.6", |
58 | "ladda": "1.0.6", | 59 | "ladda": "1.0.6", |
59 | "pre-commit": "1.2.2", | 60 | "pre-commit": "1.2.2", |
60 | "pump": "3.0.0", | 61 | "pump": "3.0.0", |
61 | "ui-bootstrap4": "3.0.5" | 62 | "ui-bootstrap4": "3.0.5" |
62 | } | 63 | } |
63 | } | 64 | } |
64 | 65 |
src/js/controller.js
1 | angular.module('focaModalResumenCuenta') | 1 | angular.module('focaModalResumenCuenta') |
2 | .controller('focaModalResumenCuentaController', [ | 2 | .controller('focaModalResumenCuentaController', [ |
3 | '$timeout', | 3 | '$timeout', |
4 | '$filter', | 4 | '$filter', |
5 | '$scope', | 5 | '$scope', |
6 | '$uibModalInstance', | 6 | '$uibModalInstance', |
7 | 'focaModalResumenCuentaService', | 7 | 'focaModalResumenCuentaService', |
8 | 'cliente', | 8 | 'cliente', |
9 | 'idMoneda', | ||
9 | '$uibModal', | 10 | '$uibModal', |
10 | 'focaModalService', | 11 | 'focaModalService', |
11 | function($timeout, $filter, $scope, $uibModalInstance, | 12 | function ($timeout, $filter, $scope, $uibModalInstance, |
12 | focaModalResumenCuentaService, cliente, $uibModal, focaModalService) { | 13 | focaModalResumenCuentaService, cliente, idMoneda, $uibModal, focaModalService) { |
13 | var fecha = new Date(); | 14 | var fecha = new Date(); |
14 | $scope.generado = false; | 15 | $scope.generado = false; |
15 | $scope.fechaDesde = new Date(fecha.setMonth(fecha.getMonth() - 1)); | 16 | $scope.fechaDesde = new Date(fecha.setMonth(fecha.getMonth() - 1)); |
16 | $scope.currentPageFacturas = []; | 17 | $scope.currentPageFacturas = []; |
17 | $scope.currentPage = 1; | 18 | $scope.currentPage = 1; |
18 | $scope.numPerPage = 10; | 19 | $scope.numPerPage = 10; |
19 | $scope.selectedFactura = -1; | 20 | $scope.selectedFactura = -1; |
20 | 21 | ||
21 | $scope.generar = function() { | 22 | $scope.generar = function () { |
22 | focaModalResumenCuentaService | 23 | focaModalResumenCuentaService |
23 | .getResumenCuenta(cliente.COD, $scope.fechaDesde) | 24 | .getResumenCuenta(cliente.COD, idMoneda, $scope.fechaDesde) |
24 | .then(function(res) { | 25 | .then(function (res) { |
25 | res.data.facturas = calcularSaldos(res.data.facturas); | 26 | res.data = res.data.filter(function(factura){ |
27 | return factura.TCO !== "RC" && factura.TCO !== "RE" | ||
28 | }) | ||
29 | res.data = calcularSaldos(res.data); | ||
26 | $scope.generado = true; | 30 | $scope.generado = true; |
27 | $scope.results = res.data; | 31 | $scope.results = res.data; |
28 | $scope.results.fechaDesde = $scope.fechaDesde; | 32 | // $scope.results.fechaDesde = $scope.fechaDesde; |
29 | $scope.search(); | 33 | $scope.search(); |
30 | }); | 34 | }); |
31 | }; | 35 | }; |
32 | 36 | ||
33 | $scope.cancel = function() { | 37 | $scope.cancel = function () { |
34 | if ($scope.generado) { | 38 | if ($scope.generado) { |
35 | $scope.generado = false; | 39 | $scope.generado = false; |
36 | } else { | 40 | } else { |
37 | $uibModalInstance.dismiss('cancel'); | 41 | $uibModalInstance.dismiss('cancel'); |
38 | } | 42 | } |
39 | }; | 43 | }; |
40 | 44 | ||
41 | $scope.enviarMail = function(factura) { | 45 | $scope.enviarMail = function (factura) { |
42 | focaModalService.mail( | 46 | focaModalService.mail( |
43 | { | 47 | { |
44 | titulo: 'Enviar comprobante', | 48 | titulo: 'Enviar comprobante', |
45 | descarga: { | 49 | descarga: { |
46 | nombre: factura.numeroFactura + '.pdf', | 50 | nombre: factura.numeroFactura + '.pdf', |
47 | url: '/mail/comprobante/descargar', | 51 | url: '/mail/comprobante/descargar', |
48 | }, | 52 | }, |
49 | envio: { | 53 | envio: { |
50 | mailCliente: cliente.MAIL, | 54 | mailCliente: cliente.MAIL, |
51 | url: '/mail/comprobante' | 55 | url: '/mail/comprobante' |
52 | }, | 56 | }, |
53 | options: { | 57 | options: { |
54 | factura: factura | 58 | factura: factura |
55 | } | 59 | } |
56 | } | 60 | } |
57 | ); | 61 | ); |
58 | }; | 62 | }; |
59 | 63 | ||
60 | $scope.enviarResumen = function() { | 64 | $scope.enviarResumen = function () { |
61 | focaModalService.mail( | 65 | focaModalService.mail( |
62 | { | 66 | { |
63 | titulo: 'Enviar resumen de cuenta', | 67 | titulo: 'Enviar resumen de cuenta', |
64 | descarga: { | 68 | descarga: { |
65 | nombre: 'resumen-de-cuenta.pdf', | 69 | nombre: 'resumen-de-cuenta.pdf', |
66 | url: '/mail/resumen-cuenta/descargar', | 70 | url: '/mail/resumen-cuenta/descargar', |
67 | }, | 71 | }, |
68 | envio: { | 72 | envio: { |
69 | mailCliente: cliente.MAIL, | 73 | mailCliente: cliente.MAIL, |
70 | url: '/mail/resumen-cuenta', | 74 | url: '/mail/resumen-cuenta', |
71 | }, | 75 | }, |
72 | options: { | 76 | options: { |
73 | resumen: $scope.results | 77 | resumen: $scope.results |
74 | } | 78 | } |
75 | } | 79 | } |
76 | ); | 80 | ); |
77 | }; | 81 | }; |
78 | 82 | ||
79 | $scope.verFactura = function(factura) { | 83 | $scope.verFactura = function (factura) { |
80 | var modalInstance = $uibModal.open( | 84 | var modalInstance = $uibModal.open( |
81 | { | 85 | { |
82 | ariaLabelledBy: 'Detalle de factura', | 86 | ariaLabelledBy: 'Detalle de factura', |
83 | templateUrl: 'foca-modal-factura-detalle.html', | 87 | templateUrl: 'foca-modal-factura-detalle.html', |
84 | controller: 'focaModalFacturaDetalleController', | 88 | controller: 'focaModalFacturaDetalleController', |
85 | size: 'md', | 89 | size: 'md', |
86 | resolve: { | 90 | resolve: { |
87 | factura: factura | 91 | factura: factura |
88 | } | 92 | } |
89 | } | 93 | } |
90 | ); | 94 | ); |
91 | modalInstance.result.then(); | 95 | modalInstance.result.then(); |
92 | }; | 96 | }; |
93 | 97 | ||
94 | 98 | ||
95 | $scope.search = function() { | 99 | $scope.search = function () { |
96 | if ($scope.results.facturas.length) { | 100 | if ($scope.results.length) { |
97 | $scope.lastPage = Math.ceil( | 101 | $scope.lastPage = Math.ceil( |
98 | $scope.results.facturas.length / $scope.numPerPage | 102 | $scope.results.length / $scope.numPerPage |
99 | ); | 103 | ); |
100 | $scope.resetPage(); | 104 | $scope.resetPage(); |
101 | } | 105 | } |
102 | }; | 106 | }; |
103 | 107 | ||
104 | $scope.resetPage = function() { | 108 | $scope.resetPage = function () { |
105 | $scope.currentPage = 1; | 109 | $scope.currentPage = 1; |
106 | $scope.selectPage(1); | 110 | $scope.selectPage(1); |
107 | }; | 111 | }; |
108 | 112 | ||
109 | $scope.selectPage = function(page) { | 113 | $scope.selectPage = function (page) { |
110 | var start = (page - 1) * $scope.numPerPage; | 114 | var start = (page - 1) * $scope.numPerPage; |
111 | var end = start + $scope.numPerPage; | 115 | var end = start + $scope.numPerPage; |
112 | $scope.paginas = []; | 116 | $scope.paginas = []; |
113 | $scope.paginas = calcularPages(page); | 117 | $scope.paginas = calcularPages(page); |
114 | $scope.currentPageFacturas = $scope.results.facturas.slice(start, end); | 118 | $scope.currentPageFacturas = $scope.results.slice(start, end); |
115 | $scope.currentPage = page; | 119 | $scope.currentPage = page; |
116 | }; | 120 | }; |
117 | 121 | ||
118 | function calcularPages(paginaActual) { | 122 | function calcularPages(paginaActual) { |
119 | var paginas = []; | 123 | var paginas = []; |
120 | paginas.push(paginaActual); | 124 | paginas.push(paginaActual); |
121 | 125 | ||
122 | if (paginaActual - 1 > 1) { | 126 | if (paginaActual - 1 > 1) { |
123 | 127 | ||
124 | paginas.unshift(paginaActual - 1); | 128 | paginas.unshift(paginaActual - 1); |
125 | if (paginaActual - 2 > 1) { | 129 | if (paginaActual - 2 > 1) { |
126 | paginas.unshift(paginaActual - 2); | 130 | paginas.unshift(paginaActual - 2); |
127 | } | 131 | } |
128 | } | 132 | } |
129 | 133 | ||
130 | if (paginaActual + 1 < $scope.lastPage) { | 134 | if (paginaActual + 1 < $scope.lastPage) { |
131 | paginas.push(paginaActual + 1); | 135 | paginas.push(paginaActual + 1); |
132 | if (paginaActual + 2 < $scope.lastPage) { | 136 | if (paginaActual + 2 < $scope.lastPage) { |
133 | paginas.push(paginaActual + 2); | 137 | paginas.push(paginaActual + 2); |
134 | } | 138 | } |
135 | } | 139 | } |
136 | 140 | ||
137 | if (paginaActual !== 1) { | 141 | if (paginaActual !== 1) { |
138 | paginas.unshift(1); | 142 | paginas.unshift(1); |
139 | } | 143 | } |
140 | 144 | ||
141 | if (paginaActual !== $scope.lastPage) { | 145 | if (paginaActual !== $scope.lastPage) { |
142 | paginas.push($scope.lastPage); | 146 | paginas.push($scope.lastPage); |
143 | } | 147 | } |
144 | 148 | ||
145 | return paginas; | 149 | return paginas; |
146 | } | 150 | } |
147 | 151 | ||
148 | function calcularSaldos(facturas) { | 152 | function calcularSaldos(facturas) { |
149 | var saldo = 0; | 153 | var saldo = 0; |
150 | 154 | ||
151 | facturas.forEach(function(factura) { | 155 | facturas.forEach(function (factura) { |
152 | if (factura.TCO === 'CI' || | 156 | if (factura.TCO === 'CI' || |
153 | factura.TCO === 'FT' || | 157 | factura.TCO === 'FT' || |
154 | factura.TCO === 'ND'){ | 158 | factura.TCO === 'ND') { |
155 | factura.IPA = factura.IPA * -1; | 159 | factura.IPA = factura.IPA * -1; |
156 | } else { | 160 | } else { |
157 | factura.IPA = factura.IPA; | 161 | factura.IPA = factura.IPA; |
158 | } | 162 | } |
159 | saldo += factura.IPA; | 163 | saldo += factura.IPA; |
160 | factura.saldo = saldo; | 164 | factura.saldo = saldo; |
161 | factura.saldo_show = Math.abs(saldo); | 165 | factura.saldo_show = Math.abs(saldo); |
162 | factura.IPA_SHOW = Math.abs(factura.IPA); | 166 | factura.IPA_SHOW = Math.abs(factura.IPA); |
163 | }); | 167 | }); |
164 | 168 | facturas.saldo = saldo; | |
165 | return facturas; | 169 | return facturas; |
166 | } | 170 | } |
167 | }] | 171 | }] |
168 | ); | 172 | ); |
169 | 173 |
src/js/service.js
1 | angular.module('focaModalResumenCuenta') | 1 | angular.module('focaModalResumenCuenta') |
2 | .factory('focaModalResumenCuentaService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { | 2 | .factory('focaModalResumenCuentaService', ['$http', 'API_ENDPOINT', function ($http, API_ENDPOINT) { |
3 | return { | 3 | return { |
4 | getResumenCuenta: function(idCliente, fechaDesde) { | 4 | getResumenCuenta: function (idCliente, idMoneda, fechaDesde) { |
5 | return $http.get(API_ENDPOINT.URL + | 5 | return $http.get(API_ENDPOINT.URL + '/factura/cliente/' + idCliente + '/' + idMoneda + '/' + |
6 | '/factura/resumen/' + idCliente + '/' + fechaDesde); | 6 | fechaDesde + '/' + '2100-12-31' + '/' + true); |
7 | // '2001-01-01', | ||
8 | // '2100-12-31' | ||
7 | }, | 9 | }, |
8 | enviarFacturaPorMail: function(receiver, factura) { | 10 | enviarFacturaPorMail: function (receiver, factura) { |
9 | return $http.post(API_ENDPOINT.URL + '/mail', | 11 | return $http.post(API_ENDPOINT.URL + '/mail', |
10 | {receiver: receiver, factura: factura}); | 12 | { receiver: receiver, factura: factura }); |
11 | }, | 13 | }, |
12 | enviarResumenPorMail: function(receiver, resumen) { | 14 | enviarResumenPorMail: function (receiver, resumen) { |
13 | return $http.post(API_ENDPOINT.URL + '/mail/resumen-cuenta', | 15 | return $http.post(API_ENDPOINT.URL + '/mail/resumen-cuenta', |
14 | {receiver: receiver, resumen: resumen}); | 16 | { receiver: receiver, resumen: resumen }); |
15 | } | 17 | } |
16 | }; | 18 | }; |
17 | }]); | 19 | }]); |
18 | 20 |
src/views/modal-resumen-cuenta.html
1 | <div class="modal-header py-1"> | 1 | <div class="modal-header py-1"> |
2 | <div class="row w-100"> | 2 | <div class="row w-100"> |
3 | <div class="col-lg-6"> | 3 | <div class="col-lg-6"> |
4 | <h5 class="modal-title my-1">Resumen de cuenta</h5> | 4 | <h5 class="modal-title my-1">Resumen de cuenta</h5> |
5 | </div> | 5 | </div> |
6 | <div class="col-lg-6 text-right" ng-show="generado"> | 6 | <div class="col-lg-6 text-right" ng-show="generado"> |
7 | <h6 class="modal-title my-1">Saldo hasta la fecha: {{results.saldo | number: 2}}</h6> | 7 | <h6 class="modal-title my-1">Saldo hasta la fecha: {{results.saldo | number: 2}}</h6> |
8 | </div> | 8 | </div> |
9 | </div> | 9 | </div> |
10 | </div> | 10 | </div> |
11 | <div class="modal-body" id="modal-body"> | 11 | <div class="modal-body" id="modal-body"> |
12 | <div class="input-group row" | 12 | <div class="input-group row" |
13 | ng-hide="generado"> | 13 | ng-hide="generado"> |
14 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> | 14 | <small class="col-md-2 col-4 text-left my-1">Fecha Desde</small> |
15 | <div class="col-md-4 col-8 input-group mb-2"> | 15 | <div class="col-md-4 col-8 input-group mb-3"> |
16 | <div class="input-group-prepend"> | 16 | <div class="input-group-prepend"> |
17 | <div class="input-group-text form-control-sm"> | 17 | <button |
18 | type="button" | ||
19 | ng-click="datepickerOpen = true" | ||
20 | class="input-group-text"> | ||
18 | <i class="fa fa-calendar"></i> | 21 | <i class="fa fa-calendar"></i> |
19 | </div> | 22 | </button> |
20 | </div> | 23 | </div> |
21 | <input | 24 | <input |
22 | class="form-control form-control-sm" | 25 | class="form-control form-control-sm" |
23 | id="inlineFormInputGroup" | 26 | id="inlineFormInputGroup" |
24 | ladda="searchLoading" | 27 | ladda="searchLoading" |
25 | type="text" | 28 | type="text" |
26 | ng-model="fechaDesde" | 29 | ng-model="fechaDesde" |
27 | ng-required="true" | 30 | ng-required="true" |
28 | uib-datepicker-popup="dd/MM/yyyy" | 31 | uib-datepicker-popup="dd/MM/yyyy" |
29 | show-button-bar="false" | 32 | show-button-bar="false" |
30 | is-open="datepickerOpen" | 33 | is-open="datepickerOpen" |
31 | on-open-focus="false" | 34 | on-open-focus="false" |
32 | ng-focus="datepickerOpen = true" | 35 | ng-focus="datepickerOpen = true" |
33 | /> | 36 | /> |
34 | </div> | 37 | </div> |
35 | </div> | 38 | </div> |
36 | <table class="table table-striped table-sm" ng-show="generado"> | 39 | <table class="table table-striped table-sm" ng-show="generado"> |
37 | <thead> | 40 | <thead> |
38 | <tr> | 41 | <tr> |
39 | <th>Comprobante</th> | 42 | <th>Comprobante</th> |
40 | <th>Vencimiento</th> | 43 | <th>Vencimiento</th> |
41 | <th class="text-right">Importe</th> | 44 | <th class="text-right">Importe</th> |
42 | <th class="text-right">Saldo</th> | 45 | <th class="text-right">Saldo</th> |
43 | <th class="text-right"></th> | 46 | <th class="text-right"></th> |
44 | <th class="text-right"></th> | 47 | <th class="text-right"></th> |
45 | </tr> | 48 | </tr> |
46 | </thead> | 49 | </thead> |
47 | <tbody> | 50 | <tbody> |
48 | <tr class="selectable" | 51 | <tr class="selectable" |
49 | ng-repeat="(key, factura) in currentPageFacturas"> | 52 | ng-repeat="(key, factura) in currentPageFacturas"> |
50 | <td>{{factura.numeroFactura}} {{factura.FECHA_COMPROBANTE | date : 'dd/MM/yyyy' : 'GMT'}}</td> | 53 | <td>{{factura.numeroFactura}} {{factura.FECHA_COMPROBANTE | date : 'dd/MM/yyyy' : 'GMT'}}</td> |
51 | <td>{{(factura.TCO == 'FT') ? factura.NCU + ' - ' : ''}}{{factura.FEV | date : 'dd/MM/yyyy' : 'GMT'}}</td> | 54 | <td>{{(factura.TCO == 'FT') ? factura.NCU + ' - ' : ''}}{{factura.FEV | date : 'dd/MM/yyyy' : 'GMT'}}</td> |
52 | <td class="text-right"> | 55 | <td class="text-right"> |
53 | {{ factura.IPA_SHOW | number:2 }} | 56 | {{ factura.IPA_SHOW | number:2 }} |
54 | <span ng-class="{'invisible': factura.IPA >= 0}">-</span> | 57 | <span ng-class="{'invisible': factura.IPA >= 0}">-</span> |
55 | </td> | 58 | </td> |
56 | <td class="text-right"> | 59 | <td class="text-right"> |
57 | {{ factura.saldo_show | number:2 }} | 60 | {{ factura.saldo_show | number:2 }} |
58 | <span ng-class="{'invisible': factura.saldo >= 0}">-</span> | 61 | <span ng-class="{'invisible': factura.saldo >= 0}">-</span> |
59 | </td> | 62 | </td> |
60 | <td> | 63 | <td> |
61 | <button | 64 | <button |
62 | class="btn p-1" | 65 | class="btn p-1" |
63 | ng-click="verFactura(factura)" | 66 | ng-click="verFactura(factura)" |
64 | title="Ver comprobante" | 67 | title="Ver comprobante" |
65 | > | 68 | > |
66 | <i class="fa fa-eye" aria-hidden="true"></i> | 69 | <i class="fa fa-eye" aria-hidden="true"></i> |
67 | </button> | 70 | </button> |
68 | </td> | 71 | </td> |
69 | <td> | 72 | <td> |
70 | <button | 73 | <button |
71 | class="btn p-1" | 74 | class="btn p-1" |
72 | ng-click="enviarMail(factura)" | 75 | ng-click="enviarMail(factura)" |
73 | title="Enviar comprobante por mail" | 76 | title="Enviar comprobante por mail" |
74 | > | 77 | > |
75 | <i class="fa fa-envelope-o" aria-hidden="true"></i> | 78 | <i class="fa fa-envelope-o" aria-hidden="true"></i> |
76 | </button> | 79 | </button> |
77 | </td> | 80 | </td> |
78 | </tr> | 81 | </tr> |
79 | </tbody> | 82 | </tbody> |
80 | </table> | 83 | </table> |
81 | </div> | 84 | </div> |
82 | <div class="modal-footer py-1"> | 85 | <div class="modal-footer py-1"> |
83 | <nav ng-show="currentPageFacturas.length" class="mr-auto"> | 86 | <nav ng-show="currentPageFacturas.length" class="mr-auto"> |
84 | <ul class="pagination pagination-sm justify-content mb-0"> | 87 | <ul class="pagination pagination-sm justify-content mb-0"> |
85 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | 88 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> |
86 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> | 89 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> |
87 | <span aria-hidden="true">«</span> | 90 | <span aria-hidden="true">«</span> |
88 | <span class="sr-only">Anterior</span> | 91 | <span class="sr-only">Anterior</span> |
89 | </a> | 92 | </a> |
90 | </li> | 93 | </li> |
91 | <li | 94 | <li |
92 | class="page-item" | 95 | class="page-item" |
93 | ng-repeat="pagina in paginas" | 96 | ng-repeat="pagina in paginas" |
94 | ng-class="{'active': pagina == currentPage}" | 97 | ng-class="{'active': pagina == currentPage}" |
95 | > | 98 | > |
96 | <a | 99 | <a |
97 | class="page-link" | 100 | class="page-link" |
98 | href="javascript:void();" | 101 | href="javascript:void();" |
99 | ng-click="selectPage(pagina)" | 102 | ng-click="selectPage(pagina)" |
100 | ng-bind="pagina" | 103 | ng-bind="pagina" |
101 | ></a> | 104 | ></a> |
102 | </li> | 105 | </li> |
103 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | 106 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> |
104 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)"> | 107 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)"> |
105 | <span aria-hidden="true">»</span> | 108 | <span aria-hidden="true">»</span> |
106 | <span class="sr-only">Siguiente</span> | 109 | <span class="sr-only">Siguiente</span> |
107 | </a> | 110 | </a> |
108 | </li> | 111 | </li> |
109 | </ul> | 112 | </ul> |
110 | </nav> | 113 | </nav> |
111 | <button class="btn btn-sm btn-secondary my-1" type="button" ng-click="generar()" ng-hide="generado">Generar</button> | 114 | <button class="btn btn-sm btn-primary my-1" type="button" ng-click="generar()" ng-hide="generado">Generar</button> |
112 | <button class="btn btn-sm btn-primary my-1" type="button" ng-click="enviarResumen()" ng-show="generado">Enviar</button> | 115 | <button class="btn btn-sm btn-primary my-1" type="button" ng-click="enviarResumen()" ng-show="generado">Enviar</button> |
113 | <button class="btn btn-sm btn-secondary my-1" type="button" ng-click="cancel()">Cancelar</button> | 116 | <button class="btn btn-sm btn-secondary my-1" type="button" ng-click="cancel()">Cancelar</button> |
114 | </div> | 117 | </div> |
115 | 118 |