function get_wo_costing($workorder_id)
{
- $sql="SELECT * FROM ".TB_PREF."wo_costing WHERE workorder_id=".db_escape($workorder_id);
+ $sql="SELECT *
+ FROM ".TB_PREF."wo_costing cost,
+ ".TB_PREF."journal gl
+ WHERE
+ cost.trans_type=gl.type AND cost.trans_no=gl.trans_no
+ AND workorder_id=".db_escape($workorder_id);
return db_query($sql, "could not get work order costing");
}
function get_additional_issues($woid)
{
- $sql = "SELECT issue.*, item.*
+ $sql = "SELECT issue.*, item.*, stock.mb_flag
FROM ".TB_PREF."wo_issues issue, "
.TB_PREF."wo_issue_items item
+ LEFT JOIN ".TB_PREF."stock_master stock ON stock.stock_id=item.stock_id
WHERE issue.issue_no=item.issue_id
AND issue.workorder_id=".db_escape($woid)
." ORDER BY item.id";
{
global $path_to_root, $wo_cost_types;
- $result = get_gl_wo_cost_trans($woid);
+ $result = get_wo_costing($woid);
if (db_num_rows($result) == 0)
{
table_header($th);
- $k = 0; //row colour counter
-
+ $k = 0;
while ($myrow = db_fetch($result))
{
-
alt_table_row_color($k);
- label_cell(get_gl_view_str( $myrow["type"], $myrow["type_no"], $myrow["type_no"]));
+ label_cell(get_gl_view_str( $myrow["trans_type"], $myrow["trans_no"], $myrow["trans_no"]));
label_cell($wo_cost_types[$myrow['cost_type']]);
$date = sql2date($myrow["tran_date"]);
label_cell($date);