'Generate a PDF of a GRN (Goods Received Note)'

@staticmethod
def inv_recv_form(r, **attr):

    T = current.T
    db = current.db
    table = db.inv_recv
    track_table = db.inv_track_item
    table.date.readable = True
    table.site_id.readable = True
    track_table.recv_quantity.readable = True
    table.site_id.label = (T('By    %(site)s') % dict(site=T(current.deployment_settings.get_inv_facility_label())))
    table.site_id.represent = current.s3db.org_site_represent
    record = table[r.id]
    recv_ref = record.recv_ref
    list_fields = ['item_id', (T('Weight    (kg)'), 'item_id$weight'), (T('Volume    (m3)'), 'item_id$volume'), 'item_source_no', 'item_pack_id', 'quantity', 'recv_quantity', 'currency', 'pack_value', 'bin']
    from s3.s3export import S3Exporter
    exporter = S3Exporter().pdf
    return exporter(r.resource, request=r, method='list', pdf_title=T(current.deployment_settings.get_inv_recv_form_name()), pdf_filename=recv_ref, list_fields=list_fields, pdf_hide_comments=True, pdf_componentname='track_item', pdf_header_padding=12, pdf_footer=inv_recv_pdf_footer, pdf_table_autogrow='B', pdf_paper_alignment='Landscape', **attr)
