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

docs(create tax provider): tax line code required #5540

Merged
merged 5 commits into from Nov 6, 2023
Merged

docs(create tax provider): tax line code required #5540

merged 5 commits into from Nov 6, 2023

Conversation

nickmonad
Copy link
Contributor

While I was developing a custom tax provider, I ran into a pretty frustrating issue related to multiple tax lines and incorrect / unexpected tax total calculations. I outlined the issue in discord, before finding the solution: https://discord.com/channels/876835651130097704/1169705457804398662

After some digging, I found this issue from a while back: #1262, where it states there is now a unique constraint on item_id, code and shipping_method_id, code. But, in the current documentation for creating a custom tax provider, it states these fields as part of the tax line items returned are optional.

If these code values are left out, it can cause tax lines to be applied multiple times (as seen here as well: #1901)

I'm not entirely sure how this should be phrased in the documentation, so I just wanted to get this up and on your radar for resolution. If it ends up being that code truly should not be optional, I suspect some type definitions would need to change as well?

@nickmonad nickmonad requested a review from a team as a code owner November 2, 2023 19:26
Copy link

changeset-bot bot commented Nov 2, 2023

⚠️ No Changeset found

Latest commit: e2bb694

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Nov 2, 2023

@nickmonad is attempting to deploy a commit to the medusajs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@shahednasser shahednasser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! I've added suggestions on how we can add notes explaining the unique constraint on item_id, code and shipping_method_id, code

nickmonad and others added 2 commits November 6, 2023 09:01
…r.md

Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
…r.md

Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
@nickmonad
Copy link
Contributor Author

@shahednasser Done!

Copy link
Member

@shahednasser shahednasser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for your contribution!

@kodiakhq kodiakhq bot merged commit e415787 into medusajs:develop Nov 6, 2023
15 of 19 checks passed
@BorisKamp
Copy link

BorisKamp commented Apr 15, 2024

@shahednasser I ran into this issue as well. I created a custom tax provider but forgot to set the tax_code in the medusa interface:
Screenshot 2024-04-15 at 10 07 25

This resulted in some order having trippled VAT lines. Why is this field not enforced as required in the medusa interface?

*edit: when I try to edit the rate, the VAT code is enforced. Somehow I ended up having null for the code after creating the new tax provider. Is this something you guys are aware of?

@BorisKamp
Copy link

See here on production, my code is empty....

Screenshot 2024-04-15 at 10 11 18

@shahednasser
Copy link
Member

Hi @BorisKamp can you open an issue with this?

@BorisKamp
Copy link

Hi @BorisKamp can you open an issue with this?

Hey! Done:
#7164

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

Successfully merging this pull request may close these issues.

None yet

3 participants