Query report to merge pending sales order and production order

Hi Guys ,

I thought of merging pending sales order and production order to find the status of pending orders . The below query displays data till production order , now I am not able to link stock entry with the sales order as this does not have anything in common . Is there a way to link stock entry in the query so I could have a track of quantity transferred and manufactured in the pending sales order

 `tabSales Order`.`name` as "Sales Order:Link/Sales Order:120",
 `tabSales Order`.`customer` as "Customer:Link/Customer:120",
 `tabSales Order`.`po_no` as "PO No:Data",
`tabSales Order`.`po_date` as "PO Date:Date", 
 `tabSales Order Item`.item_code as "Item:Link/Item:120",
 `tabSales Order Item`.item_name as "Item Name::150",
`tabProduct master`.`dieno` as "Die no:Data",
`tabProduct master`.`grade` as "Grade:Link/Grade",
 `tabSales Order Item`.qty as "Qty:Float:140",
 `tabSales Order Item`.delivered_qty as "Delivered Qty:Float:140",
 (`tabSales Order Item`.qty - ifnull(`tabSales Order Item`.delivered_qty, 0)) as "Qty to Deliver:Float:140",
`tabProduction Order`.name as "Prod:Data:120",
`tabProduction Order`.qty as "To manuf:Data:120",
`tabProduction Order`.produced_qty as "Cut:Data:120",
 `tabSales Order Item`.base_rate as "Rate:Float:140",
 `tabSales Order Item`.base_amount as "Amount:Float:140",
 ((`tabSales Order Item`.qty - ifnull(`tabSales Order Item`.delivered_qty, 0))*`tabSales Order Item`.base_rate) as "Amount to Deliver:Float:140",
 `tabBin`.actual_qty as "Available Qty:Float:120",
 `tabSales Order`.`delivery_date` as "Expected Delivery Date:Date:120",
`tabSales Order Item`.date as "Del Date:Date:150",
 `tabSales Order Item`.warehouse as "Warehouse:Link/Warehouse:200",
DATEDIFF(CURDATE(),po_date) as "No of days",
`tabStock Entry`.name as "Stock Entry:Link/Stock Entry:80"

 `tabSales Order` JOIN `tabSales Order Item` 
 LEFT JOIN `tabBin` ON (`tabBin`.item_code = `tabSales Order Item`.item_code
 and `tabBin`.warehouse = `tabSales Order Item`.warehouse)
LEFT JOIN `tabProduct master` ON `tabProduct master`.part_no = `tabSales Order Item`.item_code
LEFT JOIN `tabProduction Order` ON (`tabSales Order Item`.`item_code` = `tabProduction Order`.`production_item` and `tabSales Order`.`name` = `tabProduction Order`.`sales_order` and `tabProduction Order`.status not in ("Draft", "Cancelled"))
LEFT JOIN `tabStock Entry` ON `tabStock Entry`.`production_order` = `tabProduction Order`.`production_item`

 `tabSales Order Item`.`parent` = `tabSales Order`.`name`
 and `tabSales Order`.docstatus = 1 
and `tabProduct master`.part_no = `tabSales Order Item`.item_code
 and `tabSales Order`.status not in ("Stopped", "Closed")
 and ifnull(`tabSales Order Item`.delivered_qty,0) < ifnull(`tabSales Order Item`.qty,0)
order by `tabSales Order`.transaction_date asc