In order_decorator.update_shipping_fees! and order_decorator.update_payment_fees!, only update adjustment if it exists

This commit is contained in:
luisramos0
2018-09-14 16:33:32 +01:00
parent 6b3fd22db8
commit d685b706ad

View File

@@ -153,7 +153,7 @@ Spree::Order.class_eval do
def update_shipping_fees!
shipments.each do |shipment|
next if shipment.shipped?
update_adjustment! shipment.adjustment
update_adjustment! shipment.adjustment if shipment.adjustment
shipment.save # updates included tax
end
end
@@ -164,7 +164,7 @@ Spree::Order.class_eval do
def update_payment_fees!
payments.each do |payment|
next if payment.completed?
update_adjustment! payment.adjustment
update_adjustment! payment.adjustment if payment.adjustment
payment.save
end
end