import React from 'react';
import { Route } from 'react-router-dom';
import LocalStorage from '../Util/localStorage/index.jsx'
import Numeral from 'numeral';
import moment from 'moment';
import Config from '../Util/constantes.js'

export function RouteWithSubRoutes(route) {
    return (
        <Route
            path={route.path}
            render={props => (
                // pass the sub-routes down to keep nesting
                <route.component {...props} routes={route.routes} debeValidarOpcion={route.debeValidarOpcion} spinnerModalMostrar={route.spinnerModalMostrar} />
            )}
        //render={(props) => <route.component {...props} routes={route.routes} />}
        />
    );
}
export function removejscssfile(filename, filetype) {
    var targetelement = (filetype == "js") ? "script" : (filetype == "css") ? "link" : (filetype == "type") ? "script" : "none" //determine element type to create nodelist from
    var targetattr = (filetype == "js") ? "src" : (filetype == "css") ? "href" : (filetype == "type") ? "type" : "none" //determine corresponding attribute to test for
    var allsuspects = document.getElementsByTagName(targetelement)
    for (var i = allsuspects.length; i >= 0; i--) { //search backwards within nodelist for matching elements to remove
        if (allsuspects[i] && allsuspects[i].getAttribute(targetattr) != null && allsuspects[i].getAttribute(targetattr).indexOf(filename) != -1)
            allsuspects[i].parentNode.removeChild(allsuspects[i]) //remove element by calling parentNode.removeChild()    
    }
}

export function removejscssfileType(filename, filetype) {
    var targetelement = (filetype == "js") ? "script" : (filetype == "css") ? "link" : (filetype == "type") ? "script" : "none" //determine element type to create nodelist from
    var targetattr = (filetype == "js") ? "src" : (filetype == "css") ? "href" : (filetype == "type") ? "type" : "none" //determine corresponding attribute to test for
    var allsuspects = document.getElementsByTagName(targetelement)
    let _linea = "";
    for (var i = allsuspects.length; i >= 0; i--) { //search backwards within nodelist for matching elements to remove
        _linea = "";
        if (allsuspects[i]) {
            _linea = allsuspects[i].outerHTML;
        }
        if (allsuspects[i] && allsuspects[i].getAttribute(targetattr) != null && _linea.indexOf(filename) != -1) {
            allsuspects[i].parentNode.removeChild(allsuspects[i]) //remove element by calling parentNode.removeChild()
        }
    }
}

export function muestraArbolEmpleados(pMostrar) {
    document.body.style.background = '';
    let arbol = document.getElementById("arbolESADO");
    if (pMostrar) {
        // document.getElementById("contenedorPant").className = "wrapper";
        // arbol.setAttribute('style','');
        // arbol.style.display= 'unset'
        document.getElementById("body1").className = "";
    } else {
        // document.getElementById("contenedorPant").className = "wrapper1";
        // arbol.setAttribute('style','');
        // arbol.style.display= 'none'
        document.getElementById("body1").className = "sidebar-collapse";
    }
}

export function itemSelect(pid, plista) {

    let _item = { value: 0, label: '' };
    let _array = plista.filter(item => item.value == pid);
    if (_array.length > 0) {
        _item = { value: _array[0].value, label: _array[0].label };
    }


    return _item;

}

export function datosArbol(pLista) {
    try {


        let _pLista = pLista;
        let _Lista = _pLista;
        let _ListaPadre = _Lista.filter(item => item.padre === -1);
        let subLista = [];

        // _Datos.push({"title": item.Cuenta ,"subtitle": item.Nombre, "padre" : item.Padres, "value" : item.ID});
        // siempre va tener el home
        //subLista.push({ padre: { etiqueta: 'DashBoard', icono: "glyphicon glyphicon-dashboard", href: 'hola' }, hijos: [] });

        for (let j = 0, len = _ListaPadre.length; j < len; j++) {
            let _ListaHijo = _Lista.filter(item => item.padre === _ListaPadre[j].value);
            //arma el lista principal
            let _hijo = [];
            //arma los listas hijos
            if (_ListaHijo.length > 0) {


                _hijo = cargaSubLista(_ListaHijo, _Lista);
            }
            subLista.push({ title: _ListaPadre[j].title, subtitle: _ListaPadre[j].subtitle, value: _ListaPadre[j].value, children: _hijo });
        }
        return subLista;
    }
    catch (err) {

    }
}

function cargaSubLista(lstSubLista, lstLista) {
    try {
        let _subLista = [];
        let _hijo = [];

        for (let j = 0, len = lstSubLista.length; j < len; j++) {

            let _ListaHijo = lstLista.filter(item => item.padre === lstSubLista[j].value);
            //arma el subLista, tambien podria ser padre
            //_hijo.push({ etiqueta: lstSubLista[j].Nombre, href: 'BASE ' + lstSubLista[j].Url });

            //Tambien podria ser una sublista y a la vez padre
            if (_ListaHijo.length > 0) {
                _subLista = cargaSubLista(_ListaHijo, lstLista);

                _hijo.push({ title: lstSubLista[j].title, subtitle: lstSubLista[j].subtitle, value: lstSubLista[j].value, children: _subLista });
            }
            else {

                _hijo.push({ title: lstSubLista[j].title, subtitle: lstSubLista[j].subtitle, value: lstSubLista[j].value });
            }

        }

        return _hijo;
    }
    catch (err) {

    }
}


export function datosArbolCheck(pLista, pSoloPadres) {
    try {


        let _pLista = pLista;
        let _Lista = _pLista;
        let _ListaPadre = _Lista.filter(item => item.padre === -1);
        let subLista = [];

        // _Datos.push({"title": item.Cuenta ,"subtitle": item.Nombre, "padre" : item.Padres, "value" : item.ID});
        // siempre va tener el home
        //subLista.push({ padre: { etiqueta: 'DashBoard', icono: "glyphicon glyphicon-dashboard", href: 'hola' }, hijos: [] });

        for (let j = 0, len = _ListaPadre.length; j < len; j++) {
            let _ListaHijo = _Lista.filter(item => item.padre === _ListaPadre[j].value);
            //arma el lista principal
            let _hijo = [];
            //arma los listas hijos
            if (_ListaHijo.length > 0) {


                _hijo = cargaSubListaCheck(_ListaHijo, _Lista,pSoloPadres);
            }
            subLista.push({ label: _ListaPadre[j].title, value: _ListaPadre[j].value , disabled: (_ListaPadre[j].disabled != undefined) ? _ListaPadre[j].disabled : false , children: _hijo });
        }
        return subLista;
    }
    catch (err) {

    }
}

function cargaSubListaCheck(lstSubLista, lstLista, pSoloPadres) {
    try {
        let _subLista = [];
        let _hijo = [];

        for (let j = 0, len = lstSubLista.length; j < len; j++) {

            let _ListaHijo = lstLista.filter(item => item.padre === lstSubLista[j].value);
            //arma el subLista, tambien podria ser padre
            //_hijo.push({ etiqueta: lstSubLista[j].Nombre, href: 'BASE ' + lstSubLista[j].Url });

            //Tambien podria ser una sublista y a la vez padre
            if (_ListaHijo.length > 0) {
                _subLista = cargaSubListaCheck(_ListaHijo, lstLista, pSoloPadres);

                _hijo.push({ label: lstSubLista[j].title, value: lstSubLista[j].value, children: _subLista });
            }
            else {
                if(!pSoloPadres){
                    _hijo.push({ label: lstSubLista[j].title,  value: lstSubLista[j].value });
                }
            }

        }

        return _hijo;
    }
    catch (err) {

    }
}

export function multiFilter(array, filters) {

    const filterKeys = Object.keys(filters);
    // filters all elements passing the criteria
    return array.filter((item) => {
        // dynamically validate all filter criteria
        return filterKeys.every(key => !!~filters[key].indexOf(item[key]));
    });

}

export function sumarDias(fecha, dias) {
    fecha.setDate(fecha.getDate() + dias);
    return fecha;
}
export function diferenciaDias(pFecha1, pFecha2) {
    let dif = 0;
    const unDia = (1000 * 60 * 60 * 24);
    let date1_ms = new Date(pFecha1);
    let date2_ms = new Date(pFecha2);
    dif = Math.abs(date1_ms - date2_ms);
    dif = dif / unDia;
    return dif;
}

export function validarPorcentaje(pValor) {
    let isValid = true;
    if (pValor.toString().length > 0) {
        let strporc = pValor;
        isValid = strporc.match(/^((100(\.0{1,2})?)|(\d{1,2}(\.\d{0,2})?))$/) == null ? false : true;
    }
    return isValid;
}

export function validarInt(pValor) {
    let isValid = true;
    if (pValor.toString().length > 0) {
        let strporc = pValor;
        isValid = strporc.match(/^((999999(\.0{1,2})?)|(\d{1,6}?))$/) == null ? false : true;
    }
    return isValid;
}
export function validarIntVig(pValor) {
    let isValid = true;
    if (pValor.toString().length > 0) {
        let strporc = pValor;
        isValid = strporc.match(/^((9999(\.0{1,2})?)|(\d{1,4}?))$/) == null ? false : true;
    }
    return isValid;
}

export function validarAnosTope(pValor) {
    let isValid = true;
    if (pValor.toString().length > 0) {
        let strporc = pValor;
        isValid = strporc.match(/^((999(\.0{1,2})?)|(\d{1,3}?))$/) == null ? false : true;
    }
    return isValid;
}

export function validarNumeros(pValor) {
    let isValid = true;
    if (pValor.toString().length > 0) {
        let strporc = pValor;
        isValid = strporc.match(/^[0-9]+$/) == null ? false : true;
    }
    return isValid;
}


export function validarDecimal(pValor) {
    let isValid = true;
    if (pValor.toString().length > 0) {
        let strporc = pValor;
        isValid = strporc.match(/^((999999999(\.0{1,2})?)|(\d{1,9}(\.\d{0,4})?))$/) == null ? false : true;
    }
    return isValid;
}

export function validaCuenta(plista, pcuenta) {
    let cuenta = new RegExp(pcuenta + '-.*');

    const listCuentasCont = plista.filter(item => item.Cuenta == pcuenta);
    if (listCuentasCont.length == 0) {
        return 'La cuenta no existe'
    }
    else {
        const listaCuenta = plista.filter(item => item.Cuenta.match(cuenta));
        if (listaCuenta.length > 0) {
            return 'La cuenta es de mayor'
        }
    }
    return '';
}

export function validaCCosto(plista, pcuenta, pCCosto, pListaCXCC) {
    let cCosto = new RegExp(pCCosto + '-.*');
    let idCC = -1;
    const listCentroCosto = plista.filter(item => item.CentroCosto == pCCosto);
    if (listCentroCosto.length == 0) {
        return 'El centro de costo no existe'
    }
    else {
        const listaCCosto = plista.filter(item => item.CentroCosto.match(cCosto));
        if (listaCCosto.length > 0) {
            return 'El centro de costo es de mayor'
        }
    }
    idCC = listCentroCosto[0].ID;
    //const listaCCCosto = pListaCXCC.filter(item => item.centro_costo == pCCosto);    
    let filtro = { ID: [pcuenta], CentroCosto: [idCC] };
    const listaCCCosto = multiFilter(pListaCXCC, filtro)


    if (listaCCCosto.length == 0) {
        return 'No existe relacion entre la cuenta y el centro de costo'
    }

    return '';
}

export function validaDiaMes(pDia, pMes) {

    let dias_mes = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]



    //Comprobar si el año es bisiesto, si se necesita validar con año
    // if(((pAno % 4 == 0) && (pAno % 100 != 0)) || (pAno % 400 == 0)){
    //     dias_mes[1] = dias_mes[1] + 1 ;
    // }


    //Comprobar que el mes sea válido
    if ((pMes < 1) || (pMes > 12)) { return False; }

    //Comprobar que el dia sea válido
    let m = pMes - 1
    if ((pDia < 0) || (pDia > dias_mes[m])) {
        return false;
    }

    //Si ha pasado todas estas condiciones, la fecha es válida
    return true;

}

export function validaCorreo(pValor) {
    let isValid = true;
    if (pValor.toString().length > 0) {
        let strporc = pValor;
        isValid = strporc.match(/^([A-Z|a-z|0-9](\.|_){0,1})+[A-Z|a-z|0-9]\@([A-Z|a-z|0-9])+((\.){0,1}[A-Z|a-z|0-9]){2}\.[a-z]{2,3}$/) == null ? false : true;
    }
    return isValid;

}

export function validaServidor(pValor) {

    let isValid = true;
    if (pValor.toString().length > 0) {
        let strporc = pValor;
        isValid = strporc.match(/^((?:([a-z0-9]\.|\*|[a-z0-9][a-z0-9\-]{0,61}[a-z0-9])\.)+)([a-z0-9]{2,63}|(?:[a-z0-9][a-z0-9\-]{0,61}[a-z0-9]))\.?$/) == null ? false : true;
    }
    return isValid;
}


export function validaTelefono(pValor) {
    let isValid = true;
    if (pValor.toString().length > 0) {
        let strporc = pValor;
        isValid = strporc.match(/^(([4]{1})|([2]{1})|([6-8]{1}))([0-9]{3})[\-]?([0-9]{4})$/) == null ? false : true;
    }
    return isValid;

}

export function validaCarnet(pValor) {
    let isValid = true;
    if (pValor.toString().length > 0) {
        let strporc = pValor;
        isValid = strporc.match(/[^{0-9}{a-z}{A-Z}\-]$/) == null ? false : true;
    }
    return isValid;
}

export function cantDecimalesMon() {
    const localStorage = new LocalStorage();
    let _Formatos = localStorage.get('FormatoCON');
    let pResultado = 0;
    try {
        if (_Formatos != null) {
            pResultado = _Formatos.Decimales.CantDecimalesMon;
        } else {
            pResultado = 0;
        }
        return pResultado;
    }
    catch (err) {

        return 0;
    }
}

export function cantDecimalesCant() {
    const localStorage = new LocalStorage();
    let _Formatos = localStorage.get('FormatoCON');
    let pResultado = 0;
    try {
        if (_Formatos != null) {
            pResultado = _Formatos.Decimales.CantDecimalesCant;
        } else {
            pResultado = 0;
        }
        return pResultado;
    }
    catch (err) {

        return 0;
    }
}
export function cantDecimalesPorc() {
    const localStorage = new LocalStorage();
    let _Formatos = localStorage.get('FormatoCON');
    let pResultado = 0;
    try {
        if (_Formatos != null) {
            pResultado = _Formatos.Decimales.CantDecimalesPorc;
        } else {
            pResultado = 0;
        }
        return pResultado;
    }
    catch (err) {

        return 0;
    }
}


export function formatoPrueba() {
    let pResultado = '0.0';
    const localStorage = new LocalStorage();
    let _Formatos = localStorage.get('FormatoCON');

    if (_Formatos != null) {
        pResultado = _Formatos.Formato.FormatoMon;
    }
    return pResultado;
}

export function formatoMon() {
    let pResultado = '0.0';
    const localStorage = new LocalStorage();
    let _Formatos = localStorage.get('FormatoCON');
    try {
        if (_Formatos != null) {
            pResultado = _Formatos.Formato.FormatoMon;
        } else {
            pResultado = '0.0';
        }
        return pResultado;
    }
    catch (err) {
        console.log(err);
        return '0.0';
    }
}



export function formatoCant() {
    const localStorage = new LocalStorage();
    let _Formatos = localStorage.get('FormatoCON');
    let pResultado = '0.0';
    try {
        if (_Formatos != null) {
            pResultado = _Formatos.Formato.FormatoCant;
        } else {
            pResultado = '0.0';
        }
        return pResultado;
    }
    catch (err) {

        return '0.0';
    }
}

export function formatoPorc() {
    const localStorage = new LocalStorage();
    let _Formatos = localStorage.get('FormatoCON');
    let pResultado = '0.0';
    try {
        if (_Formatos != null) {
            pResultado = _Formatos.Formato.FormatoPorc;
        } else {
            pResultado = '0.0';
        }
        return pResultado;
    }
    catch (err) {

        return '0.0';
    }
}

export function farmatearMontos(valor) {
    let _formato = formatoMon();
    return Numeral(valor).format(_formato);
}

export function farmatearCantidad(valor) {
    let _formato = formatoCant();
    return Numeral(valor).format(_formato);
}

export function farmatearPorcentaje(valor) {
    let _formato = formatoPorc();
    return Numeral(valor).format(_formato);
}

export function farmatearFechaEstandar(valor) {
    let _formato = Config.formatoFechaStandard;
    let _fecha = (valor == undefined) ? moment().format(_formato) : moment(valor).format(_formato);
    return _fecha;
}

export function farmatearFechaEstandarHora(valor) {
    let _formato = Config.formatoFechaStandardHora;
    let _fecha = (valor == undefined) ? moment().format(_formato) : moment(valor).format(_formato);
    return _fecha;
}

export function formatearHoras(valor) {
    let _formato = Config.formatoHoras;
    let _horas = (valor == undefined) ? 0 : moment(valor).format(_formato);
    return _horas;
}
export function formateaNumero(valor) {
    const formatter = new Intl.NumberFormat("sv-SE", {
        style: "decimal",
        currency: "SEK"
    });
    return formatter.format(valor);
}

export function formatearMesNombreAnno(pFecha){
    const _Fecha = new Date(pFecha)
    const _Meses = Config.listaMeses;
    const _MesNomb = _Meses.filter(item => item.value == _Fecha.getMonth() + 1);
    return `${_MesNomb[0].label}, ${_Fecha.getFullYear()}`;
}
export function Alinear(pRellanaderecha, pValor, pValorDefault, pTamano) {
    let i = 0;
    let Result = pValor;
    if (pValor.length > pTamano) {
        Result = Result.substring(0, pTamano);
        return Result;
    }
    for (i = pValor.length; i < pTamano; i++) {
        if (pRellanaderecha) {
            Result = Result + pValorDefault
        } else {
            Result = pValorDefault + Result
        }
    }
    return Result;
}
export function Round(value, decimals) {
    if (isNaN(decimals)) { decimals = 0 }
    return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals);
}
export function CambiaCaracteres(str) {
    var from = "ÃÀÁÄÂÈÉËÊÌÍÏÎÒÓÖÔÙÚÜÛãàáäâèéëêìíïîòóöôùúüûÑñÇç",
        to = "AAAAAEEEEIIIIOOOOUUUUaaaaaeeeeiiiioooouuuunncc",
        mapping = {};

    for (var i = 0, j = from.length; i < j; i++)
        mapping[from.charAt(i)] = to.charAt(i);


    var ret = [];

    for (var i = 0, j = str.length; i < j; i++) {
        var c = str.charAt(i);
        if (mapping.hasOwnProperty(str.charAt(i)))
            ret.push(mapping[c]);
        else
            ret.push(c);
    }

    return ret.join('');
}

export function sumLista(items, prop) {
    return items.reduce(function (a, b) {
        return a + b[prop];
    }, 0);
};

export function fechaPrimerDia(pFecha) {
    let fecha = pFecha;
    let primerDia = new Date(fecha.getFullYear(), fecha.getMonth(), 1);
    return primerDia;
}

export function fechaUltimoDia(pFecha) {
    let fecha = pFecha;
    let ultimoDia = new Date(fecha.getFullYear(), fecha.getMonth() + 1, 0)
    return ultimoDia;
}

export function addMonths(pDate, months) {
    let date = new Date(pDate);
    var d = date.getDate();
    date.setMonth(date.getMonth() + +months);
    if (date.getDate() != d) {
        date.setDate(0);
    }
    return date;
}

export function addDays(date, days) {
    date.setDate(date.getDate() + days);  
    return date
}


export function formatearNumero(x) {
    return x.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ",");
}

function Unidades(num){

    switch(num)
    {
        case 1: return 'UN';
        case 2: return 'DOS';
        case 3: return 'TRES';
        case 4: return 'CUATRO';
        case 5: return 'CINCO';
        case 6: return 'SEIS';
        case 7: return 'SIETE';
        case 8: return 'OCHO';
        case 9: return 'NUEVE';
    }

    return '';
}//Unidades()

function Decenas(num){

    let decena = Math.floor(num/10);
    let unidad = num - (decena * 10);

    switch(decena)
    {
        case 1:
            switch(unidad)
            {
                case 0: return 'DIEZ';
                case 1: return 'ONCE';
                case 2: return 'DOCE';
                case 3: return 'TRECE';
                case 4: return 'CATORCE';
                case 5: return 'QUINCE';
                default: return 'DIECI' + Unidades(unidad);
            }
        case 2:
            switch(unidad)
            {
                case 0: return 'VEINTE';
                default: return 'VEINTI' + Unidades(unidad);
            }
        case 3: return DecenasY('TREINTA', unidad);
        case 4: return DecenasY('CUARENTA', unidad);
        case 5: return DecenasY('CINCUENTA', unidad);
        case 6: return DecenasY('SESENTA', unidad);
        case 7: return DecenasY('SETENTA', unidad);
        case 8: return DecenasY('OCHENTA', unidad);
        case 9: return DecenasY('NOVENTA', unidad);
        case 0: return Unidades(unidad);
    }
}//Unidades()

function DecenasY(strSin, numUnidades) {
    if (numUnidades > 0)
        return strSin + ' Y ' + Unidades(numUnidades)

    return strSin;
}//DecenasY()

function Centenas(num) {
    let centenas = Math.floor(num / 100);
    let decenas = num - (centenas * 100);

    switch(centenas)
    {
        case 1:
            if (decenas > 0)
                return 'CIENTO ' + Decenas(decenas);
            return 'CIEN';
        case 2: return 'DOSCIENTOS ' + Decenas(decenas);
        case 3: return 'TRESCIENTOS ' + Decenas(decenas);
        case 4: return 'CUATROCIENTOS ' + Decenas(decenas);
        case 5: return 'QUINIENTOS ' + Decenas(decenas);
        case 6: return 'SEISCIENTOS ' + Decenas(decenas);
        case 7: return 'SETECIENTOS ' + Decenas(decenas);
        case 8: return 'OCHOCIENTOS ' + Decenas(decenas);
        case 9: return 'NOVECIENTOS ' + Decenas(decenas);
    }

    return Decenas(decenas);
}//Centenas()

function Seccion(num, divisor, strSingular, strPlural) {
    let cientos = Math.floor(num / divisor)
    let resto = num - (cientos * divisor)

    let letras = '';

    if (cientos > 0)
        if (cientos > 1)
            letras = Centenas(cientos) + ' ' + strPlural;
        else
            letras = strSingular;

    if (resto > 0)
        letras += '';

    return letras;
}//Seccion()

function Miles(num) {
    let divisor = 1000;
    let cientos = Math.floor(num / divisor)
    let resto = num - (cientos * divisor)

    let strMiles = Seccion(num, divisor, 'UN MIL', 'MIL');
    let strCentenas = Centenas(resto);

    if(strMiles == '')
        return strCentenas;

    return strMiles + ' ' + strCentenas;
}//Miles()

function Millones(num) {
    let divisor = 1000000;
    let cientos = Math.floor(num / divisor)
    let resto = num - (cientos * divisor)

    let strMillones = Seccion(num, divisor, 'UN MILLON DE', 'MILLONES DE');
    let strMiles = Miles(resto);

    if(strMillones == '')
        return strMiles;

    return strMillones + ' ' + strMiles;
}//Millones()

export function MontoALetras(num, Moneda) {
    
    let data = {
        numero: num,
        enteros: Math.floor(num),
        centavos: (((Math.round(num * 100)) - (Math.floor(num) * 100))),
        letrasCentavos: '',
        letrasMonedaPlural: Moneda,
        letrasMonedaSingular: Moneda,
        letrasMonedaCentavoPlural: 'Céntimos',
        letrasMonedaCentavoSingular: 'Céntimo'
    };

    if (data.centavos > 0) {
        data.letrasCentavos = 'CON ' + (function () {
                if (data.centavos == 1)
                    return Millones(data.centavos) + ' ' + data.letrasMonedaCentavoSingular;
                else
                    return Millones(data.centavos) + ' ' + data.letrasMonedaCentavoPlural;
            })();
    };

    if(data.enteros == 0)
        return 'CERO ' + data.letrasMonedaPlural + ' ' + data.letrasCentavos;
    if (data.enteros == 1)
        return Millones(data.enteros) + ' ' + data.letrasMonedaSingular + ' ' + data.letrasCentavos;
    else
        return Millones(data.enteros) + ' ' + data.letrasMonedaPlural + ' ' + data.letrasCentavos;
};

export function NumeroALetras(num) {
    let data = {
        numero: num,
        enteros: Math.floor(num),
        centavos: (((Math.round(num * 100)) - (Math.floor(num) * 100))),
        letrasCentavos: '',
        letrasMonedaPlural: '',
        letrasMonedaSingular: '', 
        letrasMonedaCentavoPlural: '',
        letrasMonedaCentavoSingular: ''
    };

    return Millones(data.enteros);
}
export function listaRangoNumeros (pDesde, pHasta){
    let _Years =[];
        for(let j = pDesde; j <= pHasta; j++){
           _Years.push(j);
        }
       return _Years;
   }

