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 $page_security = 'SA_WORKORDERANALYTIC';
13 $path_to_root = "../..";
14 include($path_to_root . "/includes/db_pager.inc");
15 include($path_to_root . "/includes/session.inc");
17 page(_($help_context = "Inventory Item Where Used Inquiry"));
19 include($path_to_root . "/includes/ui.inc");
21 check_db_has_stock_items(_("There are no items defined in the system."));
23 start_form(false, true);
25 if (!isset($_POST['stock_id']))
26 $_POST['stock_id'] = get_global_stock_item();
28 echo "<center>" . _("Select an item to display its parent item(s).") . " ";
29 echo stock_items_list('stock_id', $_POST['stock_id'], false, true);
32 set_global_stock_item($_POST['stock_id']);
33 //-----------------------------------------------------------------------------
34 function select_link($row)
36 return pager_link( $row["parent"]. " - " . $row["description"],
37 "/manufacturing/manage/bom_edit.php?stock_id=" . $row["parent"]);
40 $sql = get_sql_for_where_used(get_post('stock_id'));
43 _("Parent Item") => array('fun'=>'select_link'),
46 _("Quantity Required")
49 $table =& new_db_pager('usage_table', $sql, $cols);
51 $table->width = "80%";
52 display_db_pager($table);