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 = "../..";
14 include_once($path_to_root . "/includes/session.inc");
17 if ($SysPrefs->use_popup_windows)
18 $js .= get_js_open_window(900, 500);
19 page(_($help_context = "View Work Order Issue"), true, false, "", $js);
21 include_once($path_to_root . "/includes/date_functions.inc");
22 include_once($path_to_root . "/includes/data_checks.inc");
24 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
25 include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
27 //-------------------------------------------------------------------------------------------------
29 if ($_GET['trans_no'] != "")
31 $wo_issue_no = $_GET['trans_no'];
34 //-------------------------------------------------------------------------------------------------
36 function display_wo_issue($issue_no)
38 $myrow = get_work_order_issue($issue_no);
41 start_table(TABLESTYLE);
42 $th = array(_("Issue #"), _("Reference"), _("For Work Order #"),
43 _("Item"), _("From Location"), _("To Work Centre"), _("Date of Issue"));
47 label_cell($myrow["issue_no"]);
48 label_cell($myrow["reference"]);
49 label_cell(get_trans_view_str(ST_WORKORDER,$myrow["workorder_id"]));
50 label_cell($myrow["stock_id"] . " - " . $myrow["description"]);
51 label_cell($myrow["location_name"]);
52 label_cell($myrow["WorkCentreName"]);
53 label_cell(sql2date($myrow["issue_date"]));
56 comments_display_row(ST_MANUISSUE, $issue_no);
60 is_voided_display(ST_MANUISSUE, $issue_no, _("This issue has been voided."));
63 //-------------------------------------------------------------------------------------------------
65 function display_wo_issue_details($issue_no)
67 $result = get_work_order_issue_details($issue_no);
69 if (db_num_rows($result) == 0)
71 display_note(_("There are no items for this issue."));
75 start_table(TABLESTYLE);
76 $th = array(_("Component"), _("Quantity"), _("Units"));
81 $k = 0; //row colour counter
85 while ($myrow = db_fetch($result))
88 alt_table_row_color($k);
90 label_cell($myrow["stock_id"] . " - " . $myrow["description"]);
91 qty_cell($myrow["qty_issued"], false, get_qty_dec($myrow["stock_id"]));
92 label_cell($myrow["units"]);
100 }//end of page full new headings if
107 //-------------------------------------------------------------------------------------------------
109 display_heading($systypes_array[ST_MANUISSUE] . " # " . $wo_issue_no);
111 display_wo_issue($wo_issue_no);
113 display_heading2(_("Items for this Issue"));
115 display_wo_issue_details($wo_issue_no);
117 //-------------------------------------------------------------------------------------------------
121 end_page(true, false, false, ST_MANUISSUE, $wo_issue_no);