diff --git a/CHANGELOG.md b/CHANGELOG.md index 20378fa..e483ed9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# 0.6.4 + +* Fix bug with CSV stat export when no VAT on an invoice + +# 0.6.3 + +* Fix bug with `price_formula` and empty string prices + # 0.6.2 * Migrate to Hy `>= 0.26` diff --git a/setup.py b/setup.py index 2b00e7b..98c4a8b 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,12 @@ -import sys -import re import os -import ast from setuptools import setup + # Pass package modules files. # From https://stackoverflow.com/a/36693250/1956471 def package_files(directory): paths = [] - for (path, directories, filenames) in os.walk(directory): + for path, directories, filenames in os.walk(directory): for filename in filenames: paths.append(os.path.join("..", path, filename)) return paths @@ -20,7 +18,7 @@ def package_files(directory): setup( name="tqwgp-parser", - version="0.6.3", + version="0.6.4", url="https://github.com/YtoTech/talk-quote-work-getpaid-parser", license="AGPL-3.0", author="Yoan Tournade", diff --git a/tqwgp_parser/__main__.py b/tqwgp_parser/__main__.py index 2e4c147..484fe7c 100644 --- a/tqwgp_parser/__main__.py +++ b/tqwgp_parser/__main__.py @@ -322,11 +322,13 @@ def format_decimal(number): # TODO Include date parsing in core parser. # Allows to set format in definitions? # "DD MMMM YYYY" - "parsed_date": pendulum.from_format( - invoice["date"], date_format, locale=date_locale - ) - if date_format - else None, + "parsed_date": ( + pendulum.from_format( + invoice["date"], date_format, locale=date_locale + ) + if date_format + else None + ), } ) if date_format: @@ -343,15 +345,17 @@ def format_decimal(number): document["project_name"], invoice["number"], invoice["date"], - invoice_entry["parsed_date"].format(date_csv_format) - if invoice_entry["parsed_date"] and date_csv_format - else "-", + ( + invoice_entry["parsed_date"].format(date_csv_format) + if invoice_entry["parsed_date"] and date_csv_format + else "-" + ), invoice["title"], invoice["sect"]["name"], invoice["client"]["name"], # Options to round, change numeric character (,.), ... format_decimal(invoice["price"]["total_vat_excl"]), - format_decimal(invoice["price"]["vat"]), + format_decimal(invoice["price"]["vat"] or 0), format_decimal(invoice["price"]["total_vat_incl"]), len(invoice["lines"]), ]