-
-
Notifications
You must be signed in to change notification settings - Fork 708
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
Include voucher tax adjustment in revenues by hub report #11914
Include voucher tax adjustment in revenues by hub report #11914
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this. Can you improve the spec setup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking at this ! Vouchers can be a bit tricky to understand let us know if you need some help.
distributor: distributor3, | ||
product_price: 110.0, | ||
tax_rate_amount: 0.1, | ||
included_in_price: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be included_in_price: false
to get tax excluded from price. In this case it's not affecting the result as you are mocking VoucherAdjustmentsService
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one last thing, see my comment.
Also. we prefer to rebase the branch on master instead of merging.
Thanks !
order.update_shipping_fees! | ||
order.update_order! | ||
|
||
VoucherAdjustmentsService.new(order).update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add order.update_totals_and_states
after VoucherAdjustmentsService.new(order).update
otherwise the various order total won't take into account the voucher adjustment you just updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, I updated the specs as you suggested
Hi @bmd08a1, I did some testing and here are the results. Each order had a value of 10 $, tax (if applied) was 10 %, fees (if applied) were 10 %, voucher (always applied) was 10 %. I placed three orders before staging your PR:
After staging the PR I placed some orders again:
ResultsNo taxTax excludedTax includedTotal of all three ordersWith 1 $ shipping fee (no tax)After - No tax: Additional enterprise fee of 10 % (tax applies)SummaryExcellent work! 💪 I couldn't find any issues with this. There are more complex scenarios for sure, but I tried to cover it systematically. This one is ready for merging! 🎉 🚀 |
What? Why?
What should we test?
Release notes
Changelog Category (reviewers may add a label for the release notes):
The title of the pull request will be included in the release notes.
Dependencies
Documentation updates