Commit 57bcda2eec467a4134a905768aee3f91643b50d2

Authored by Marcelo Puebla
1 parent c0ab8ab3d8
Exists in master and in 1 other branch develop

Codigo identado.

Showing 1 changed file with 14 additions and 14 deletions   Show diff stats
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,10 +18,10 @@ 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) {
  24 + .then(function (res) {
25 25 res.data.facturas = calcularSaldos(res.data.facturas);
26 26 $scope.generado = true;
27 27 $scope.results = res.data;
... ... @@ -30,7 +30,7 @@ angular.module('focaModalResumenCuenta')
30 30 });
31 31 };
32 32  
33   - $scope.cancel = function() {
  33 + $scope.cancel = function () {
34 34 if ($scope.generado) {
35 35 $scope.generado = false;
36 36 } else {
... ... @@ -38,7 +38,7 @@ angular.module('focaModalResumenCuenta')
38 38 }
39 39 };
40 40  
41   - $scope.enviarMail = function(factura) {
  41 + $scope.enviarMail = function (factura) {
42 42 focaModalService.mail(
43 43 {
44 44 titulo: 'Enviar comprobante',
... ... @@ -57,7 +57,7 @@ angular.module('focaModalResumenCuenta')
57 57 );
58 58 };
59 59  
60   - $scope.enviarResumen = function() {
  60 + $scope.enviarResumen = function () {
61 61 focaModalService.mail(
62 62 {
63 63 titulo: 'Enviar resumen de cuenta',
... ... @@ -76,8 +76,8 @@ angular.module('focaModalResumenCuenta')
76 76 );
77 77 };
78 78  
79   - $scope.verFactura = function(factura) {
80   - var modalInstance = $uibModal.open(
  79 + $scope.verFactura = function (factura) {
  80 + var modalInstance = $uibModal.open(
81 81 {
82 82 ariaLabelledBy: 'Detalle de factura',
83 83 templateUrl: 'foca-modal-factura-detalle.html',
... ... @@ -92,7 +92,7 @@ angular.module('focaModalResumenCuenta')
92 92 };
93 93  
94 94  
95   - $scope.search = function() {
  95 + $scope.search = function () {
96 96 if ($scope.results.facturas.length) {
97 97 $scope.lastPage = Math.ceil(
98 98 $scope.results.facturas.length / $scope.numPerPage
... ... @@ -101,12 +101,12 @@ angular.module('focaModalResumenCuenta')
101 101 }
102 102 };
103 103  
104   - $scope.resetPage = function() {
  104 + $scope.resetPage = function () {
105 105 $scope.currentPage = 1;
106 106 $scope.selectPage(1);
107 107 };
108 108  
109   - $scope.selectPage = function(page) {
  109 + $scope.selectPage = function (page) {
110 110 var start = (page - 1) * $scope.numPerPage;
111 111 var end = start + $scope.numPerPage;
112 112 $scope.paginas = [];
... ... @@ -120,7 +120,7 @@ angular.module('focaModalResumenCuenta')
120 120 paginas.push(paginaActual);
121 121  
122 122 if (paginaActual - 1 > 1) {
123   -
  123 +
124 124 paginas.unshift(paginaActual - 1);
125 125 if (paginaActual - 2 > 1) {
126 126 paginas.unshift(paginaActual - 2);
... ... @@ -148,10 +148,10 @@ angular.module('focaModalResumenCuenta')
148 148 function calcularSaldos(facturas) {
149 149 var saldo = 0;
150 150  
151   - facturas.forEach(function(factura) {
  151 + facturas.forEach(function (factura) {
152 152 if (factura.TCO === 'CI' ||
153 153 factura.TCO === 'FT' ||
154   - factura.TCO === 'ND'){
  154 + factura.TCO === 'ND') {
155 155 factura.IPA = factura.IPA * -1;
156 156 } else {
157 157 factura.IPA = factura.IPA;