mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Merge pull request #6724 from Matt-Yorkley/remove-price-adjustments
Delete dead code Spree::Order#price_adjustments
This commit is contained in:
@@ -728,15 +728,7 @@ module Spree
|
||||
end
|
||||
|
||||
def total_tax
|
||||
(adjustments.to_a + price_adjustments.to_a).sum(&:included_tax)
|
||||
end
|
||||
|
||||
def price_adjustments
|
||||
adjustments = []
|
||||
|
||||
line_items.each { |line_item| adjustments.concat line_item.adjustments }
|
||||
|
||||
adjustments
|
||||
(adjustments.to_a + line_item_adjustments.to_a).sum(&:included_tax)
|
||||
end
|
||||
|
||||
def price_adjustment_totals
|
||||
|
||||
@@ -83,8 +83,8 @@ module Spree
|
||||
order.adjustments(:reload)
|
||||
order.line_items(:reload)
|
||||
# TaxRate adjustments (order.adjustments.tax)
|
||||
# and price adjustments (tax included on line items) consist of 100% tax
|
||||
(order.adjustments.tax + order.price_adjustments).each do |adjustment|
|
||||
# and line item adjustments (tax included on line items) consist of 100% tax
|
||||
(order.adjustments.tax + order.line_item_adjustments.reload).each do |adjustment|
|
||||
adjustment.set_absolute_included_tax! adjustment.amount
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
= render :partial => "spree/admin/orders/shipment", :collection => @order.shipments, :locals => { :order => order }
|
||||
|
||||
= render :partial => "spree/admin/orders/_form/adjustments", :locals => { :adjustments => @order.price_adjustments, :title => t(".line_item_adjustments")}
|
||||
= render :partial => "spree/admin/orders/_form/adjustments", :locals => { :adjustments => @order.line_item_adjustments, :title => t(".line_item_adjustments")}
|
||||
= render :partial => "spree/admin/orders/_form/adjustments", :locals => { :adjustments => order_adjustments_for_display(@order), :title => t(".order_adjustments")}
|
||||
|
||||
- if order.line_items.exists?
|
||||
|
||||
@@ -221,7 +221,7 @@ module Spree
|
||||
end
|
||||
|
||||
it "does not crash when order data has been updated previously" do
|
||||
order.price_adjustments.first.destroy
|
||||
order.line_item_adjustments.first.destroy
|
||||
tax_rate.adjust(order)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user