Skip to content

Commit

Permalink
Update invoice.rb: calculate expected_amount also if invoice has no o…
Browse files Browse the repository at this point in the history
…rders

if an invoice has only deliveries but nor orders, expected amount returned the invoice net-amount but not the deliveries. if an invoice has no orders and deliveries, expected_amount is now 0.
  • Loading branch information
mjavurek authored Nov 17, 2024
1 parent cc21da8 commit d2198f6
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions app/models/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ def deliveries_sum(type = :without_markup)
end

def expected_amount(type = :without_markup)
return net_amount unless orders.any?

orders_sum(type) + orders_transport_sum + deliveries_sum(type)
end

Expand Down

0 comments on commit d2198f6

Please sign in to comment.