Exemple #1
0
def read_reportnov(report):

    nov_entries = get_database()["novembro"]
    nov_entries = [
        e for e in nov_entries if e["NIVEL"] in filtro[report]["NIVEL"]
    ]
    nov_entries = [
        e for e in nov_entries if e["CONTA"] in filtro[report]["Conta"]
    ]
    return jsonify(nov_entries)
Exemple #2
0
def read_reportdez(report):

    dez_entries = get_database()["dezembro"]
    dez_entries = [
        e for e in dez_entries if e["NIVEL"] in filtro[report]["NIVEL"]
    ]
    dez_entries = [
        e for e in dez_entries if e["CONTA"] in filtro[report]["Conta"]
    ]
    return jsonify(dez_entries)
Exemple #3
0
def read_reportset(report):

    set_entries = get_database()["setembro"]
    set_entries = [
        e for e in set_entries if e["NIVEL"] in filtro[report]["NIVEL"]
    ]
    set_entries = [
        e for e in set_entries if e["CONTA"] in filtro[report]["Conta"]
    ]
    return jsonify(set_entries)
Exemple #4
0
def read_reportout(report):

    out_entries = get_database()["outubro"]
    out_entries = [
        e for e in out_entries if e["NIVEL"] in filtro[report]["NIVEL"]
    ]
    out_entries = [
        e for e in out_entries if e["CONTA"] in filtro[report]["Conta"]
    ]
    return jsonify(out_entries)
Exemple #5
0
def read_reportjul(report):

    jul_entries = get_database()["julho"]
    jul_entries = [
        e for e in jul_entries if e["NIVEL"] in filtro[report]["NIVEL"]
    ]
    jul_entries = [
        e for e in jul_entries if e["CONTA"] in filtro[report]["Conta"]
    ]
    return jsonify(jul_entries)
Exemple #6
0
def read_reportago(report):

    ago_entries = get_database()["agosto"]
    ago_entries = [
        e for e in ago_entries if e["NIVEL"] in filtro[report]["NIVEL"]
    ]
    ago_entries = [
        e for e in ago_entries if e["CONTA"] in filtro[report]["Conta"]
    ]
    return jsonify(ago_entries)
Exemple #7
0
def read_reportmai(report):

    mai_entries = get_database()["maio"]
    mai_entries = [
        e for e in mai_entries if e["NIVEL"] in filtro[report]["NIVEL"]
    ]
    mai_entries = [
        e for e in mai_entries if e["CONTA"] in filtro[report]["Conta"]
    ]
    return jsonify(mai_entries)
Exemple #8
0
def read_reportabr(report):

    abr_entries = get_database()["abril"]
    abr_entries = [
        e for e in abr_entries if e["NIVEL"] in filtro[report]["NIVEL"]
    ]
    abr_entries = [
        e for e in abr_entries if e["CONTA"] in filtro[report]["Conta"]
    ]
    return jsonify(abr_entries)
Exemple #9
0
def read_reportfev(report):

    fev_entries = get_database()["fevereiro"]
    fev_entries = [
        e for e in fev_entries if e["NIVEL"] in filtro[report]["NIVEL"]
    ]
    fev_entries = [
        e for e in fev_entries if e["CONTA"] in filtro[report]["Conta"]
    ]
    return jsonify(fev_entries)
Exemple #10
0
def read_reportjan(report):

    jan_entries = get_database()["janeiro"]
    jan_entries = [
        e for e in jan_entries if e["NIVEL"] in filtro[report]["NIVEL"]
    ]
    jan_entries = [
        e for e in jan_entries if e["CONTA"] in filtro[report]["Conta"]
    ]
    return jsonify(jan_entries)
Exemple #11
0
def complete(report):
    print(report)
    entries_db = get_database()
    entries = entries_db.values()

    entries = [e for elist in entries for e in elist]
    entries = [e for e in entries if e["NIVEL"] in filtro[report]["NIVEL"]]
    entries = [e for e in entries if e["CONTA"] in filtro[report]["Conta"]]
    data_return = [
        prepare_entry(uniq_desc)
        for uniq_desc in sorted(numpy.unique([e["DESCRICAO"]
                                              for e in entries]))
    ]

    populate(filter_by_month_and_report(entries_db, "janeiro", report),
             data_return, "janeiro")
    populate(filter_by_month_and_report(entries_db, "fevereiro", report),
             data_return, "fevereiro")
    populate(filter_by_month_and_report(entries_db, "marco", report),
             data_return, "marco")
    #populate(filter_by_month_and_report(entries_db, "abril", report), data_return, "abril")
    #populate(filter_by_month_and_report(entries_db, "maio", report), data_return, "maio")
    #populate(filter_by_month_and_report(entries_db, "junho", report), data_return, "junho")
    #populate(filter_by_month_and_report(entries_db, "julho", report), data_return, "julho")
    #populate(filter_by_month_and_report(entries_db, "agosto", report), data_return, "agosto")
    #populate(filter_by_month_and_report(entries_db, "setembro", report), data_return, "setembro")
    #populate(filter_by_month_and_report(entries_db, "outubro", report), data_return, "outubro")
    #populate(filter_by_month_and_report(entries_db, "novembro", report), data_return, "novembro")
    #populate(filter_by_month_and_report(entries_db, "dezembro", report), data_return, "dezembro")

    #populate(entries_fevereiro, data_return, "fevereiro")
    #populate(entries_marco, data_return, "marco")
    # populate(entries_abril, data_return, "abril")
    # populate(entries_maio, data_return, "maio")
    # populate(entries_junho, data_return, "junho")
    # populate(entries_julho, data_return, "julho")
    # populate(entries_agosto, data_return, "agosto")
    # populate(entries_setembro, data_return, "setembro")
    # populate(entries_outubro, data_return, "outubro")
    # populate(entries_novembro, data_return, "novembro")
    # populate(entries_dezembro, data_return, "dezembro")
    #sorted(data_return, key=locate_key)
    return jsonify(data_return)