4 <% if @organization %><em>of <%=@organization %></em>
5 <% elsif @security %><em>of <%=@security %></em><% end %>
8 <% unless @organization || @security %>
9 Access this via URL to Security or Organization.
13 render :partial=>'smart_links',
15 :item_to_portrait=>(@security ? @security : @organization),
16 :shown_is=>(@security ? :security : :organization),
22 render :partial=>'overview_security', :locals=>{ :security=>@security }
24 render :partial=>'overview_organization', :locals=>{ :organization=>@organization }
28 <% unless @positions.blank? %>
31 <div id='portrait_positions_summary' class="overview_counters">
33 <li class="<%= smr_profitloss_status @open_positions_gain, :css=>true %>">Open Positions Gain: <em><%= smr_humanize @open_positions_gain, :shortword=>true %></em></li>
34 <li>Total Gain: <em><%= smr_humanize @all_positions_gain, :shortword=>true %></em></li>
35 <li>Total Dividend: <em><%= smr_humanize @all_positions_dividend %></em></li>
39 <table id='portrait_positions'>
44 <th>Average Cost<span>per share</span></th>
45 <th><% if @security %>Size<% else %>Last Trade<% end %></th>
46 <th>Profit / Loss</th>
47 <th>Dividend / Interest</th>
51 <% @positions.each do |p| %>
52 <tr class="separaterows">
54 <%= link_to '+', p.link.to_url %>
55 <% if @organization %>
58 <%= p.is_closed? ? smr_humanize(p.time_closed) : '%s shares' % p.shares %>
60 <% if not p.comment.blank? %><span class="comment_text"><%= 'at %s:' % p.portfolio if p.is_cash_position? %> <%= p.comment %></span><% end %>
62 <td><span><%= p.status %></span> held at <%= p.portfolio %></td>
63 <td><%= smr_humanize p.cost_price %></td>
64 <td><%= if @security then
65 smr_humanize( (p.is_closed? ? p.settled_volume : p.market_value ), :shortword=>true)
66 else p.last_quote.last end %>
68 <td class="<%= smr_profitloss_status p.profit_loss, :css=>true %>">
69 <%= smr_humanize p.profit_loss %>
72 <%= smr_humanize p.dividend.received %>
80 <% unless @cashflow.blank? %>
81 <h2>Upcoming Cashflows</h2>
83 <div id='portrait_cashflow_summary' class="overview_counters">
85 <li class="profit">Total: <em><%= smr_humanize @cashflow.total, :shortword=>true %></em></li>
86 <li>Number of Payments: <em><%= @cashflow.count %></em></li>
91 <table id='portrait_cashflow'>
95 <% if @organization %>
99 <th colspan="2">Amount</th>
103 <% if @organization %>
112 <% @cashflow.each do |i|
113 s = Security.find i.link.destination
114 scale = s.has_type_model? ? s.get_type.shares : 0
116 <tr class="separaterows">
117 <td><%= smr_humanize i.date %></td>
118 <% if @organization %>
119 <td><%= s %><%= link_to '...', i.link.to_url %></td>
121 <td><%= i.describe_type %></td>
122 <td><%= smr_humanize i.total, :shortword=>true %></td>
123 <td><%= smr_humanize i.total * scale, :shortword=>true %></td>