X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Finquiry%2Fpo_search.php;h=efd650752943570cc799e37c4fe2154021840b2d;hb=48589f9ce6c51bb25e2fa8ed83c57d9dfa485e44;hp=2cd7223a59635e7bdc654441127a9f83544a469f;hpb=53d942f2a0d20cce5e9c409c6485867ce0869e4d;p=fa-stable.git diff --git a/purchasing/inquiry/po_search.php b/purchasing/inquiry/po_search.php index 2cd7223a..efd65075 100644 --- a/purchasing/inquiry/po_search.php +++ b/purchasing/inquiry/po_search.php @@ -18,9 +18,9 @@ include($path_to_root . "/purchasing/includes/purchasing_ui.inc"); include_once($path_to_root . "/reporting/includes/reporting.inc"); $js = ""; -if ($use_popup_windows) +if ($SysPrefs->use_popup_windows) $js .= get_js_open_window(900, 500); -if ($use_date_picker) +if (user_use_date_picker()) $js .= get_js_date_picker(); page(_($help_context = "Search Outstanding Purchase Orders"), false, false, "", $js); @@ -61,7 +61,7 @@ start_table(TABLESTYLE_NOBORDER); start_row(); ref_cells(_("#:"), 'order_number', '',null, '', true); -date_cells(_("from:"), 'OrdersAfterDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days()); +date_cells(_("from:"), 'OrdersAfterDate', '', null, -user_transaction_days()); date_cells(_("to:"), 'OrdersToDate'); locations_list_cells(_("Location:"), 'StockLocation', null, true); @@ -73,6 +73,8 @@ start_row(); stock_items_list_cells(_("Item:"), 'SelectStockFromList', null, true); +supplier_list_cells(_("Select a supplier: "), 'supplier_id', null, true, true); + submit_cells('SearchOrders', _("Search"),'',_('Select documents'), 'default'); end_row(); end_table(1); @@ -84,13 +86,12 @@ function trans_view($trans) function edit_link($row) { - return pager_link( _("Edit"), - "/purchasing/po_entry_items.php?ModifyOrderNumber=" . $row["order_no"], ICON_EDIT); + return trans_editor_link(ST_PURCHORDER, $row["order_no"]); } function prt_link($row) { - return print_document_link($row['order_no'], _("Print"), true, 18, ICON_PRINT); + return print_document_link($row['order_no'], _("Print"), true, ST_PURCHORDER, ICON_PRINT); } function receive_link($row) @@ -105,23 +106,9 @@ function check_overdue($row) } //--------------------------------------------------------------------------------------------- -if (isset($_POST['order_number']) && ($_POST['order_number'] != "")) -{ - $order_number = $_POST['order_number']; -} - -if (isset($_POST['SelectStockFromList']) && ($_POST['SelectStockFromList'] != "") && - ($_POST['SelectStockFromList'] != $all_items)) -{ - $selected_stock_item = $_POST['SelectStockFromList']; -} -else -{ - unset($selected_stock_item); -} - //figure out the sql required from the inputs available -$sql = get_sql_for_po_search(); +$sql = get_sql_for_po_search(get_post('OrdersAfterDate'), get_post('OrdersToDate'), get_post('supplier_id'), get_post('StockLocation'), + $_POST['order_number'], get_post('SelectStockFromList')); //$result = db_query($sql,"No orders were returned"); @@ -136,11 +123,11 @@ $cols = array( _("Currency") => array('align'=>'center'), _("Order Total") => 'amount', array('insert'=>true, 'fun'=>'edit_link'), - array('insert'=>true, 'fun'=>'prt_link'), - array('insert'=>true, 'fun'=>'receive_link') + array('insert'=>true, 'fun'=>'receive_link'), + array('insert'=>true, 'fun'=>'prt_link') ); -if (get_post('StockLocation') != $all_items) { +if (get_post('StockLocation') != ALL_TEXT) { $cols[_("Location")] = 'skip'; } @@ -153,4 +140,3 @@ display_db_pager($table); end_form(); end_page(); -?>