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

Invalid calculation of discount_weightage with ineligible adjustments #45

Open
joseconsador opened this issue Jul 8, 2019 · 1 comment

Comments

@joseconsador
Copy link

We're getting an error response (Taxjar::Error::BadRequest: Order amount must be equal to the sum of line items and shipping) when processing an order with ineligible promotion adjustments. This is because the line item prices will not end up matching the order total once discounts are applied. We may be able to resolve this by scoping to eligible.

weightage = @order.adjustments.eligible.promotion.sum(:amount) / (@order.item_total)

I can submit a pull request, but I first wanted to check if anyone else has encountered this issue.

@pankajkumar1104
Copy link

+1 @joseconsador today i fixed the same issue in my project too

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

2 participants