5 <%= form_for @quote, :url=>{action: :create}, :method=>:POST do |f| %>
7 <legend><% if @quote.id %>Update<% else %>Add New<% end %> Quote Data</legend>
8 <%= f.hidden_field :id %>
9 <%= f.select :id_stock, options_from_collection_for_select(@securities, :id, :name, @quote.id), :prompt=>'-- Select Security --' %><br/>
10 <%= date_field_tag :time, @quote.time, :placeholder=>'Date payment received' %><br/>
11 <%= f.number_field :quote, :placeholder=>'Quote Traded', :step=>0.0001 %><br/>
12 <%= f.number_field :low, :placeholder=>'Day Low', :step=>0.0001 %><br/>
13 <%= f.number_field :high, :placeholder=>'Day High', :step=>0.0001 %><br/>
14 <%= f.number_field :volume, :placeholder=>'Volume Traded', :step=>1 %><br/>
15 <%= f.text_field :exchange, :placeholder=>'Exchange' %><br/>
17 <%= f.submit 'Save Quotation' %>
23 <ul id='assets_invested'>
24 <li>Invested: <em><%= smr_humanize(@assets.invested) %></em></li>
25 <li>Market Value: <em><%= smr_humanize(@assets.market_value) %></em></li>
26 <li><%= if @assets.profit_loss>=0 then 'Profit' else 'Loss' end %>: <em><%= smr_humanize(@assets.profit_loss) %> (<%= percentage_change(@assets.invested, @assets.market_value) %>)</em></li>
29 <h2>Open Positions</h2>
43 <% @open_positions.each do |p| %>
46 <%= link_to "+", controller: 'positions', action: 'show', id: p.id %><%=p.stock.name%>
47 <span><%=p.stock.symbol%> <%= link_to 'IR', p.stock.url%></span>
49 <td><%= smr_humanize(p.shares) %></td>
50 <td><%= smr_humanize(p.cost_price) %></td>
51 <td><%= p.last_quote %></td>
52 <td><%= smr_humanize(p.market_value) %></td>
53 <td><%= smr_humanize(p.profit_loss) %> <span><%= percentage_change(p.invested, p.market_value) %></span></td>
54 <td><%= percentage_of(@assets.market_value, p.market_value) %></td>