invopop / gobl

Go Business Language
Apache License 2.0
92 stars 8 forks source link

Bug in exempt tax rate totals calculation #316

Open samlown opened 3 months ago

samlown commented 3 months ago

Given the following document:

$schema: "https://gobl.org/draft-0/bill/invoice"
uuid: "328f20c8-a0ac-11ee-bb1d-e6a7901137ed"
currency: "EUR"
issue_date: "2023-12-18"
series: "EXPORT-X"
code: "0002"

supplier:
  tax_id:
    country: "ES"
    code: "B98602642" # random
  name: "Provide One S.L."
  emails:
    - addr: "billing@example.com"
  addresses:
    - num: "42"
      street: "San Frantzisko"
      locality: "Bilbo"
      region: "Bizkaia"
      code: "48003"
      country: "ES"

customer:
  tax_id:
    country: "NL"
  name: "Sample End-Consumer"
  identities:
    - key: "es-passport"
      code: "123456789"

lines:
  - quantity: 20
    item:
      name: "Development services"
      price: "90.00"
      unit: "h"
    discounts:
      - percent: "10%"
        reason: "Special discount"
    taxes:
      - cat: VAT
        ext:
          es-tbai-product: "services"
          es-tbai-exemption: "RL"

notes:
  - key: "general"
    text: "Some random description"

Unless rate: exempt is included in the line's taxes, the totals will not be calculated.