Skip to content

Commit

Permalink
Merge pull request #2727 from luisramos0/2-0-shipment-adjustment
Browse files Browse the repository at this point in the history
[Spree Upgrade] Adapt order_decorator.shipments.adjustments to spree 2
  • Loading branch information
sauloperez authored Sep 18, 2018
2 parents 1130bb3 + d685b70 commit e79f7c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/spree/order_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def add_variant(variant, quantity = 1, max_quantity = nil, currency = nil)
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
Expand All @@ -164,7 +164,7 @@ def update_shipping_fees!
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
Expand Down Expand Up @@ -386,7 +386,7 @@ def update_adjustment!(adjustment)
return if adjustment.finalized?
state = adjustment.state
adjustment.state = 'open'
adjustment.update!(self)
adjustment.update!
adjustment.state = state
end

Expand Down

0 comments on commit e79f7c1

Please sign in to comment.