support multiple tax rates per invoice #9
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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 :)