diff --git a/app/models/spree/order.rb b/app/models/spree/order.rb index 67018d85cf..bf15a455a6 100644 --- a/app/models/spree/order.rb +++ b/app/models/spree/order.rb @@ -684,7 +684,7 @@ module Spree end def shipping_tax - adjustments(:reload).shipping.sum(:included_tax) + shipment_adjustments(:reload).shipping.sum(:included_tax) end def enterprise_fee_tax @@ -692,7 +692,7 @@ module Spree end def total_tax - (adjustments.to_a + line_item_adjustments.to_a).sum(&:included_tax) + (adjustments.to_a + shipment_adjustments.to_a + line_item_adjustments.to_a).sum(&:included_tax) end def has_taxes_included diff --git a/spec/models/spree/order_spec.rb b/spec/models/spree/order_spec.rb index c886d5677d..6c96d09792 100644 --- a/spec/models/spree/order_spec.rb +++ b/spec/models/spree/order_spec.rb @@ -1088,7 +1088,8 @@ describe Spree::Order do Spree::Config.shipping_tax_rate = 0.25 # Sanity check the fees - expect(order.adjustments.length).to eq 2 + expect(order.adjustments.length).to eq 1 + expect(order.shipment_adjustments.length).to eq 1 expect(item_num).to eq 2 expect(order.adjustment_total).to eq expected_fees expect(order.shipment.adjustment.included_tax).to eq 1.2 @@ -1105,7 +1106,7 @@ describe Spree::Order do context "when finalized fee adjustments exist on the order" do let(:payment_fee_adjustment) { order.adjustments.payment_fee.first } - let(:shipping_fee_adjustment) { order.adjustments.shipping.first } + let(:shipping_fee_adjustment) { order.shipment_adjustments.first } before do payment_fee_adjustment.finalize!