Select
sales_order_lines.sales_order_linesid,
sales_order_lines.sales_orderid as doc_no,
sales_order_lines.item_code,
sales_order_lines.name,
sales_order_lines.qty,
sales_order_lines.supplier_ordered_qty as ordered,
stock_items.cost_price_excluding_vat as cost,
sales_order_lines.selling_price_excluding_vat as sell,
sales_order_lines.ordered as ordered,
supplier.company_name as supplier
From
sales_order_lines
Inner Join stock_items ON stock_items.stock_itemsid = sales_order_lines.stock_itemsid
Inner Join supplier ON supplier.supplierid = stock_items.supplierid