def get_form_data(self, person, formfields, data, hidden, permitted=False):

        T = current.T

        if person and permitted:
            payments = self.get_payment_data(person.id)
        else:
            payments = []

        date = S3DateTime.datetime_represent(current.request.utcnow,
                                             utc = True,
                                             )

        # Additional form fields for payments
        formfields.extend([Field("details",
                                label = T("Pending Payments"),
                                writable = False,
                                represent = self.payment_data_represent,
                                ),
                           Field("date",
                                 label = T("Payment Date"),
                                 writable = False,
                                 default = date,
                                 ),
                           Field("comments",
                                 label = T("Comments"),
                                 widget = s3_comments_widget,
                                 ),
                           ])

        # Additional data for payments
        data["date"] = s3_str(date)
        data["details"] = payments
        data["comments"] = ""

        # Add payments JSON to hidden form fields, update actionable info
        hidden["actions"] = json.dumps(payments)
        if not payments:
            hidden["actionable"] = "false"

        widget_id = "payment-form"
        submit = current.T("Register")

        return widget_id, submit

    # -------------------------------------------------------------------------
Helper function to extend the form
dataset/ETHPy150Open sahana/eden/modules/s3db/dvr.py/DVRRegisterPayment.get_form_data