def commit_rheader(r):
    """ Resource Header for Commitments """

    if r.representation == "html":
        record = r.record
        if record and r.name == "commit":

            s3_date_represent = s3base.S3DateTime.date_represent

            tabs = [(T("Edit Details"), None)]
            type = record.type and int(record.type)

            table = r.table
            if type == 1:
                tabs.append((T("Items"), "commit_item"))

                #req_record = db.req_req[record.req_id]
                #req_date = req_record.date
                rheader = DIV(TABLE(TR(TH("%s: " % table.req_id.label),
                                       table.req_id.represent(record.req_id),
                                       ),
                                    TR(TH("%s: " % T("Committing Warehouse")),
                                       s3db.org_site_represent(record.site_id),
                                       TH("%s: " % T("Commit Date")),
                                       s3_date_represent(record.date),
                                       ),
                                    TR(TH("%s: " % table.comments.label),
                                       TD(record.comments or "", _colspan=3)
                                       ),
                                    ),
                                )
                prepare_btn = A(T("Prepare Shipment"),
                                _href = URL(f = "send_commit",
                                            args = [record.id]
                                            ),
                                _id = "send_commit",
                                _class = "action-btn"
                                )

                s3.rfooter = TAG[""](prepare_btn)

#                send_btn = A( T("Send Commitment as Shipment"),
#                              _href = URL(f = "send_commit",
#                                          args = [record.id]
#                                          ),
#                              _id = "send_commit",
#                              _class = "action-btn"
#                              )
#
#                send_btn_confirm = SCRIPT("S3.confirmClick('#send_commit', '%s')" %
#                                          T("Do you want to send these Committed items?") )
#                s3.rfooter = TAG[""](send_btn,send_btn_confirm)
                #rheader.append(send_btn)
                #rheader.append(send_btn_confirm)

            elif type == 3:
                if settings.get_req_commit_people():
                    tabs.append((T("People"), "commit_person"))
                    if auth.s3_has_permission("create", "req_commit_person") and \
                       auth.s3_has_permission("update", "req_commit", r.id):
                        tabs.append((T("Assign"), "assign"))
                else:
                    tabs.append((T("Skills"), "commit_skill"))

                #req_record = db.req_req[record.req_id]
                #req_date = req_record.date
                organisation_represent = s3db.org_organisation_represent
                rheader = DIV(TABLE(TR(TH("%s: " % table.req_id.label),
                                       table.req_id.represent(record.req_id),
                                       ),
                                    TR(TH("%s: " % T("Committing Organization")),
                                       organisation_represent(record.organisation_id),
                                       TH(T("Commit Date") % "%s: "),
                                       s3_date_represent(record.date),
                                       ),
                                    TR(TH("%s: " % table.comments.label),
                                       TD(record.comments, _colspan=3)
                                       ),
                                    ),
                                )
            else:
                # Other (& Assets/Shelter)
                rheader = DIV(TABLE(TR(TH("%s: " % table.req_id.label),
                                       table.req_id.represent(record.req_id),
                                       ),
                                    TR(TH("%s: " % T("Committing Person")),
                                       table.committer_id.represent(record.committer_id),
                                       TH("%s: " % T("Commit Date")),
                                       s3_date_represent(record.date),
                                       ),
                                    TR(TH("%s: " % table.comments.label),
                                       TD(record.comments or "", _colspan=3)
                                       ),
                                    ),
                              )

            rheader_tabs = s3_rheader_tabs(r, tabs)
            rheader.append(rheader_tabs)

            return rheader
    return None

# =============================================================================
dataset/ETHPy150Open sahana/eden/controllers/req.py/commit_rheader/swapped operands of `%`