Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

take into account line_items with negative quantity #20

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

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 :)

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
1 participant