Commit 2a7d3bc419b8544d462a153ffe733a2badd8f51c
Exists in
master
and in
1 other branch
Merge branch 'master' into 'develop'
Master(mpuebla) See merge request !8
Showing
3 changed files
Show diff stats
package.json
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | "description": "Modal para resumen de cuenta en cobranzas", |
| 5 | 5 | "main": "index.js", |
| 6 | 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 | 8 | "test": "echo \"Error: no test specified\" && exit 1", |
| 8 | 9 | "gulp-pre-commit": "gulp pre-commit", |
| 9 | 10 | "compile": "gulp uglify", |
src/js/controller.js
| ... | ... | @@ -8,7 +8,7 @@ angular.module('focaModalResumenCuenta') |
| 8 | 8 | 'cliente', |
| 9 | 9 | '$uibModal', |
| 10 | 10 | 'focaModalService', |
| 11 | - function($timeout, $filter, $scope, $uibModalInstance, | |
| 11 | + function ($timeout, $filter, $scope, $uibModalInstance, | |
| 12 | 12 | focaModalResumenCuentaService, cliente, $uibModal, focaModalService) { |
| 13 | 13 | var fecha = new Date(); |
| 14 | 14 | $scope.generado = false; |
| ... | ... | @@ -18,11 +18,14 @@ angular.module('focaModalResumenCuenta') |
| 18 | 18 | $scope.numPerPage = 10; |
| 19 | 19 | $scope.selectedFactura = -1; |
| 20 | 20 | |
| 21 | - $scope.generar = function() { | |
| 21 | + $scope.generar = function () { | |
| 22 | 22 | focaModalResumenCuentaService |
| 23 | 23 | .getResumenCuenta(cliente.COD, $scope.fechaDesde) |
| 24 | - .then(function(res) { | |
| 25 | - res.data.facturas = calcularSaldos(res.data.facturas); | |
| 24 | + .then(function (res) { | |
| 25 | + res.data.facturas = res.data.facturas.filter(function(factura){ | |
| 26 | + return factura.TCO !== "RC" && factura.TCO !== "RE" | |
| 27 | + }) | |
| 28 | + res.data.facturas = calcularSaldos(res.data.facturas); | |
| 26 | 29 | $scope.generado = true; |
| 27 | 30 | $scope.results = res.data; |
| 28 | 31 | $scope.results.fechaDesde = $scope.fechaDesde; |
| ... | ... | @@ -30,7 +33,7 @@ angular.module('focaModalResumenCuenta') |
| 30 | 33 | }); |
| 31 | 34 | }; |
| 32 | 35 | |
| 33 | - $scope.cancel = function() { | |
| 36 | + $scope.cancel = function () { | |
| 34 | 37 | if ($scope.generado) { |
| 35 | 38 | $scope.generado = false; |
| 36 | 39 | } else { |
| ... | ... | @@ -38,7 +41,7 @@ angular.module('focaModalResumenCuenta') |
| 38 | 41 | } |
| 39 | 42 | }; |
| 40 | 43 | |
| 41 | - $scope.enviarMail = function(factura) { | |
| 44 | + $scope.enviarMail = function (factura) { | |
| 42 | 45 | focaModalService.mail( |
| 43 | 46 | { |
| 44 | 47 | titulo: 'Enviar comprobante', |
| ... | ... | @@ -57,7 +60,7 @@ angular.module('focaModalResumenCuenta') |
| 57 | 60 | ); |
| 58 | 61 | }; |
| 59 | 62 | |
| 60 | - $scope.enviarResumen = function() { | |
| 63 | + $scope.enviarResumen = function () { | |
| 61 | 64 | focaModalService.mail( |
| 62 | 65 | { |
| 63 | 66 | titulo: 'Enviar resumen de cuenta', |
| ... | ... | @@ -76,8 +79,8 @@ angular.module('focaModalResumenCuenta') |
| 76 | 79 | ); |
| 77 | 80 | }; |
| 78 | 81 | |
| 79 | - $scope.verFactura = function(factura) { | |
| 80 | - var modalInstance = $uibModal.open( | |
| 82 | + $scope.verFactura = function (factura) { | |
| 83 | + var modalInstance = $uibModal.open( | |
| 81 | 84 | { |
| 82 | 85 | ariaLabelledBy: 'Detalle de factura', |
| 83 | 86 | templateUrl: 'foca-modal-factura-detalle.html', |
| ... | ... | @@ -92,7 +95,7 @@ angular.module('focaModalResumenCuenta') |
| 92 | 95 | }; |
| 93 | 96 | |
| 94 | 97 | |
| 95 | - $scope.search = function() { | |
| 98 | + $scope.search = function () { | |
| 96 | 99 | if ($scope.results.facturas.length) { |
| 97 | 100 | $scope.lastPage = Math.ceil( |
| 98 | 101 | $scope.results.facturas.length / $scope.numPerPage |
| ... | ... | @@ -101,12 +104,12 @@ angular.module('focaModalResumenCuenta') |
| 101 | 104 | } |
| 102 | 105 | }; |
| 103 | 106 | |
| 104 | - $scope.resetPage = function() { | |
| 107 | + $scope.resetPage = function () { | |
| 105 | 108 | $scope.currentPage = 1; |
| 106 | 109 | $scope.selectPage(1); |
| 107 | 110 | }; |
| 108 | 111 | |
| 109 | - $scope.selectPage = function(page) { | |
| 112 | + $scope.selectPage = function (page) { | |
| 110 | 113 | var start = (page - 1) * $scope.numPerPage; |
| 111 | 114 | var end = start + $scope.numPerPage; |
| 112 | 115 | $scope.paginas = []; |
| ... | ... | @@ -120,7 +123,7 @@ angular.module('focaModalResumenCuenta') |
| 120 | 123 | paginas.push(paginaActual); |
| 121 | 124 | |
| 122 | 125 | if (paginaActual - 1 > 1) { |
| 123 | - | |
| 126 | + | |
| 124 | 127 | paginas.unshift(paginaActual - 1); |
| 125 | 128 | if (paginaActual - 2 > 1) { |
| 126 | 129 | paginas.unshift(paginaActual - 2); |
| ... | ... | @@ -148,10 +151,10 @@ angular.module('focaModalResumenCuenta') |
| 148 | 151 | function calcularSaldos(facturas) { |
| 149 | 152 | var saldo = 0; |
| 150 | 153 | |
| 151 | - facturas.forEach(function(factura) { | |
| 154 | + facturas.forEach(function (factura) { | |
| 152 | 155 | if (factura.TCO === 'CI' || |
| 153 | 156 | factura.TCO === 'FT' || |
| 154 | - factura.TCO === 'ND'){ | |
| 157 | + factura.TCO === 'ND') { | |
| 155 | 158 | factura.IPA = factura.IPA * -1; |
| 156 | 159 | } else { |
| 157 | 160 | factura.IPA = factura.IPA; |
src/views/modal-resumen-cuenta.html
| ... | ... | @@ -12,11 +12,14 @@ |
| 12 | 12 | <div class="input-group row" |
| 13 | 13 | ng-hide="generado"> |
| 14 | 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 | 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 | 21 | <i class="fa fa-calendar"></i> |
| 19 | - </div> | |
| 22 | + </button> | |
| 20 | 23 | </div> |
| 21 | 24 | <input |
| 22 | 25 | class="form-control form-control-sm" |
| ... | ... | @@ -108,7 +111,7 @@ |
| 108 | 111 | </li> |
| 109 | 112 | </ul> |
| 110 | 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 | 115 | <button class="btn btn-sm btn-primary my-1" type="button" ng-click="enviarResumen()" ng-show="generado">Enviar</button> |
| 113 | 116 | <button class="btn btn-sm btn-secondary my-1" type="button" ng-click="cancel()">Cancelar</button> |
| 114 | 117 | </div> |