Merging version 2.1 RC to main trunk.
[fa-stable.git] / manufacturing / inquiry / bom_cost_inquiry.php
1 <?php
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 = 2;
13 $path_to_root="../..";
14 include_once($path_to_root . "/includes/session.inc");
15
16 page(_("Costed Bill Of Material Inquiry"));
17
18 include_once($path_to_root . "/includes/manufacturing.inc");
19 include_once($path_to_root . "/includes/ui.inc");
20 include_once($path_to_root . "/includes/banking.inc");
21 include_once($path_to_root . "/includes/data_checks.inc");
22
23 check_db_has_bom_stock_items(_("There are no manufactured or kit items defined in the system."));
24
25 if (isset($_GET['stock_id']))
26 {
27         $_POST['stock_id'] = $_GET['stock_id'];
28
29
30 start_form(false, true));
31 echo "<center> " . _("Item:") . " ";    
32 stock_bom_items_list('stock_id', $_POST['stock_id'], false, true);
33
34 echo "<hr>";
35
36 if ($_POST['stock_id'] != "")
37 {
38         echo "<center>" . _("All Costs Are In:") . " " . get_company_currency() . "<br><br>";
39         display_bom($_POST['stock_id']);
40
41 else 
42 { //no item entered
43         echo "<p>" ._("Enter an item code above, to view the costed bill of material for.") . "</p>";
44 }       
45 end_form();
46
47 end_page();
48 ?>