From 5e37e877c1d4181a1ed54552875cec6af6abaa91 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Mon, 27 Jul 2020 17:01:43 +0200 Subject: More work on load and print: - Load by year and quarter or year only - output as a dict --- fracture/__main__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'fracture/__main__.py') 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) -- cgit v1.2.3