Bernd Wurst commited on 2024-07-10 18:28:46
Zeige 1 geänderte Dateien mit 14 Einfügungen und 2 Löschungen.
... | ... |
@@ -217,6 +217,9 @@ def InvoiceToXML(invoice): |
217 | 217 |
li.settlement.monetary_summation.total_amount = Decimal(f"{nettosumme:.2f}") |
218 | 218 |
|
219 | 219 |
summe_netto += nettosumme |
220 |
+ if part.vatType == 'net': |
|
221 |
+ summe_brutto += el['total'] * (1 + el['vat']) |
|
222 |
+ else: |
|
220 | 223 |
summe_brutto += el['total'] |
221 | 224 |
doc.trade.items.add(li) |
222 | 225 |
|
... | ... |
@@ -226,9 +229,15 @@ def InvoiceToXML(invoice): |
226 | 229 |
for vat, vatdata in part.vat.items(): |
227 | 230 |
trade_tax = ApplicableTradeTax() |
228 | 231 |
# Steuerbetrag dieses Steuersatzes |
229 |
- trade_tax.calculated_amount = Decimal(f"{(vatdata[0] / (vat + 1)) * vat:.2f}") |
|
232 |
+ amount = vatdata[0] * vat |
|
233 |
+ if part.vatType == 'gross': |
|
234 |
+ amount = (vatdata[0] / (vat + 1)) * vat |
|
235 |
+ trade_tax.calculated_amount = Decimal(f"{amount:.2f}") |
|
230 | 236 |
# Nettosumme dieses Steuersatzes |
231 |
- trade_tax.basis_amount = Decimal(f"{(vatdata[0] / (vat + 1)):.2f}") |
|
237 |
+ amount = vatdata[0] |
|
238 |
+ if part.vatType == 'gross': |
|
239 |
+ amount = amount / (1 + vat) |
|
240 |
+ trade_tax.basis_amount = Decimal(f"{amount:.2f}") |
|
232 | 241 |
trade_tax.type_code = "VAT" |
233 | 242 |
if invoice.vat_type == VAT_REGULAR: |
234 | 243 |
trade_tax.category_code = "S" |
... | ... |
@@ -238,7 +247,10 @@ def InvoiceToXML(invoice): |
238 | 247 |
elif invoice.vat_type == VAT_INNERGEM: |
239 | 248 |
trade_tax.category_code = "K" |
240 | 249 |
trade_tax.rate_applicable_percent = Decimal(f"{vat * 100:.1f}") |
250 |
+ if part.vatType == 'gross': |
|
241 | 251 |
summe_ust += (vatdata[0] / (vat + 1)) * vat |
252 |
+ else: |
|
253 |
+ summe_ust += vatdata[0] * vat |
|
242 | 254 |
doc.trade.settlement.trade_tax.add(trade_tax) |
243 | 255 |
|
244 | 256 |
for paragraph in textparts: |
245 | 257 |