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

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

Open
tschumilas opened this issue Jun 16, 2023 · 5 comments · May be fixed by #12427
Open

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

tschumilas opened this issue Jun 16, 2023 · 5 comments · May be fixed by #12427
Assignees
Labels
hackathon Issues for upcoming hackathons papercut Labels papercuts after they've moved from the "Papercuts prioritized" column

Comments

@tschumilas
Copy link

tschumilas commented Jun 16, 2023

Description

- As a: enterprise user
- On page: /admin/orders/XXXX/edit
- I want to be able to do:

On the Admin/orders page, a hub manager should be able to see all the costs on an order, and the details on this page should add up to the order total

At present, taxes on fees (when applicable) are not included in the line item adjustment table on the admin/orders page - and users cannot understand why they cannot arrive at the order total from the information presented to them on this page. This prompts a request from most new users telling us that their orders are calculating incorrectly.

Example

This shop has a 20% enterprise fee on all products.
This fee is set to 'taxable' (but same result if it is set to 'inherit from product'
They sell a taxable product - candles ($10)
I purchase 1 candle and the costs should be:
Product - $10
Tax on product (13% x $10) = $1.30
Fee on product (20% x %10) = $2.00
Fee on product tax (13% x $2.00) = $0.26
Order total is $13.56, Including tax of $1.56

See below that the confirmation at checkout to the customer is correct, and the invoice is correct...
But see that the hub manager is confused because they do not arrive at the order total if they add up the product + line items on the admin/orders page.
Checkout-Open-Food-Network
Orders-OFN-Administration (1)

Acceptance Criteria & Tests

  1. reproduce example above and check the admin order edit page is displaying the fees in the adjustment section
  2. Add an automated test to cover this
@RachL
Copy link
Contributor

RachL commented Sep 14, 2023

@mkllnk we need your view on that one: do you think it could be done as a papercut?

@sigmundpetersen sigmundpetersen changed the title Include tax on fees in the line item adjustment table on admin/orders page Include tax on fees in the line item adjustment table on Admin->Orders page Sep 14, 2023
@sigmundpetersen sigmundpetersen changed the title Include tax on fees in the line item adjustment table on Admin->Orders page [Admin->Orders] Include tax on fees in the line item adjustment table Sep 14, 2023
@mkllnk
Copy link
Member

mkllnk commented Sep 14, 2023

Yes, it probably needs an hour or two to understand the data structure and to find the best solution but then it should easy to change. We currently just list adjustment associated to line items but we need to add the adjustments of those adjustments as well. Just go a level deeper.

I think that we need to change this line:

= render :partial => "spree/admin/orders/_form/adjustments", :locals => { :adjustments => @order.line_item_adjustments, :title => t(".line_item_adjustments")}

We can add a helper like the one for order adjustments:

# Adjustments to display under "Order adjustments".
#
# We exclude shipping method adjustments because they are displayed in a
# separate table together with the order line items.
def order_adjustments_for_display(order)
order.adjustments + order.all_adjustments.payment_fee.eligible
end

It needs to add the tax adjustments to the current list.

@RachL RachL transferred this issue from openfoodfoundation/wishlist Oct 18, 2023
@RachL RachL added papercut Labels papercuts after they've moved from the "Papercuts prioritized" column hackathon Issues for upcoming hackathons labels Oct 18, 2023
@abdulazizali77
Copy link

@dacook please assign to me, id like to work on this

@RachL
Copy link
Contributor

RachL commented Apr 12, 2024

Hello @abdulazizali77 I hope this message finds you well; I'm only checking in, no pressure: are you still working on this issue?

@abdulazizali77
Copy link

@RachL sorry for delay ill put a PR next week!

abdulazizali77 added a commit to abdulazizali77/openfoodnetwork that referenced this issue May 1, 2024
abdulazizali77 added a commit to abdulazizali77/openfoodnetwork that referenced this issue May 1, 2024
abdulazizali77 added a commit to abdulazizali77/openfoodnetwork that referenced this issue May 1, 2024
abdulazizali77 added a commit to abdulazizali77/openfoodnetwork that referenced this issue May 1, 2024
abdulazizali77 added a commit to abdulazizali77/openfoodnetwork that referenced this issue May 1, 2024
abdulazizali77 added a commit to abdulazizali77/openfoodnetwork that referenced this issue May 1, 2024
abdulazizali77 added a commit to abdulazizali77/openfoodnetwork that referenced this issue May 1, 2024
abdulazizali77 added a commit to abdulazizali77/openfoodnetwork that referenced this issue May 1, 2024
@sigmundpetersen sigmundpetersen linked a pull request May 2, 2024 that will close this issue
4 tasks
abdulazizali77 added a commit to abdulazizali77/openfoodnetwork that referenced this issue Jun 2, 2024
abdulazizali77 added a commit to abdulazizali77/openfoodnetwork that referenced this issue Jun 2, 2024
abdulazizali77 added a commit to abdulazizali77/openfoodnetwork that referenced this issue Jun 2, 2024
abdulazizali77 added a commit to abdulazizali77/openfoodnetwork that referenced this issue Jun 3, 2024
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 added a commit to abdulazizali77/openfoodnetwork that referenced this issue Jun 3, 2024
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 added a commit to abdulazizali77/openfoodnetwork that referenced this issue Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hackathon Issues for upcoming hackathons papercut Labels papercuts after they've moved from the "Papercuts prioritized" column
Projects
Status: In Progress ⚙
Status: In progress
Development

Successfully merging a pull request may close this issue.

5 participants