Skip to content

Conversation

@SubandiK
Copy link
Contributor

@SubandiK SubandiK commented Jan 28, 2025

This makes it so that secretariat accepts an invoice like this:

  • invoice total: -100€
  • invoice item: 1x -100€

and then turning the invoice item to "-1x 100€", so the resulting e-invoice passes validations.

Also added a small change: invoice_items with an amount of 0 but a non 0 tax rate, e.g.
title: booking, amount: 0€, tax_rate: 19%, tax_amount: 0€
will be sent as having a tax_rate of 0%, otherwise they don't get accepted by the standard as is.

fix #21

Background: Zugferd doesn't allow invoice items with negative amounts; it has no problems with negative amounts for invoices. By accepting an invoice with attributes like "1x -100€" and then turning them into "-1x 100€" we stay standard conformant.

I decided to do it like this, and not make this gem's api expect the "-1x 100€" format because I think this is more straight forward and what most people using this gem will already use internally. But I can switch it around and put the burden on the gem-user if you prefer.

Can be reviewed @halfbyte :)

@halfbyte halfbyte merged commit 1283b2b into halfbyte:main Mar 12, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invoice items with negative amounts are not supported

2 participants