Revert "Add line item included_tax_amount method to multiply by quantity"

This reverts commit 547fcf49e0.
This commit is contained in:
Rob Harrington
2016-05-20 09:46:31 +10:00
parent d043de08cd
commit 6a3f6e7bfa
3 changed files with 3 additions and 21 deletions

View File

@@ -56,6 +56,6 @@ class ProducerMailer < Spree::BaseMailer
end
def tax_total_from_line_items(aggregated_line_items)
Spree::Money.new aggregated_line_items.values.map(&:included_tax_amount).sum
Spree::Money.new aggregated_line_items.values.map(&:included_tax).sum
end
end

View File

@@ -52,15 +52,10 @@ Spree::LineItem.class_eval do
adjustments.included_tax.any?
end
# Single
def included_tax
adjustments.included_tax.sum(&:included_tax)
end
def included_tax_amount
included_tax * quantity
end
def price_with_adjustments
# EnterpriseFee#create_locked_adjustment applies adjustments on line items to their parent order,
# so line_item.adjustments returns an empty array
@@ -82,12 +77,8 @@ Spree::LineItem.class_eval do
Spree::Money.new(amount_with_adjustments, { :currency => currency })
end
def display_included_tax_amount
Spree::Money.new(included_tax_amount, { :currency => currency })
end
def display_amount_without_tax
Spree::Money.new(amount_with_adjustments - included_tax_amount, { currency: currency })
def display_included_tax
Spree::Money.new(included_tax, { :currency => currency })
end
def display_name

View File

@@ -124,15 +124,6 @@ module Spree
expect(li_no_tax.included_tax).to eq 0.00
end
end
context "scaling included tax by quantity" do
it "multiplies included_tax" do
li_tax.quantity = 3
li_tax.save
expect(li_tax.included_tax).to eq 10.00
expect(li_tax.included_tax_amount).to eq 30.00
end
end
end
describe "unit value/description" do