diff --git a/app/models/spree_multi_vendor/spree/order_decorator.rb b/app/models/spree_multi_vendor/spree/order_decorator.rb index 73188cf2..fd24404a 100644 --- a/app/models/spree_multi_vendor/spree/order_decorator.rb +++ b/app/models/spree_multi_vendor/spree/order_decorator.rb @@ -22,9 +22,7 @@ def vendor_ship_total(vendor) end def vendor_subtotal(vendor) - vendor_pre_tax_item_amount(vendor) + - vendor_pre_tax_ship_amount(vendor) + - vendor_additional_tax_total(vendor) + vendor_line_items(vendor).sum(&:total) end def vendor_promo_total(vendor) diff --git a/spec/models/spree/order_spec.rb b/spec/models/spree/order_spec.rb index 7e61ae7f..2e688db7 100644 --- a/spec/models/spree/order_spec.rb +++ b/spec/models/spree/order_spec.rb @@ -71,11 +71,11 @@ end describe '#vendor_subtotal' do - it { expect(order.vendor_subtotal(vendor)).to eq(320) } + it { expect(order.vendor_subtotal(vendor)).to eq(270) } end describe '#display_subtotal' do - it { expect(order.display_vendor_subtotal(vendor).to_s).to eq('$320.00') } + it { expect(order.display_vendor_subtotal(vendor).to_s).to eq('$270.00') } end describe '#vendor_pre_tax_item_amount' do diff --git a/spec/serializers/spree/v2/storefront/vendor_order_totals_serializer_spec.rb b/spec/serializers/spree/v2/storefront/vendor_order_totals_serializer_spec.rb index 4860fdc1..7ea78c0c 100644 --- a/spec/serializers/spree/v2/storefront/vendor_order_totals_serializer_spec.rb +++ b/spec/serializers/spree/v2/storefront/vendor_order_totals_serializer_spec.rb @@ -31,8 +31,8 @@ display_included_tax_total: Spree::Money.new(30), ship_total: BigDecimal(25), display_ship_total: Spree::Money.new(25), - subtotal: BigDecimal(680), - display_subtotal: Spree::Money.new(680), + subtotal: BigDecimal(600), + display_subtotal: Spree::Money.new(600), promo_total: BigDecimal(60), display_promo_total: Spree::Money.new(60), total: BigDecimal(625),