Skip to content

Commit

Permalink
Add non-Germany affiliate tax handling in pdf invoice generation
Browse files Browse the repository at this point in the history
Co-authored-by: arm <[email protected]>
  • Loading branch information
2 people authored and jgoedde committed Dec 12, 2024
1 parent 1337c46 commit e9ed745
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/common/api/worker/invoicegen/InvoiceTexts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default {
yourVatId: "Your VAT identification number:",
netPricesNoVatInGermany: "All prices are net prices and not subject to value added tax in Germany.",
noVatInGermany: "Prices are not subject to value added tax in Germany.",
reverseChargeAffiliate: "All prices are net prices. We are liable for VAT under the reverse charge mechanism",

paymentInvoiceDue1: "The payment is due 7 days after the invoice date without any deduction. Please",
paymentInvoiceDue2: "transfer the grand total with reference to the invoice number to our account:",
Expand Down Expand Up @@ -102,6 +103,7 @@ export default {
yourVatId: "Ihre Umsatzsteuer-Identifikationsnummer:",
netPricesNoVatInGermany: "Alle Beträge sind netto und werden nicht in Deutschland versteuert.",
noVatInGermany: "Beträge werden nicht in Deutschland versteuert.",
reverseChargeAffiliate: "Alle Beträge sind netto. Die Steuerschuldnerschaft geht auf uns als Leistungsempfänger über.",

quantity: "Menge",
item: "Item",
Expand Down
19 changes: 16 additions & 3 deletions src/common/api/worker/invoicegen/PdfInvoiceGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const enum VatType {
ADD_VAT = "1",
VAT_INCLUDED_SHOWN = "2",
VAT_INCLUDED_HIDDEN = "3",
NO_VAT_REVERSE_CHARGE = "4",
NO_VAT_CHARGE_TUTAO = "4",
}

const enum InvoiceType {
Expand Down Expand Up @@ -223,7 +223,8 @@ export class PdfInvoiceGenerator {
"",
"",
InvoiceTexts[this.languageCode].grandTotal,
this.formatInvoiceCurrency(this.invoice.grandTotal),
// in case of NO_VAT_CHARGE_TUTAO we must not show the VAT in the invoice, but we pay the taxes ourselves, so they need to be existing on the invoice
this.formatInvoiceCurrency(this.invoice.vatType == VatType.NO_VAT_CHARGE_TUTAO ? this.invoice.subTotal : this.invoice.grandTotal),
])
}

Expand All @@ -239,7 +240,6 @@ export class PdfInvoiceGenerator {
case VatType.VAT_INCLUDED_SHOWN:
break
case VatType.NO_VAT:
case VatType.NO_VAT_REVERSE_CHARGE:
if (this.invoice.vatIdNumber != null) {
this.doc
.addText(InvoiceTexts[this.languageCode].reverseChargeVatIdNumber1)
Expand All @@ -253,6 +253,19 @@ export class PdfInvoiceGenerator {
this.doc.addText(InvoiceTexts[this.languageCode].netPricesNoVatInGermany)
}
break
case VatType.NO_VAT_CHARGE_TUTAO:
this.doc
.addText(InvoiceTexts[this.languageCode].reverseChargeAffiliate)
.addLineBreak()
.addText(InvoiceTexts[this.languageCode].reverseChargeVatIdNumber2)
if (this.invoice.vatIdNumber != null) {
this.doc
.addLineBreak()
.addText(`${InvoiceTexts[this.languageCode].yourVatId} `)
.changeFont(PDF_FONTS.BOLD, 11)
.addText(`${this.invoice.vatIdNumber}`)
}
break
case VatType.VAT_INCLUDED_HIDDEN:
this.doc.addText(InvoiceTexts[this.languageCode].noVatInGermany)
break
Expand Down

0 comments on commit e9ed745

Please sign in to comment.