This is the raw
data (pretty much).
| level |
journal |
total |
ref_num |
sub_account |
stock | lot | buy_date | sell_date | shares | cost | proceeds | gain_loss | invaccount | stlt_account |
st_lt |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 3 |
IS |
2350 |
850 |
Plum Creek | 2 | 1998-01-07 | 2004-10-27 | 531.67 | 758.54 | 226.87 | DLJ Cash Acct | 4201 |
LG | ||
| 3 |
IS |
2355 |
865 |
United Online | 4 | 1999-09-23 | 2003-11-17 | 26.67 | 10.00 | -16.67 | DLJ Cash Acct | 5201 |
LL |
This is the basic format I would like to create perhaps using
Data::Tabular.
| level |
journal |
total |
ref_num |
sub_account |
stock | lot | buy_date | sell_date | shares | cost | proceeds | gain_loss | invaccount | stlt_account |
st_lt |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 3 |
IS |
2350 |
850 |
Plum Creek | 2 | 1998-01-07 | 2004-10-27 | 531.67 | 758.54 | 226.87 | DLJ Cash Acct | 4201 |
LG | ||
| 2 |
IS |
Plum Creek Total | 531.67 | 758.54 | 226.87 | ||||||||||
| 3 |
IS |
2355 |
865 |
United Online | 4 | 1999-09-23 | 2003-11-17 | 26.67 | 10.00 | -16.67 | DLJ Cash Acct | 5201 |
LL | ||
| 2 |
IS |
United Online Total | 26.67 | 10.00 | -16.67 | ||||||||||
| 1 |
IS |
Total |
Total | 558.34 | 768.54 | 210.20 |
| level |
journal |
ref_num |
invaccount | stlt_account |
st_lt | sub_account |
stock | lot | buy_date | sell_date | shares | cost | proceeds | gain_loss |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 5 |
IS |
2350 |
DLJ Cash Acct | 4201 |
LG | 850 |
Plum Creek | 2 | 1998-01-07 | 2004-10-27 | 531.67 | 758.54 | 226.87 | |
| 4 |
IS |
DLJ Cash Acct | 4201 |
LG | 850 |
Plum Creek Total | 531.67 | 758.54 | 226.87 | |||||
| 3 |
IS |
DLJ Cash Acct | 4201 |
LG Total | 531.67 | 758.54 | 226.87 | |||||||
| 5 |
IS |
2355 |
DLJ Cash Acct | 5201 |
LL | 865 |
United Online | 4 | 1999-09-23 | 2003-11-17 | 26.67 | 10.00 | -16.67 | |
| 4 |
IS |
DLJ Cash Acct | 5201 |
LL | 865 |
United Online Total | 26.67 | 10.00 | -16.67 | |||||
| 3 |
IS |
DLJ Cash Acct | 5201 |
LL Total | 26.67 | 10.00 | -16.67 | |||||||
| 2 |
IS |
DLJ Cash Acct Total | 558.34 | 768.54 | 210.20 | |||||||||
| 1 |
IS |
Total | 558.34 | 768.54 | 210.20 |
Ultimately, I need to markup the data with class names based on the
content. That may take hacking Data::Tabular and adding a new
layout type. I need to have the Total lines be triggers to
collapse the sections that they total. So Collapsing the lowest
level in the above table would look like this:
| level |
journal |
ref_num |
invaccount | stlt_account |
st_lt | sub_account |
stock | lot | buy_date | sell_date | shares | cost | proceeds | gain_loss |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 3 |
IS |
DLJ Cash Acct | 4201 |
LG Total | 531.67 | 758.54 | 226.87 | |||||||
| 3 |
IS |
DLJ Cash Acct | 5201 |
LL Total | 26.67 | 10.00 | -16.67 | |||||||
| 2 |
IS |
DLJ Cash Acct Total | 558.34 | 768.54 | 210.20 | |||||||||
| 1 |
IS |
Total | 558.34 | 768.54 | 210.20 |
There is a ton of work to do to get everything to this level and
there's more. I'd like the Green Totals in the above table to
disappear. I need to have the ability to expand/collapse one
section at a time or all sections on the same level at the same
time. I have prototypes
of all of this collapsing stuff in action. My problem is getting
the data from the database or 2d array structures transformed into some
sort of format that I can add collapsing to. It doesn't
have to be the same format as in the prototypes.