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

Order.avalara_tax_enabled isn't respected in tax calculator #176

Open
tmtrademarked opened this issue Jun 1, 2022 · 2 comments
Open

Order.avalara_tax_enabled isn't respected in tax calculator #176

tmtrademarked opened this issue Jun 1, 2022 · 2 comments

Comments

@tmtrademarked
Copy link
Contributor

It looks like there may be a slight design flaw here - but before I open a PR to attempt to fix this, I'm curious whether or not this is truly intentional. So I figured I'd open an issue and see what others thought.

From what I can tell, there's a method on an order called avalara_tax_enabled? defined here which seems to be used in a few places to help determine whether or not tax should be calculated for a given order. But... in the tax calculator, this method is not used, and instead we just check the overall tax configuration.

It seems like this method is intended to be a hook for applications to write code that allows for saying "disable taxes for this order", but that obviously won't work as written. I'm not sure if this is an intentional choice in the gem, or an oversight, or a bug, or some combination of all three!

@MassimilianoLattanzio
Copy link
Contributor

That line was introduced by this commit. Previously, the method avalara_tax_enabled? was called avalara_eligible? but was not used. In my opinion, I think it's just an oversight. Anyway, I think it's reasonable to align also that to use the avalara_tax_enabled? method.

@MassimilianoLattanzio
Copy link
Contributor

Additionally, the avalara_tax_enabled? Method is replicated in many different models, so maybe it's better to refactor the code to centralize the method in a single place?

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