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

Properly compute shipping order line total #1592

Open
wants to merge 6 commits into
base: 1.x
Choose a base branch
from

Conversation

olivierguerriat
Copy link

The total column of the order line didn't consider the tax for shipping lines.

I added a few assertions and updated CalculateTax to fill every amounts.

I also simplified ApplyShipping to avoid recomputing the same amounts and only fill the breakdown. Please check that it makes sense, I'm out of my comfort zone there.

Copy link

vercel bot commented Feb 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lunar-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2024 2:30pm
@alecritson
Copy link
Collaborator

Appreciate this has been hanging around a bit. I'm not sure the shippingSubTotal should be in the calculate tax action as we need it before we calculate tax , the sub total needs to be available to any actions that may come between and it's a bit out the scope of what the CalculateTax action is attempting to do.

@olivierguerriat
Copy link
Author

Thanks for reviewing. Splitting concerns makes sense, I reverted ApplyShipping and adapted CalculateTax accordingly.

@glennjacobs
Copy link
Contributor

Having reviewed the code these are my thoughts...

  • We need documentation to reflect these changes
  • If there is no shipping, should the shipping values be 0 rather than null?
  • Maybe we should have a test to cover the no-shipping scenario?
@glennjacobs glennjacobs self-assigned this May 22, 2024
@glennjacobs
Copy link
Contributor

@alecritson I think this is probably needed, however, do we need to consider any updates to the Orders side of things?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants