diff --git a/app/controllers/spree/admin/orders/customer_details_controller.rb b/app/controllers/spree/admin/orders/customer_details_controller.rb index 3b25a16671..5b4806c815 100644 --- a/app/controllers/spree/admin/orders/customer_details_controller.rb +++ b/app/controllers/spree/admin/orders/customer_details_controller.rb @@ -26,6 +26,7 @@ module Spree end refresh_shipment_rates + recalculate_taxes OrderWorkflow.new(@order).advance_to_payment flash[:success] = Spree.t('customer_details_updated') @@ -47,6 +48,15 @@ module Spree @order.shipments.map(&:refresh_rates) end + def recalculate_taxes + # If the order's address has been changed, the tax zone could be different, + # which means a different set of tax rates might be applicable. + @order.create_tax_charge! + Spree::TaxRate.adjust(@order, @order.adjustments.admin) + + @order.updater.update_totals_and_states + end + def order_params params.require(:order).permit( :email,