}
//---------------------------------------------------------------------------------------------
function trans_view($trans)
{
    return get_trans_view_str(ST_PURCHORDER, $trans["order_no"]);
}
function edit_link($row)
{
    if (@$_GET['popup']) {
        return '';
    }
    return pager_link(_("Edit"), "/purchasing/po_entry_items.php?" . SID . "ModifyOrderNumber=" . $row["order_no"], ICON_EDIT);
}
function prt_link($row)
{
    return print_document_link($row['order_no'], _("Print"), true, 18, ICON_PRINT);
}
//---------------------------------------------------------------------------------------------
$sql = get_sql_for_po_search_completed();
$cols = array(_("#") => array('fun' => 'trans_view', 'ord' => ''), _("Reference"), _("Supplier") => array('ord' => ''), _("Location"), _("Supplier's Reference"), _("Order Date") => array('name' => 'ord_date', 'type' => 'date', 'ord' => 'desc'), _("Currency") => array('align' => 'center'), _("Order Total") => 'amount', array('insert' => true, 'fun' => 'edit_link'), array('insert' => true, 'fun' => 'prt_link'));
if (get_post('StockLocation') != $all_items) {
    $cols[_("Location")] = 'skip';
}
//---------------------------------------------------------------------------------------------------
$table =& new_db_pager('orders_tbl', $sql, $cols);
$table->width = "80%";
display_db_pager($table);
if (!@$_GET['popup']) {
    end_form();
    end_page();
}
}
//---------------------------------------------------------------------------------------------
function trans_view($trans)
{
    return get_trans_view_str(ST_PURCHORDER, $trans["order_no"]);
}
function edit_link($row)
{
    if (@$_GET['popup']) {
        return '';
    }
    return pager_link(_("Edit"), "/purchasing/po_entry_items.php?" . SID . "ModifyOrderNumber=" . $row["order_no"], ICON_EDIT);
}
function prt_link($row)
{
    return print_document_link($row['order_no'], _("Print"), true, 18, ICON_PRINT);
}
//---------------------------------------------------------------------------------------------
$sql = get_sql_for_po_search_completed(!@$_GET['popup'] ? $_POST['supplier_id'] : ALL_TEXT);
$cols = array(_("#") => array('fun' => 'trans_view', 'ord' => ''), _("Reference"), _("Supplier") => array('ord' => ''), _("Location"), _("Supplier's Reference"), _("Order Date") => array('name' => 'ord_date', 'type' => 'date', 'ord' => 'desc'), _("Currency") => array('align' => 'center'), _("Order Total") => 'amount', array('insert' => true, 'fun' => 'edit_link'), array('insert' => true, 'fun' => 'prt_link'));
if (get_post('StockLocation') != $all_items) {
    $cols[_("Location")] = 'skip';
}
//---------------------------------------------------------------------------------------------------
$table =& new_db_pager('orders_tbl', $sql, $cols);
$table->width = "80%";
display_db_pager($table);
if (!@$_GET['popup']) {
    end_form();
    end_page();
}