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

Display additional tax total in order - fixes #11680 #12427

Conversation

abdulazizali77
Copy link
Contributor

@abdulazizali77 abdulazizali77 commented May 1, 2024

What? Why?

image

UNCERTAIN

  • Label for the Tax category order adjustment which is currently 'Tax category'

What should we test?

  • Add new Product with price $10
  • Add non-included Tax Rate with 13%
  • Add Enterprise Fee with Tax category of the newly added Tax Rate with Flat Percent (per item) of 20%
  • Add the newly added Enterprise Fee to the Order Cycle with the new Product
  • Create new Order adding 1 Product. The final checkout price will be $13.56 with (included tax) of $0.26

Tax included in price
Same scenario as above but with Tax Rate included in the price. Check it's working as before.

Release notes

Changelog Category (reviewers may add a label for the release notes):

  • User facing changes
  • API changes (V0, V1, DFC or Webhook)
  • Technical changes only
  • Feature toggled

The title of the pull request will be included in the release notes.

@abdulazizali77 abdulazizali77 force-pushed the bugfix/11680-order-additional-tax branch 5 times, most recently from 25382be to c833e78 Compare May 1, 2024 12:15
@sigmundpetersen
Copy link
Contributor

Hi @abdulazizali77 👋 I see this is still a draft PR.
Do you want to move forward with this one?

@abdulazizali77 abdulazizali77 force-pushed the bugfix/11680-order-additional-tax branch 2 times, most recently from 22d17a3 to 1755726 Compare June 2, 2024 10:49
@abdulazizali77 abdulazizali77 changed the title WIP Display additional tax total in order - fixes #11680 Display additional tax total in order - fixes #11680 Jun 2, 2024
@abdulazizali77 abdulazizali77 marked this pull request as ready for review June 2, 2024 11:40
@abdulazizali77
Copy link
Contributor Author

@sigmundpetersen apologies for the delay, PTAL and review.
As noted in the notes above, uncertain about using I18n.t("tax_category"), as label.
Additionally the spec file might not be completely optimal

@rioug rioug self-requested a review June 3, 2024 01:19
Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

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

Thanks for your help @abdulazizali77 🙏 !
The PR looks fine, but there are a couple things I would like you to change, see my comments.
The spec is fine, we could probably achieve the same with a per_item enterprise fee but no need to change that.
I don't think we need to cover the tax included in the price here, but just to be sure I updated the test note so our testers can double check that.

app/helpers/admin/orders_helper.rb Outdated Show resolved Hide resolved
app/helpers/admin/orders_helper.rb Outdated Show resolved Hide resolved
@abdulazizali77 abdulazizali77 force-pushed the bugfix/11680-order-additional-tax branch from 1755726 to 8c8f4c7 Compare June 3, 2024 02:30
@abdulazizali77 abdulazizali77 requested a review from rioug June 3, 2024 02:38
Add new text key admin.order.edit.additional_tax_included_in_price
Add spec file for additional tax display. Add new trait for enterprise fee and calculator factory
@abdulazizali77 abdulazizali77 force-pushed the bugfix/11680-order-additional-tax branch from 8c8f4c7 to 82f75e3 Compare June 3, 2024 04:50
Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

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

Almost there, we need a better name for the translatable text.

NOTE for the future, once a PR has been reviewed it's best not to force push on the branch as we loose the commit history, and it can make it hard for other reviewer to follow what happened.

config/locales/en.yml Outdated Show resolved Hide resolved
@abdulazizali77 abdulazizali77 requested a review from rioug June 3, 2024 06:24
@mkllnk mkllnk added the user facing changes Thes pull requests affect the user experience label Jun 4, 2024
@filipefurtad0 filipefurtad0 self-assigned this Jun 5, 2024
@filipefurtad0 filipefurtad0 added pr-staged-fr staging.coopcircuits.fr and removed pr-staged-fr staging.coopcircuits.fr labels Jun 5, 2024
@filipefurtad0
Copy link
Contributor

Hey @abdulazizali77 ,

I've verified that indeed taxes over enterprise fees are not appearing on the order edit page, for our both tax types (included / added):

  • added tax

image

  • included tax

image

After this PR, we can see that the tax over the enterprise fee is appearing correctly - however, this is only the case, when the tax is is inclided to the enterprise fee:

  • added tax - applied tax is missing

image

  • included tax - OK, applied tax is visible on a separate parcel

image

I'd say let's merge this PR. This is much more critical when the tax is added, as it leads to wrong totals. So, I'm not actually even sure we need this to work for inclued tax...

In anycase and for now: merging!

@filipefurtad0 filipefurtad0 merged commit 4f7d5ad into openfoodfoundation:master Jun 5, 2024
55 of 56 checks passed
@filipefurtad0 filipefurtad0 removed the pr-staged-fr staging.coopcircuits.fr label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user facing changes Thes pull requests affect the user experience
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Admin->Orders] Include tax on fees in the line item adjustment table
5 participants