diff options
author | Ekaitz Zarraga <ekaitz@elenq.tech> | 2020-07-27 17:01:43 +0200 |
---|---|---|
committer | Ekaitz Zarraga <ekaitz@elenq.tech> | 2020-07-27 17:01:43 +0200 |
commit | 5e37e877c1d4181a1ed54552875cec6af6abaa91 (patch) | |
tree | e177a4640866d52aa75228b946786058143fd6df /fracture/__main__.py | |
parent | b4efa79f574cc613f819cb1ecf0dbc6571de5720 (diff) |
More work on load and print:
- Load by year and quarter or year only
- output as a dict
Diffstat (limited to 'fracture/__main__.py')
-rw-r--r-- | fracture/__main__.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fracture/__main__.py b/fracture/__main__.py index 4805306..822cf96 100644 --- a/fracture/__main__.py +++ b/fracture/__main__.py @@ -109,8 +109,10 @@ def new_invoice(): # edit(Invoice.load(num).to_config()) @command -def summarize(xlsx=False, quarter=None, year=None): - print(xlsx) +def summarize(xlsx=False, year=None, quarter=None): + invoices = Invoice.load_by_date(year, quarter) + rows = map(lambda x: x.to_row(), invoices) + if __name__ == "__main__": load_config() @@ -135,9 +137,9 @@ if __name__ == "__main__": help="Display summary for tax declarations") summary_parser.add_argument("--xlsx", action="store_true", help="Output as xlsx") - summary_parser.add_argument("--quarter", type=int, nargs=1, + summary_parser.add_argument("--quarter", type=int, help="Obtain the summary of the quarter") - summary_parser.add_argument("--year", type=int, nargs=1, + summary_parser.add_argument("--year", type=int, help="Obtain the summary of the year") summary_parser.set_defaults(func=summarize) |