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

Add a stub article that summarizes Solidus's built-in tax calculator #2526

Merged

Conversation

benjaminwil
Copy link
Contributor

This pull request extends my previous pull request for calculators documentation (#2511). It depends on #2511 being merged first.

This is part a larger project to improve Solidus's documentation. See this gist with the high-level table of contents. Where and how this documentation will exist is still up for discussion.

Taxes can apply to line items, shipments, or an entire order.

The tax calculator uses its calculable – a `Spree::TaxRate` – to calculate tax
totals. Tax rates are represented as decimal between `0.01` and `1.00`.
Copy link
Member

Choose a reason for hiding this comment

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

I don't believe this is true. A tax rate has a precision of 8, scale 5 at the DB level and no such restrictions in rails validations that I know of.

@benjaminwil benjaminwil force-pushed the tax_calculator_documentation branch from 4a0c097 to 1d01982 Compare March 14, 2018 20:51
Taxes can apply to line items, shipments, or an entire order.

The tax calculator uses its calculable – a `Spree::TaxRate` – to calculate tax
totals. Tax rates are represented as decimal between `0` and `1`.
Copy link
Member

Choose a reason for hiding this comment

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

The amounts that can be represented here are actually between -999.99999 and 999.99999 to potentially accounting for tax rates over 100% and (for some reason) negative tax rates.

I think it would be best to use a simple example here that a sales tax of 5% should be represented as 0.05 and not 5 as 5 is 500%.

@benjaminwil benjaminwil force-pushed the tax_calculator_documentation branch from 1d01982 to e000918 Compare April 17, 2018 23:24
@gmacdougall gmacdougall merged commit a616879 into solidusio:master Apr 18, 2018
@benjaminwil benjaminwil deleted the tax_calculator_documentation branch April 30, 2018 18:27
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

Successfully merging this pull request may close these issues.

3 participants