'Helper function to extract currently pending allowance
payments for the person_id.
@param person_id: the person record ID
@return: a list of dicts [{i: record_id,
d: date,
c: currency,
a: amount,'

def get_payment_data(self, person_id):

    query = (((FS('person_id') == person_id) & (FS('status') == 1)) & (FS('date') <= current.request.utcnow.date()))
    resource = current.s3db.resource('dvr_allowance', filter=query)
    data = resource.select(['id', 'date', 'currency', 'amount'], orderby='dvr_allowance.date', represent=True)
    payments = []
    append = payments.append
    for row in data.rows:
        payment_details = {'r': row['dvr_allowance.id'], 'd': row['dvr_allowance.date'], 'c': row['dvr_allowance.currency'], 'a': row['dvr_allowance.amount']}
        append(payment_details)
    return payments
