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

LineItem: Setting a DiscountAmount of 0 on a negative UnitAmount results in validation error #429

Open
timwiel opened this issue Jul 2, 2021 · 0 comments

Comments

@timwiel
Copy link

timwiel commented Jul 2, 2021

If via the API you post a new invoice with a DiscountAmount of 0 when the UnitAmount is negative a validation error occurs:

The discount rate '0.00' is invalid. Discount must not be greater than the line total.

However when setting a DiscountRate of 0 when the UnitAmount is negative no validation error occurs.

Expected Behavior

As a DiscountAmount of 0 actually is the same as a DiscountRate of 0 the API should allow the 0 amount to be submitted and accepted.

Also if a DiscountAmount higher than 0 on a negative UnitAmount is not allowed then why can invoices in the Xero Application with negative UnitAmounts allow DiscountRates to be added to them. Surely this should also match in the API but this could be another issue.

Note: A validation error is generated in both API explorer and via xeroapi/xero-php-oauth2 so it is the API that has the issue

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

No branches or pull requests

1 participant