Skip to content

Commit fcbb9af

Browse files
committed
Apply fixes from pretix#102.
1 parent 87e689c commit fcbb9af

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

README.rst

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@ Generating::
5757
from drafthorse.models.note import IncludedNote
5858
from drafthorse.models.party import TaxRegistration
5959
from drafthorse.models.payment import PaymentTerms
60+
from drafthorse.models.payment import PaymentMeans
61+
from drafthorse.models.trade import AdvancePayment, IncludedTradeTax
6062
from drafthorse.models.tradelines import LineItem
6163
from drafthorse.pdf import attach_xml
6264

65+
6366
# Build data structure
6467
doc = Document()
6568
doc.context.guideline_parameter.id = "urn:cen.eu:en16931:2017"
@@ -69,14 +72,13 @@ Generating::
6972

7073
doc.header.notes.add(IncludedNote(content="Test Note 1"))
7174

72-
doc.trade.agreement.seller.name = "Lieferant GmbH"
73-
7475
doc.trade.agreement.buyer.name = "Kunde GmbH"
7576
doc.trade.agreement.buyer.address.country_id = "DE"
7677

7778
doc.trade.settlement.currency_code = "EUR"
78-
doc.trade.settlement.payment_means.type_code = "ZZZ"
79+
doc.trade.settlement.payment_means.add(PaymentMeans(type_code="ZZZ"))
7980

81+
doc.trade.agreement.seller.name = "Lieferant GmbH"
8082
doc.trade.agreement.seller.address.country_id = "DE"
8183
doc.trade.agreement.seller.address.country_subdivision = "Bayern"
8284
doc.trade.agreement.seller.tax_registrations.add(
@@ -85,7 +87,18 @@ Generating::
8587
)
8688
)
8789

88-
doc.trade.settlement.advance_payment.received_date = datetime.now(timezone.utc)
90+
advance = AdvancePayment(
91+
received_date=datetime.now(timezone.utc), paid_amount=Decimal(42)
92+
)
93+
advance.included_trade_tax.add(
94+
IncludedTradeTax(
95+
calculated_amount=Decimal(0),
96+
type_code="VAT",
97+
category_code="E",
98+
rate_applicable_percent=Decimal(0),
99+
)
100+
)
101+
doc.trade.settlement.advance_payment.add(advance)
89102

90103
li = LineItem()
91104
li.document.line_id = "1"

0 commit comments

Comments
 (0)