Skip to content

Commit

Permalink
added diff column to report 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Marwen Blel committed Dec 23, 2011
1 parent 6b515e1 commit ac9bc1c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions app/views/payment_runs/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,14 @@ end

<%

def footer
def footer(diff)
%>
<tr>
<th colspan='11'>
<th><%= t(:diff, :scope => :reports )%></th>
<th colspan='9'>
<%= diff %>
</th>
<th>
<span class='amount'></span>
</th>
<th>
Expand All @@ -192,14 +196,13 @@ end
ledger = nil



diff = 0

@ops.each do
|op|


if ledger != op.ledger and ledger != nil then
footer
footer(diff)
end

if ledger != op.ledger then
Expand Down Expand Up @@ -258,7 +261,7 @@ end
<td class='number'>
<%= num_format(op.amount > 0 ? op.amount : "") %>
</td>

<% diff += op.amount %>
<td class='number'>
<%= op.amount < 0 ? op.amount : "" %>
</td>
Expand Down Expand Up @@ -289,7 +292,7 @@ end

end

if ledger != nil then footer end
if ledger != nil then footer(diff) end

%>

Expand Down

0 comments on commit ac9bc1c

Please sign in to comment.