Commit fc631e030480e28c4589e6df42ef3d8c692910e6
1 parent
23b957dc01
Exists in
master
and in
1 other branch
agrego importe a los resultados
Showing
2 changed files
with
10 additions
and
0 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -127,6 +127,14 @@ angular.module('focaModalCobranza') |
127 | 127 | } |
128 | 128 | }; |
129 | 129 | |
130 | + $scope.getTotalCobrado = function(cobros) { | |
131 | + var total = 0; | |
132 | + for (var i = 0; i < cobros.length; i++) { | |
133 | + total += cobros[i].importe; | |
134 | + } | |
135 | + return parseFloat(total.toFixed(2)); | |
136 | + }; | |
137 | + | |
130 | 138 | function calcularPages(paginaActual) { |
131 | 139 | var paginas = []; |
132 | 140 | paginas.push(paginaActual); |
src/views/foca-modal-cobranza.html
... | ... | @@ -86,6 +86,7 @@ |
86 | 86 | <th>Fecha</th> |
87 | 87 | <th>Cliente</th> |
88 | 88 | <th>Comprobante</th> |
89 | + <th>Importe</th> | |
89 | 90 | <th></th> |
90 | 91 | </tr> |
91 | 92 | </thead> |
... | ... | @@ -101,6 +102,7 @@ |
101 | 102 | <td ng-bind="cobranza.fecha | date : 'dd/MM/yyyy'"></td> |
102 | 103 | <td ng-bind="cobranza.cliente.NOM"></td> |
103 | 104 | <td ng-bind="[cobranza.puntoVenta, cobranza.numeroRecibo] | comprobante"></td> |
105 | + <td ng-bind="getTotalCobrado(cobranza.cobros) | number: 2"></td> | |
104 | 106 | <td> |
105 | 107 | <button |
106 | 108 | type="button" |