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_MANUFTRANSVIEW';
13 $path_to_root = "../..";
15 include_once($path_to_root . "/includes/session.inc");
18 if ($use_popup_windows)
19 $js .= get_js_open_window(900, 500);
20 page(_($help_context = "View Work Order Costs"), true, false, "", $js);
22 include_once($path_to_root . "/includes/date_functions.inc");
23 include_once($path_to_root . "/includes/manufacturing.inc");
24 include_once($path_to_root . "/includes/data_checks.inc");
26 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
27 include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
29 //-------------------------------------------------------------------------------------------------
31 if ($_GET['trans_no'] != "")
33 $wo_id = $_GET['trans_no'];
36 //-------------------------------------------------------------------------------------------------
38 function display_wo_costs($prod_id)
40 global $wo_cost_types;
42 $costs = get_gl_wo_cost_trans($prod_id);
45 start_table(TABLESTYLE);
46 $th = array(_("Date"), _("Type"), _("Amount"), _("Memo"), '');
48 while($myrow = db_fetch($costs)) {
50 label_cell(sql2date($myrow["tran_date"]));
51 label_cell($wo_cost_types[$myrow["cost_type"]]);
52 amount_cell(-$myrow['amount']);
53 label_cell($myrow['memo_']);
54 label_cell(get_trans_view_str($myrow['trans_type'],$myrow["trans_no"]));
60 //-------------------------------------------------------------------------------------------------
62 display_heading(sprintf(_("Production Costs for Work Order # %d"), $wo_id));
64 display_wo_costs($wo_id);
66 //-------------------------------------------------------------------------------------------------
70 end_page(true, false, false, ST_WORKORDER, $wo_id);