implemented Cash positions
[smr.git] / gui / app / views / cashflow / index.html.erb
blob5d70bc0a7c4ba890461cb21ab7ccaef4d320cba8
1 <h1>Cashflow</h1>
3 <% if @dividend %>
4     <%= render :partial=>'dividend_form', locals: {
5             :dividend=>@dividend,
6             :securities=>@securities
7     } %>
8 <% end %>
11 <%= form_tag({:action=>'index'}, method: :get) do %>
12     <p>
13      <%= select_tag 'filter', options_for_select(@log.filters, @filter) , prompt: '-- Filter --' %>
14      <%= select_tag 'start_date', options_for_select(@timeframes, @timeframe) , prompt: '-- Time Frame --' %>
15      <%= submit_tag 'Run Report' %>
16     </p>
17 <% end %>
19 <% if not @log.empty? %>
20 <p>Total Cashflow in Report: <em><%= smr_humanize(@log.total) %></em></p>
22 <h2>Log</h2>
23 <table id='cashflow'>
24     <thead>
25     <tr><th>Date</th><th></th><th>Cashflow</th></tr>
26     </thead>
27     <tbody>
28     <% @log.each do |item| %>
29     <tr class="separaterows">
30         <td><%= smr_humanize(item.date) %></td>
31         <td><%= item.what %> <span class="comment_text"><%= item.comment %></span></td>
32         <td><%= smr_humanize(item.total) %></td>
33     </tr>
34     <% end %> 
35     </tbody>
36 </table>
37 <% else %>
38    <p>No Cashflow since <%= Time.at(@timeframe).strftime('%B %%s, %Y') % Time.at(@timeframe).strftime('%d').to_i.ordinalize %>.</p>
39 <% end %>