mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #7000 from Matt-Yorkley/dead-code-tax-total
DCOTW: Order#tax_total
This commit is contained in:
@@ -183,10 +183,6 @@ module Spree
|
||||
Spree::Money.new(adjustment_total, currency: currency)
|
||||
end
|
||||
|
||||
def display_tax_total
|
||||
Spree::Money.new(tax_total, currency: currency)
|
||||
end
|
||||
|
||||
def display_total
|
||||
Spree::Money.new(total, currency: currency)
|
||||
end
|
||||
@@ -377,10 +373,6 @@ module Spree
|
||||
adjustments.shipping.sum(:amount)
|
||||
end
|
||||
|
||||
def tax_total
|
||||
adjustments.tax.sum(:amount)
|
||||
end
|
||||
|
||||
# Creates new tax charges if there are any applicable rates. If prices already
|
||||
# include taxes then price adjustments are created instead.
|
||||
def create_tax_charge!
|
||||
|
||||
@@ -175,7 +175,7 @@ module Spree
|
||||
order_id: gateway_order_id }
|
||||
|
||||
options.merge!(shipping: order.ship_total * 100,
|
||||
tax: order.tax_total * 100,
|
||||
tax: order.additional_tax_total * 100,
|
||||
subtotal: order.item_total * 100,
|
||||
discount: 0,
|
||||
currency: currency)
|
||||
|
||||
@@ -16,13 +16,6 @@ describe Spree::Order do
|
||||
expect(order.ship_total).to eq 15
|
||||
end
|
||||
end
|
||||
|
||||
context "#tax_total" do
|
||||
it "should return the correct amount" do
|
||||
allow(order).to receive_message_chain :adjustments, tax: adjustments
|
||||
expect(order.tax_total).to eq 15
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "line item adjustments" do
|
||||
|
||||
Reference in New Issue
Block a user