Commit 322b0c9d115d7e58f0c12f073fb726c5514d8051

Authored by Jose Pinto
1 parent 0e58f4f08f
Exists in master

ok default value

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
1 angular.module('focaFiltros', []) 1 angular.module('focaFiltros', [])
2 .filter('comprobante', function() { 2 .filter('comprobante', function() {
3 return function(valores) { 3 return function(valores) {
4 return (Array(4).join('0') + valores[0]).slice(-4) + '-' + 4 return (Array(4).join('0') + valores[0]).slice(-4) + '-' +
5 (Array(8).join('0') + valores[1]).slice(-8); 5 (Array(8).join('0') + valores[1]).slice(-8);
6 }; 6 };
7 }) 7 })
8 .filter('rellenarDigitos', function() { 8 .filter('rellenarDigitos', function() {
9 return function(valor, cantidad, caracter) { 9 return function(valor, cantidad, caracter = 0) {
10 var ceros = ''; 10 var ceros = '';
11 for (var i = 0; i < cantidad; i++) { 11 for (var i = 0; i < cantidad; i++) {
12 ceros += caracter; 12 ceros += caracter;
13 } 13 }
14 return (ceros + valor).slice(cantidad * -1); 14 return (ceros + valor).slice(cantidad * -1);
15 }; 15 };
16 }); 16 });
17 17