Skip to content

Commit

Permalink
Update order.rb
Browse files Browse the repository at this point in the history
added order sum over group order transport charges. this can be different form the order's transport amount if groups are not charged with transport costs or if stock orders exist.
  • Loading branch information
mjavurek authored Nov 13, 2024
1 parent 25b43b4 commit a66c4b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ def sum(type = :gross)
end
end
end
elsif type == :transport
total = group_orders.where.not(ordergroup: nil).sum(:transport)
end
total
end
Expand Down

0 comments on commit a66c4b4

Please sign in to comment.