'Get income to date'

def get_year_to_date_balance(self, root_type, fieldname):

    balance = 0.0
    count = 0
    for account in self.get_root_type_accounts(root_type):
        balance += get_balance_on(account, date=self.future_to_date)
        count += get_count_on(account, fieldname, date=self.future_to_date)
    return {u'label': self.meta.get_label((root_type + u'_year_to_date')), u'value': balance, u'count': count}
