def req_item_inv_item():
    """
        Shows the inventory items which match a requested item
        @ToDo: Make this page a component of req_item
    """

    req_item_id  = request.args[0]
    request.args = [] #
    ritable = s3db.req_req_item
    req_item = ritable[req_item_id]
    rtable = s3db.req_req
    req = rtable[req_item.req_id]

    output = {}

    output["title"] = T("Request Stock from Available Warehouse")
    output["req_btn"] = A(T("Return to Request"),
                          _href = URL(c="req", f="req",
                                      args=[req_item.req_id, "req_item"]),
                          _class = "action-btn"
                          )

    output["req_item"] = TABLE(TR(TH( "%s: " % T("Requested By") ),
                                  rtable.site_id.represent(req.site_id),
                                  TH( "%s: " % T("Item")),
                                  ritable.item_id.represent(req_item.item_id),
                                  ),
                               TR(TH( "%s: " % T("Requester") ),
                                  rtable.requester_id.represent(req.requester_id),
                                  TH( "%s: " % T("Quantity")),
                                  req_item.quantity,
                                  ),
                               TR(TH( "%s: " % T("Date Requested") ),
                                  rtable.date.represent(req.date),
                                  TH( T("Quantity Committed")),
                                  req_item.quantity_commit,
                                  ),
                               TR(TH( "%s: " % T("Date Required") ),
                                  rtable.date_required.represent(req.date_required),
                                  TH( "%s: " % T("Quantity in Transit")),
                                  req_item.quantity_transit,
                                  ),
                               TR(TH( "%s: " % T("Priority") ),
                                  rtable.priority.represent(req.priority),
                                  TH( "%s: " % T("Quantity Fulfilled")),
                                  req_item.quantity_fulfil,
                                  )
                               )

    s3.no_sspag = True # pagination won't work with 2 datatables on one page @todo: test

    itable = s3db.inv_inv_item
    # Get list of matching inventory items
    s3.filter = (itable.item_id == req_item.item_id)
    # Tweak CRUD String for this context
    s3.crud_strings["inv_inv_item"].msg_list_empty = T("No Inventories currently have this item in stock")

    inv_items = s3_rest_controller("inv", "inv_item")
    output["items"] = inv_items["items"]

    if settings.get_supply_use_alt_name():
        # Get list of alternative inventory items
        atable = s3db.supply_item_alt
        query = (atable.item_id == req_item.item_id ) & \
                (atable.deleted == False )
        alt_item_rows = db(query).select(atable.alt_item_id)
        alt_item_ids = [alt_item_row.alt_item_id for alt_item_row in alt_item_rows]

        if alt_item_ids:
            s3.filter = (itable.item_id.belongs(alt_item_ids))
            inv_items_alt = s3_rest_controller("inv", "inv_item")
            output["items_alt"] = inv_items_alt["items"]
        else:
            output["items_alt"] = T("No Inventories currently have suitable alternative items in stock")

    response.view = "req/req_item_inv_item.html"
    s3.actions = [dict(url = URL(c = request.controller,
                                 f = "req",
                                 args = [req_item.req_id, "req_item"],
                                 vars = dict(req_item_id = req_item_id,
                                              inv_item_id = "[id]")
                                 ),
                       _class = "action-btn",
                       label = str(T("Request From")),
                       )]

    return output

# =============================================================================
dataset/ETHPy150Open sahana/eden/controllers/req.py/req_item_inv_item/original