]> git.ipfire.org Git - thirdparty/python-drafthorse.git/commitdiff
Fix README example and remove unused "import os" (#76)
authorHanno Böck <990588+hannob@users.noreply.github.com>
Sun, 6 Apr 2025 07:21:19 +0000 (09:21 +0200)
committerGitHub <noreply@github.com>
Sun, 6 Apr 2025 07:21:19 +0000 (09:21 +0200)
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

README.rst

index 07cac92aefb87d53ecb2b590080ccd2d5bd06bc1..064dcf3d2883d46dde216def194689b129819fcf 100644 (file)
@@ -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()