Änderungen an der Upstream-Library eingebaut
Bernd Wurst

Bernd Wurst commited on 2024-03-11 16:09:24
Zeige 2 geänderte Dateien mit 7 Einfügungen und 9 Löschungen.

... ...
@@ -50,9 +50,7 @@ def InvoiceToXML(invoice):
50 50
 
51 51
     # Seller-Address
52 52
     if invoice.seller['trade_name']:
53
-        pass
54
-        # FIXME: specified_legal_organization ist in der Library nicht implementiert, pull request ist vorhanden
55
-        # doc.trade.agreement.seller.specified_legal_organization.trade_name = invoice.seller['trade_name']
53
+        doc.trade.agreement.seller.legal_organization.trade_name = invoice.seller['trade_name']
56 54
     doc.trade.agreement.seller.name = invoice.seller['name']
57 55
     doc.trade.agreement.seller.address.country_id = invoice.seller['address']['country_id']
58 56
     doc.trade.agreement.seller.address.postcode = invoice.seller['address']['postcode']
... ...
@@ -69,8 +67,7 @@ def InvoiceToXML(invoice):
69 67
     if invoice.seller['email']:
70 68
         email = URIUniversalCommunication()
71 69
         email.uri_ID = ('EM', invoice.seller['email'])
72
-        # FIXME: Typo in der Library ("adress")?
73
-        doc.trade.agreement.seller.electronic_adress.add(email)
70
+        doc.trade.agreement.seller.electronic_address.add(email)
74 71
 
75 72
     # Buyer-Address
76 73
     doc.trade.agreement.buyer.name = invoice.customer['name']
... ...
@@ -59,7 +59,7 @@ if __name__ == '__main__':
59 59
     invoice.seller_bank_data['kontoinhaber'] = "schokokeks.org GbR"
60 60
     invoice.seller_bank_data['iban'] = "DE91602911200041512006"
61 61
     invoice.seller_bank_data['bic'] = "GENODES1VBK"
62
-    invoice.seller_bank_data['bankname'] = 'Volksbank'
62
+    invoice.seller_bank_data['bankname'] = 'Volksbank Backnang'
63 63
     invoice.id = str(rechnungsnummer)
64 64
     invoice.customerno = rechnung['kunde']
65 65
     invoice.customer['name'] = adresse['company'] or adresse['name']
... ...
@@ -176,15 +176,16 @@ if __name__ == '__main__':
176 176
                 # Im Fehlerfall ?!
177 177
                 with open(tmp2.name, 'rb') as f:
178 178
                     pdfdata = f.read()
179
-        except:
179
+        except Exception as e:
180
+            print(e)
180 181
             # Wenn hier was schiefgeht, nutzen wir das alte PDF
181 182
             pass
182 183
         # FIXME: Die Metadaten sind noch nicht gültig, da scheint es einen Fehler in der drafthorse-Library zu geben
183
-        pdfdata = attach_xml(pdfdata, xmldata, 'EXTENDED')
184
+        pdfdata = attach_xml(pdfdata, xmldata)
184 185
 
185 186
     f = open(filename, "wb")
186 187
     f.write(pdfdata)
187 188
     f.close()
188 189
     print(filename)
189 190
 
190
-    print(textdata)
191
+    #print(textdata)
191 192