- // check if it's an overdue work order
- if (!$myrow["closed"] && date_diff(Today(), sql2date($myrow["required_by"]), "d") > 0)
- {
- start_row("class='overduebg'");
- }
- else
- alt_table_row_color($k);
-
- $modify_page = $path_to_root . "/manufacturing/work_order_entry.php?" . SID . "trans_no=" . $myrow["id"];
- $release_page = $path_to_root . "/manufacturing/work_order_release.php?" . SID . "trans_no=" . $myrow["id"];
- if ($myrow["closed"] == 0)
- {
- $issue = $path_to_root . "/manufacturing/work_order_issue.php?" . SID . "trans_no=" .$myrow["id"];
- $add_finished = $path_to_root . "/manufacturing/work_order_add_finished.php?" . SID . "trans_no=" .$myrow["id"];
- $costs = $path_to_root . "/gl/gl_payment.php?NewPayment=1&PayType=" . payment_person_types::WorkOrder(). "&PayPerson=" .$myrow["id"];
- $can_issue = $myrow["released"];
- $issue_link = $can_issue?("<a href=$issue>" . _("Issue") . "</a></td>
- <td><a href=$add_finished>" . _("Produce") . "</a></td>
- <td><a href=$costs>" . _("Costs") . "</a>"): _("Not Released");
- }
- else
- {
- $issue_link = "";
- }
-
- label_cell(get_trans_view_str(systypes::work_order(), $myrow["id"]));
- label_cell(get_trans_view_str(systypes::work_order(), $myrow["id"], $myrow["wo_ref"]));
- label_cell(wo_types::name($myrow["type"]));
- label_cell($myrow["location_name"]);
- view_stock_status_cell($myrow["stock_id"], $myrow["description"]);
- qty_cell($myrow["units_reqd"]);
- qty_cell($myrow["units_issued"]);
- label_cell(sql2date($myrow["date_"]));
- label_cell(sql2date($myrow["required_by"]));
- label_cell(($myrow["closed"]? _("Yes"):_("No")));
- if ($issue_link != "")
- label_cell($issue_link);
- if ($myrow["released"] == 0)
- {
- label_cell("<a href=$release_page>" . _("Release") . "</a>");
- }
- if ($myrow["closed"] == 0)
- {
- label_cell("<a href=$modify_page>" . _("Edit") . "</a>");
- }
-
- label_cell(get_gl_view_str(systypes::work_order(), $myrow["id"]));
-
- end_row();
-
- $j++;
- If ($j == 12)
- {
- $j = 1;
- table_header($th);
- }
- //end of page full new headings if