forked from solidusio/solidus
-
Notifications
You must be signed in to change notification settings - Fork 0
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
[FM-1195] Support for Colorado fee by introducing order level tax and flat fee #15
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We'll need to be able to easily pass back order-level tax data to our classes that apply taxes to the order. This adds in an extra array to allow for that and reuses the existing Tax::ItemTax class for containing the data. Co-Authored-By: Sung Noh <sung@meundies.com>
Will safely check if the passed in Tax::OrderTax object has any `#order_taxes`. If so, uses our existing adjustment logic to create/update the tax records on an order-level. Co-Authored-By: Sung Noh <sung@meundies.com>
`Spree::Order#included_tax_total` and `Spree::Order#additional_tax_total` should also be updated to account for order-level tax adjustments. These columns aren't really used for anything except for some display. The tax adjustments are already accounted for in `Spree::Order#adjustment_total` which is what is used for calculating payment amounts and the like.
Very simple calculator that will always return the same amount. Will hopefully be useful for the Colorado Delivery Fee, but might also be usable for different fees that come up.
We unfortunately need to introduce the concept of order-level tax rates to handle the Colorado Delivery fee. (And maybe other similar things?) The simplest solution is to add an enum to our TaxRate model to help distinguish between rates that should be applied on an order-level and our regular item-level taxes. Co-Authored-By: Andrew Stewart <andrew@super.gd>
Updates TaxHelpers#rates_for_item to use our new enum to filter for rates that only apply to items. Co-Authored-By: Andrew Stewart <andrew@super.gd>
Looks for all order-level tax rates and computes order taxes based on the ones matching the order's ship address and tax categories.
Just a simple radio input to help set the value in the admin.
Adds the translation entry for the class and makes a small tweak to the tax rate calculator hint to explain the difference between the two calculators.
Now that this field can be used in two different ways, as a percentage or as a flat amount, we want to ensure the explanation is still helpful for users.
Simple task that can be used to help setup all of the records necessary for calculating the new Colorado Delivery Fee in stores.
Skips the logic for deciding if the "rate" should be shown in the label, since that never makes sense for flat fee tax rates.
gustavomrs
changed the title
Colorado fee / order level taxes
Support for colorado fee / order level taxes
Sep 28, 2022
gustavomrs
changed the title
Support for colorado fee / order level taxes
[FM-1195] Support for Colorado fee by introducing order level tax and flat fee
Oct 3, 2022
dafranco
approved these changes
Oct 13, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
FM-1195
The proposal of this PR is to introduce the concept of order-level tax and flat fee, so we can start to collect the $0.27 tax for orders that are being shipped to Colorado. This solution was proposed by the solidus team, so we cherry-picked the commits from these two PRs:
solidusio#4477
solidusio#4491
For more info on how this new concept works (order level and flat fee) you can check it out those two PRs from solidus (there is also a discussion here with more info)