[0004212] Work Order Entry: fixed error when voided WO refence is reused.
[fa-stable.git] / manufacturing / view / wo_production_view.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 = 'SA_MANUFTRANSVIEW';
13 $path_to_root = "../..";
14
15 include_once($path_to_root . "/includes/session.inc");
16
17 $js = "";
18 if ($SysPrefs->use_popup_windows)
19         $js .= get_js_open_window(900, 500);
20 page(_($help_context = "View Work Order Production"), true, false, "", $js);
21
22 include_once($path_to_root . "/includes/date_functions.inc");
23 include_once($path_to_root . "/includes/data_checks.inc");
24
25 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
26 include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
27
28 //-------------------------------------------------------------------------------------------------
29
30 if ($_GET['trans_no'] != "")
31 {
32         $wo_production = $_GET['trans_no'];
33 }
34
35 //-------------------------------------------------------------------------------------------------
36
37 function display_wo_production($prod_id)
38 {
39     $myrow = get_work_order_produce($prod_id);
40
41         br(1);
42     start_table(TABLESTYLE);
43     $th = array(_("Production #"), _("Reference"), _("For Work Order #"),
44         _("Item"), _("Quantity Manufactured"), _("Date"));
45     table_header($th);
46
47         start_row();
48         label_cell($myrow["id"]);
49         label_cell($myrow["reference"]);
50         label_cell(get_trans_view_str(ST_WORKORDER,$myrow["workorder_id"]));
51         label_cell($myrow["stock_id"] . " - " . $myrow["StockDescription"]);
52         qty_cell($myrow["quantity"], false, get_qty_dec($myrow["stock_id"]));
53         label_cell(sql2date($myrow["date_"]));
54         end_row();
55
56     comments_display_row(ST_MANURECEIVE, $prod_id);
57
58         end_table(1);
59
60         is_voided_display(ST_MANURECEIVE, $prod_id, _("This production has been voided."));
61 }
62
63 //-------------------------------------------------------------------------------------------------
64
65 display_heading($systypes_array[ST_MANURECEIVE] . " # " . $wo_production);
66
67 display_wo_production($wo_production);
68
69 //-------------------------------------------------------------------------------------------------
70
71 br(2);
72
73 end_page(true, false, false, ST_MANURECEIVE, $wo_production);
74