- $sql = "SELECT id, stk_code, unit_price, "
- .TB_PREF."sales_order_details.description,"
- .TB_PREF."sales_order_details.quantity,
- discount_percent,
- qty_sent as qty_done, "
- .TB_PREF."stock_master.units,"
- .TB_PREF."stock_master.mb_flag,"
- .TB_PREF."stock_master.material_cost + "
- .TB_PREF."stock_master.labour_cost + "
- .TB_PREF."stock_master.overhead_cost AS standard_cost
- FROM ".TB_PREF."sales_order_details, ".TB_PREF."stock_master
- WHERE ".TB_PREF."sales_order_details.stk_code = ".TB_PREF."stock_master.stock_id
- AND order_no =" . db_escape($order_no)
- ." AND trans_type = " . db_escape($trans_type) . " ORDER BY id";
+ $sql = "SELECT id, stk_code, unit_price,
+ line.description,
+ line.quantity,
+ discount_percent,
+ qty_sent as qty_done,
+ item.units,
+ item.mb_flag,
+ item.material_cost
+ FROM ".TB_PREF."sales_order_details line,"
+ .TB_PREF."stock_master item
+ WHERE line.stk_code = item.stock_id
+ AND order_no =".db_escape($order_no)
+ ." AND trans_type = ".db_escape($trans_type) . " ORDER BY id";