From: Hanno Böck <990588+hannob@users.noreply.github.com> Date: Sun, 6 Apr 2025 07:21:19 +0000 (+0200) Subject: Fix README example and remove unused "import os" (#76) X-Git-Tag: 2025.1.1~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=60822efca1ce7e4b2a1c2d4f764ca5a5f2a59e18;p=thirdparty%2Fpython-drafthorse.git Fix README example and remove unused "import os" (#76) The example code in the README no longer works with the latest version. A similar example in https://github.com/pretix/python-drafthorse/blob/master/tests/conftest.py exists, and uses a Decimal for doc.trade.settlement.monetary_summation.tax_total instead of a tuple. Change README example to do that as well. Also, remove an unused import ("import os"). Bug: https://github.com/pretix/python-drafthorse/issues/66 --- diff --git a/README.rst b/README.rst index 07cac92..064dcf3 100644 --- a/README.rst +++ b/README.rst @@ -49,7 +49,6 @@ Parsing:: Generating:: - import os from datetime import date, datetime, timezone from decimal import Decimal @@ -106,7 +105,7 @@ Generating:: li.settlement.trade_tax.type_code = "VAT" li.settlement.trade_tax.category_code = "E" li.settlement.trade_tax.rate_applicable_percent = Decimal("0.00") - li.settlement.monetary_summation.total_amount = (Decimal("999.00"), "EUR") + li.settlement.monetary_summation.total_amount = Decimal("999.00") doc.trade.items.add(li) trade_tax = ApplicableTradeTax()