'Return a list and a Decimal.'

def get_giving_for_profile(self):

    GIVING = u'\n                                                SELECT    *    FROM    (\n                                                                SELECT    DISTINCT    ON    (pi.team_id)\n                                                                                            t.slug    AS    team_slug\n                                                                                    ,    pi.amount\n                                                                                    ,    pi.due\n                                                                                    ,    pi.ctime\n                                                                                    ,    pi.mtime\n                                                                                    ,    t.name            AS    team_name\n                                                                        FROM    payment_instructions    pi\n                                                                        JOIN    teams    t    ON    pi.team_id    =    t.id\n                                                                    WHERE    participant_id    =    %s\n                                                                            AND    t.is_approved    is    true\n                                                                            AND    t.is_closed    is    not    true\n                                                        ORDER    BY    pi.team_id\n                                                                                    ,    pi.mtime    DESC\n                                                )    AS    foo\n                                                ORDER    BY    amount    DESC\n                                                                            ,    team_slug\n\n                                '
    giving = self.db.all(GIVING, (self.id,))
    totals = {u'amount': (sum([rec.amount for rec in giving]) or Decimal(u'0.00')), u'due': (sum([rec.due for rec in giving]) or Decimal(u'0.00'))}
    return (giving, totals)
