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

Add discount_rate to line_items and include in calculations. #61

Conversation

latentflip
Copy link
Contributor

Fixes #56.

@waynerobinson this isn't perfect yet, particularly it's untested, but I wanted to open it to start the discussion anyway.

It's not clear to me why we manually calculate the line item amount, when xero appears to return it from the API. line_item.rb/33 Is there a reason why we recalculate it?

@waynerobinson
Copy link
Owner

This is mainly for creating new invoices however, the library needs a better way of determining whether the entry has been loaded (and not changed) from Xero or whether it has been created/updated.

Also, I'm not sure if it is strictly necessary to include the line total any more for creates/updates… this needs more testing.

@latentflip
Copy link
Contributor Author

This is buggy, definitely don't merge it yet 😄

@nnc
Copy link
Contributor

nnc commented Dec 15, 2015

@waynerobinson Xero docs now clearly state that LineAmount is optional, so this should be revisited as it still doesn't work for line items with discounts.

@latentflip do you remember which bugs you ran into with this patch?

@mphalliday
Copy link
Contributor

Is there any update on this bug? We are having issues when editing an inclusive invoice that has line item discounts.

I see this has been an issue with Xeroizer since 2013. There is also this PR #217 which has been closed. Not sure why. I'm happy to help out and do a PR to get this fixed.

@rjaus
Copy link
Collaborator

rjaus commented Oct 19, 2017

Looks like this has been added now via this commit 3e0248a

@rjaus rjaus closed this Oct 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Line items don't include discount
5 participants