stuff
This commit is contained in:
parent
9c02b1a454
commit
88e75f71c9
6
main.py
6
main.py
|
|
@ -281,7 +281,7 @@ def generate_compliant_xrechnung(data):
|
|||
ET.SubElement(tax_total, f"{{{CBC}}}TaxAmount", {"currencyID": "EUR"}).text = f"{data['total_vat_amount']:.2f}"
|
||||
tax_subtotal = ET.SubElement(tax_total, f"{{{CAC}}}TaxSubtotal")
|
||||
ET.SubElement(tax_subtotal, f"{{{CBC}}}TaxableAmount", {"currencyID": "EUR"}).text = f"{data['total_net_amount']:.2f}"
|
||||
ET.SubElement(tax_subtotal, f"{{{CBC}}}TaxAmount", {"currencyID": "EUR"}).text = f"{data['total_vat_amount']:.2f}"
|
||||
ET.SubElement(tax_subtotal, f"{{{CAC}}}TaxAmount", {"currencyID": "EUR"}).text = f"{data['total_vat_amount']:.2f}"
|
||||
tax_cat = ET.SubElement(tax_subtotal, f"{{{CAC}}}TaxCategory")
|
||||
ET.SubElement(tax_cat, f"{{{CBC}}}ID").text = vat_category
|
||||
ET.SubElement(tax_cat, f"{{{CBC}}}Percent").text = f"{vat_rate:.2f}"
|
||||
|
|
@ -307,10 +307,12 @@ def generate_compliant_xrechnung(data):
|
|||
ET.SubElement(line, f"{{{CBC}}}LineExtensionAmount", {"currencyID": "EUR"}).text = f"{item['total_amount']:.2f}"
|
||||
|
||||
item_elem = ET.SubElement(line, f"{{{CAC}}}Item")
|
||||
ET.SubElement(item_elem, f"{{{CBC}}}Name").text = str(item.get("name", "Dienstleistung"))
|
||||
|
||||
# 🔥 FIX: In UBL 2.1 MUSS cbc:Description zwingend VOR cbc:Name stehen!
|
||||
if item.get("description") and str(item["description"]).strip() != "":
|
||||
ET.SubElement(item_elem, f"{{{CBC}}}Description").text = str(item["description"]).strip()
|
||||
|
||||
ET.SubElement(item_elem, f"{{{CBC}}}Name").text = str(item.get("name", "Dienstleistung"))
|
||||
|
||||
item_tax = ET.SubElement(item_elem, f"{{{CAC}}}ClassifiedTaxCategory")
|
||||
ET.SubElement(item_tax, f"{{{CBC}}}ID").text = vat_category
|
||||
|
|
|
|||
Loading…
Reference in New Issue