-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Shipping tax fails to calculate when using the backend #1288
Comments
I ran into something similar yesterday, I think the issue at hand is that taxes are updated by the OrderUpdater and that changing the selected_shipping_rate from the backend does not trigger anything that calls the OrderUpdater because it goes through the API and simply update the attributes, while adding a payment trigger @order.next which calls OrderUpdater through a transition callback from shipment.rb def selected_shipping_rate_id=(id)
shipping_rates.update_all(selected: false)
shipping_rates.update(id, selected: true)
save!
end |
Note to self: We should try to tackle this while working on #1252 |
@adaddeo & @dangerdogz thanks for the detailed info. |
This should be fixed by #1514, which has been merged into master |
Great stuff! |
Calculating, and re-calculating shipping tax when building an order in the backend is a bit funky. I've listed a flow below that can be performed on a 1.3.0 sandbox to replicate.
At this point we have an order total of $39.14, which is 75 cents short of what it should be due to the missing shipping tax. This is because the order is still in the delivery state, even though we are trying to create a payment. There is no way intuitive way to have the order transition to payment.
A payment is created for a (different) amount that includes the newly created shipping tax ($39.89). This might be a bug: the payment form is submitted with $39.14 in the amount field, but after the order transitions and calculates the shipping tax, a payment is created for $39.89 instead.
The shipping tax adjustment changes from 75 cents to 25 cents, but the tax total on the order doesn't get updated. Again, no intuitive way to have the order re-calculate/transition.
The text was updated successfully, but these errors were encountered: