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

support multiple tax rates per invoice #9

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

SubandiK
Copy link
Contributor

fix #6

Adds support for multiple tax rates per invoice.
No changes required in the API, but Invoice.tax_rate is now obsolete. I left it in because you asked for backwards compatibility, so we don't throw an error if trying to set it. Now, numerical tax information is taken from the line_items, Invoice.tax_amount is still used for validation and for TaxTotalAmount

tax_category and tax_reason are still taken from the invoice:

  • German 7% and 19% are both the standard category and I don't currently see a case where one (but not another in the same invoice) line item would have a different category
  • tax_reason is simply not used by us. It could also go into the line_item object, but then we'd have to send it for each line_item - meh

Also, feel free to suggest better syntax, I'm much more of a Rails than pure Ruby person so if you don't like something by all means let's change it :)

@@ -0,0 +1,34 @@
=begin
Copyright Jan Krutisch
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how this works, or if I should have put my name in here? I personally don't care, but neither "signing in your name" nor "putting in my name here while I don't care about copyright at all" felt truly right.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll come up with something along the lines of "Copyright Secretariat Team and Contributors, see CONTRIBUTORS.md" or something.

@SubandiK
Copy link
Contributor Author

SubandiK commented Dec 3, 2024

actually don't review yet please, I have found a potential issue that needs fixing; will update

@SubandiK
Copy link
Contributor Author

SubandiK commented Dec 3, 2024

@halfbyte it now works as expected even if there are line_items with quantity > 1, adjusted spec too.

@halfbyte halfbyte merged commit 7fd7fb6 into halfbyte:main Dec 4, 2024
4 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.

Support for multiple tax rates in one invoice
2 participants