Summary in a tabpanel

I have a separate table for sales and payments. For one sale I can have n payments and I display the payments in a tabpanel using the sales_id as a key.
In addition to the different payments of a certain sale, I would like to display the sum of the amounts for that sale. Is that possible? The Trailing Subsummary didn’t work, but maybe I was just doing something wrong…

Actually in the same context I was wondering about the best way to flag all the sales with open amounts (not fully paid yet). Should that be done with a calculation or is a loop better?

Thanks a lot,
Reto

  1. use a trailing grand summary
  2. flagging sales: in the sample solution attached to this post
    I’ve given an example with an unstored calc.
    Using a loop or calc, depends on several things.
    Large dataset? listview or record view?
    is the list frequently called? > consider running a loop once a day

Thanks Maarten!

  1. The Grand Summary works. When I tried ityesterday I didn’t put an aggregate field :oops:! And because I wasn’t sure whether it should work, didn’t keep trying.

  2. Which attached solution? The dataset will not be bigger than a couple of 10’000 records. Probably i should be able to work with a unstored calc. When showing a sale I want to show (e.g. by color coding) if there’s still an open amount. First I wanted to be able to search for open_amount > 0 in my sales table, but I think I try to do it with SQL and join the two tables.

Reto

  1. attached solution> check out "download with paperclip symbol at the bottom of my post (must admit it’s a bit tiny ;) )
  2. using direct SQL statements is indeed faster.

Well, now i found it! It didn’t show on the computer at work, probably for security reasons.
However, I couldn’t install the solution yet, because i’m still on rel 1.2…
I guess, I’m gonna have to upgrade soon.