solidus icon indicating copy to clipboard operation
solidus copied to clipboard

Support for Colorado Delivery Fee (flat fee and order-level taxes)

Open adammathys opened this issue 3 years ago • 0 comments

❗ TODO

  • [ ] Add radio buttons for TaxRate#level enum to admin
  • [ ] Tweak descriptions for TaxRate#rate and TaxRate#calculator in admin
  • [ ] Add specs for order-level taxes
  • [ ] Rake task to automatically generate Colorado Delivery Fee stuff

Summary

Add support for the new Colorado Delivery Fee. This is achieved by making two small changes to the existing tax system:

  1. New Spree::Calculator::FlatFee calculator. Can be used to return a fixed amount that comes from an associated Spree::TaxRate.
  2. Spree::TaxRate#level enum to distinguish between item- and order-level tax rates. Item-level taxes remain the default, since we very rarely if ever want to use order-level tax rates.

These changes in additional to the recent work to support order-level taxes in Spree::OrderTaxation (#4477), makes it possible to configure a tax rate for the Colorado Delivery Fee.

Screen Shot 2022-08-05 at 2 18 26 PM

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

  • [x] I have written a thorough PR description.
  • [x] I have kept my commits small and atomic.
  • [x] I have used clear, explanatory commit messages.

The following are not always needed (~cross them out~ if they are not):

  • [ ] I have added automated tests to cover my changes.
  • [x] ~I have attached screenshots to demo visual changes.~
  • [ ] I have opened a PR to update the guides.
  • [x] ~I have updated the readme to account for my changes.~

adammathys avatar Aug 05 '22 21:08 adammathys