I have a simplified query like this
SELECT a.OrderInfoID, a.SalesReceiptID, SUM(b.Qty) AS Qty FROM dbo.OrderInfo a (NOLOCK) INNER JOIN dbo.OrderInfoSequential