many fixes after test with lots of data
[smr.git] / gui / app / views / cashflow / index.html.erb
blobd05e9d2ddc85daeab9d361d3fa4cb61631ebebe0
1 <h1>Cashflow</h1>
3 <% if @dividend %>
4     <%= form_for @dividend, :url=>{action: :create}, :method=>:POST do |f| %>
5      <fieldset id='dividend'>
6       <legend>New Dividend Payment</legend>
7         <%= f.hidden_field :id %>
8         <%= f.select :id_stock, options_from_collection_for_select(@securities, 'id', 'name'), prompt: '-- Select Security --' %><br/>
9         <%= f.date_field :time, :placeholder=>'Date payment received'  %><br/>
10         <%= f.number_field :received, :placeholder=>'Amount received (per share)', :step=>0.0001, :min=>0.0001 %><br/>
11         <br/>
12         <%= f.submit 'Save Payment Received' %>
13       </div>
14      </fieldset>
15     <% end %>
16 <% end %>
19 <%= form_tag({:action=>'index'}, method: :get) do %>
20     <p>
21      <%= select_tag 'filter', options_for_select(@log.filters, @filter) , prompt: '-- Filter --' %>
22      <%= select_tag 'start_date', options_for_select(@timeframes, @timeframe) , prompt: '-- Time Frame --' %>
23      <%= submit_tag 'Run Report' %>
24     </p>
25 <% end %>
27 <% if not @log.empty? %>
28 <p>Total Cashflow in Report: <em><%= @log.total %></em></p>
30 <h2>Log</h2>
31 <table>
32     <thead>
33     <tr><th>Date</th><th></th><th>Cashflow</th></tr>
34     </thead>
35     <tbody>
36     <% @log.each do |item| %>
37     <tr>
38         <td><%= item.date %></td>
39         <td><%= item.what %> <em><%= item.comment %></em></td>
40         <td><%= item.total %></td>
41     </tr>
42     <% end %> 
43     </tbody>
44 </table>
45 <% end %>