Skip to content

Commit

Permalink
Update show.html.haml
Browse files Browse the repository at this point in the history
show order sums without  and with stock order, consider only sums without stock order for total
  • Loading branch information
mjavurek authored Nov 10, 2024
1 parent e228570 commit c0654c2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/views/finance/invoices/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@
%dt= heading_helper(Invoice, :orders) + ':'
%dd><
- @invoice.orders.order(:ends).each_with_index do |order, index|
- sum_og = order.sum(:groups)
- sum = order.sum
- transport = order.transport || 0
- total += sum + transport
- total += sum_og + transport
= ', ' if index > 0
= link_to format_date(order.ends), new_finance_order_path(order_id: order)
= ' (' + number_to_currency(sum)
= ' (' + number_to_currency(sum_og)
- if sum_og < sum
= ' / ' + number_to_currency(sum)
- if transport != 0
= ' + ' + number_to_currency(transport)
= ')'
Expand Down

0 comments on commit c0654c2

Please sign in to comment.