CREATE VIEW [dbo].[TPriceXTaxProductView]
AS
SELECT     ISNULL(SUM(T.PriceOverwrite * (CASE T .Debit WHEN 1 THEN - 1 ELSE 1 END)), 0) AS PriceXTax, T.ProductWareLinkNumber, T.FolioNumber
FROM         dbo.Transactions AS T WITH (NOLOCK) INNER JOIN
                      dbo.Accounts AS A WITH (NOLOCK) ON A.AccountNumber = T.AccountNumber AND A.Balance = 1
GROUP BY T.ProductWareLinkNumber, T.FolioNumber