drafthorse update
Bernd Wurst

Bernd Wurst commited on 2026-06-25 19:47:44
Zeige 2 geänderte Dateien mit 11 Einfügungen und 10 Löschungen.

... ...
@@ -21,7 +21,7 @@ from .InvoiceObjects import InvoiceTable, InvoiceText, RECHNUNG, GUTSCHRIFT, KOR
21 21
     VAT_REGULAR, VAT_KLEINUNTERNEHMER, VAT_INNERGEM, PAYMENT_UEBERWEISUNG, PAYMENT_LASTSCHRIFT, UNITS
22 22
 from drafthorse.models.accounting import TradeAllowanceCharge
23 23
 from drafthorse.models.party import TaxRegistration, URIUniversalCommunication
24
-from drafthorse.models.payment import PaymentTerms
24
+from drafthorse.models.payment import PaymentTerms, PaymentMeans
25 25
 from drafthorse.models.note import IncludedNote
26 26
 from drafthorse.models import NS_QDT
27 27
 from drafthorse.pdf import attach_xml
... ...
@@ -187,7 +187,7 @@ def InvoiceToXML(invoice):
187 187
                 li.document.line_id = f"{line_id_count}"
188 188
                 if last_title:
189 189
                     title = IncludedNote()
190
-                    title.content.add(last_title)
190
+                    title.content = last_title
191 191
                     li.document.notes.add(title)
192 192
                 li.product.name = el['subject']
193 193
                 if 'desc' in el and el['desc'] != '':
... ...
@@ -278,7 +278,7 @@ def InvoiceToXML(invoice):
278 278
 
279 279
     for paragraph in textparts:
280 280
         note = IncludedNote()
281
-        note.content.add(paragraph)
281
+        note.content = paragraph
282 282
         doc.header.notes.add(note)
283 283
 
284 284
 
... ...
@@ -287,19 +287,20 @@ def InvoiceToXML(invoice):
287 287
         doc.trade.settlement.creditor_reference_id = invoice.creditor_reference_id
288 288
     doc.trade.settlement.payment_reference = invoice.id
289 289
     doc.trade.settlement.currency_code = 'EUR'
290
+    payment_means = PaymentMeans()
290 291
     if invoice.payment_type:
291
-        doc.trade.settlement.payment_means.type_code = invoice.payment_type
292
+        payment_means.type_code = invoice.payment_type
292 293
 
293 294
     if invoice.seller_bank_data['iban'] and invoice.payment_type == PAYMENT_UEBERWEISUNG:
294
-        doc.trade.settlement.payment_means.payee_account.account_name = \
295
+        payment_means.payee_account.account_name = \
295 296
             invoice.seller_bank_data['kontoinhaber'] or invoice.seller['trade_name'] or invoice.seller['name']
296
-        doc.trade.settlement.payment_means.payee_account.iban = invoice.seller_bank_data['iban']
297
+        payment_means.payee_account.iban = invoice.seller_bank_data['iban']
297 298
         if invoice.seller_bank_data['bic']:
298
-            doc.trade.settlement.payment_means.payee_institution.bic = invoice.seller_bank_data['bic']
299
+            payment_means.payee_institution.bic = invoice.seller_bank_data['bic']
299 300
     if invoice.buyer_bank_data['iban'] and invoice.payment_type == PAYMENT_LASTSCHRIFT:
300 301
         # Kunden-Bankverbindung bei Lastschrift
301
-        doc.trade.settlement.payment_means.payer_account.iban = invoice.buyer_bank_data['iban']
302
-
302
+        payment_means.payer_account.iban = invoice.buyer_bank_data['iban']
303
+    doc.trade.settlement.payment_means.add(payment_means)
303 304
     terms = PaymentTerms()
304 305
     if invoice.due_date and invoice.payment_type == PAYMENT_UEBERWEISUNG:
305 306
         terms.description = f"Bitte begleichen Sie den Betrag bis zum {invoice.due_date.strftime('%d.%m.%Y')} ohne Abzüge."
... ...
@@ -1 +1 @@
1
-Subproject commit a62b2e86a84cbc78c2211fcaff975cd5e319394f
1
+Subproject commit cca3b5e2552b394e156df4e078089e9793568033
2 2