2 /**********************************************************************
3 Copyright (C) FrontAccounting, LLC.
4 Released under the terms of the GNU General Public License, GPL,
5 as published by the Free Software Foundation, either version 3
6 of the License, or (at your option) any later version.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12 $path_to_root = "../..";
14 include_once($path_to_root . "/includes/db_pager.inc");
15 include_once($path_to_root . "/includes/session.inc");
16 include_once($path_to_root . "/sales/includes/sales_ui.inc");
17 include_once($path_to_root . "/reporting/includes/reporting.inc");
18 $page_security = 'SA_ORDERLINEX_EDIT';
19 add_access_extensions();
21 $_POST['order_view_mode'] = "Quotations";
22 $_SESSION['page_title'] = _($help_context = "Edit lines extra parameters");
27 if ($use_popup_windows)
28 $js .= get_js_open_window(900, 600);
30 $js .= get_js_date_picker();
31 page($_SESSION['page_title'], false, false, "", $js);
34 if (isset($_GET['selected_customer']))
36 $selected_customer = $_GET['selected_customer'];
38 elseif (isset($_POST['selected_customer']))
40 $selected_customer = $_POST['selected_customer'];
43 $selected_customer = -1;
45 //---------------------------------------------------------------------------------------------
47 if (isset($_POST['SelectStockFromList']) && ($_POST['SelectStockFromList'] != "") &&
48 ($_POST['SelectStockFromList'] != ALL_TEXT))
50 $selected_stock_item = $_POST['SelectStockFromList'];
54 unset($selected_stock_item);
61 start_table(TABLESTYLE_NOBORDER);
63 ref_cells(_("#:"), 'OrderNumber', '',null, '', true);
64 ref_cells(_("Ref"), 'OrderReference', '',null, '', true);
65 locations_list_cells(_("Location:"), 'StockLocation', null, true);
67 stock_items_list_cells(_("Item:"), 'SelectStockFromList', null, true);
69 customer_list_cells(_("Select a customer: "), 'customer_id', null, true);
71 submit_cells('SearchOrders', _("Search"),'',_('Select documents'), 'default');
72 hidden('order_view_mode', $_POST['order_view_mode']);
77 //---------------------------------------------------------------------------------------------
78 // Orders inquiry table
80 $trans_type = ST_SALESORDER;
81 $sql = get_sql_for_sales_orders_view($selected_customer, $trans_type, $_POST['OrderNumber'], 'OutstandingOnly',
82 @$selected_stock_item, @$_POST['OrdersAfterDate'], @$_POST['OrdersToDate'], @$_POST['OrderReference'], $_POST['StockLocation'], $_POST['customer_id']);
85 _("Order #") => array('fun'=>'view_link'),
90 _("Order Date") => 'date',
91 _("Required By") =>array('type'=>'date', 'ord'=>''),
93 _("Order Total") => array('type'=>'amount', 'ord'=>''),
95 _("Currency") => array('align'=>'center')
99 $table =& new_db_pager('orders_tbl', $sql, $cols);
101 $table->width = "80%";
103 display_db_pager($table);
104 submit_center('Update', _("Update"), true, '', null);
106 if (!@$_GET['popup'])