Portfolio

LastUpdated: $Id: Portfolio.html,v 1.2 2003/03/20 22:08:15 moreejt Exp $

The portfolio screen will look something like this. These are the only two cases of searching that we will implement by account then stock or by stock ignoring account.

- Account1

- Stock 1

      Lot 1 Date* Shares

      Lot 2 Date Shares

      Lot 3 Date Shares

      Stock 1 Total       Shares Price Cost MktVal

+ Stock 2             Shares Price Cost MktVal

Account 1 Total                Cost MktVal Gain/loss

+ Account 2 Total                Cost MktVal Gain/loss

+ Account 3 Total                Cost MktVal Gain/loss


Totals                          Cost MktVal Gain/Loss


or


+ Stock 1      Shares Cost Price MktVal

- Stock 2

    Lot 1 Date Shares

    Lot 2 Date Shares

   Stock 2 Total Shares Cost Price MktVal

Total Cost MkVal Gain/Loss


looking to rewrite this screen to be simpler to deal with and maybe remove the need to store an object on the back end and resubmitting for each view. This requires that we pull all the data down. A query like this might work:
SELECT acct, sub_acct, lot, stock_price('ticker'), .... market_value UNION
SELECT acct, sub_acct, (SELECT MAX(lot_num) + 1), stock_price('ticker'), .... sum(market_value) UNION

order by acct, ident, lot; SELECT acct, sub_acct, lot, 'lot' AS ident, stock_price('ticker'), .... UNION
SELECT acct, sub_acct, '99999999999' AS lot, 'stockSubTotal' AS ident, stock_price('ticker'), .... UNION
--SELECT 'zacct' AS acct, 'zsub_acct' AS sub_acct, 'zlot' AS lot, 'zGrandTotal' AS ident, stock_price('ticker'), .... sum(market_value) UNION
order by acct, ident, lot;


Copyright (c) 2001 HLR
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1; A copy of the license is available at http://www.gnu.org/licenses/licenses.html#FDL.

Updated: $Id: Portfolio.html,v 1.2 2003/03/20 22:08:15 moreejt Exp $