SELECT 
  o.OrderDate, 
  o.OrderID, 
  o.LastModified, 
  o.LastModBy, 
  o.OrderStatus, 
  o.Order_Entry_System, 
  o.ShipDate, 
  o.PaymentAmount, 
  o.Total_Payment_Authorized, 
  o.Total_Payment_Received, 
  o.CustomerID, 
  o.Printed, 
  o.Shipped, 
  o.CreditCardAuthorizationDate, 
  o.PaymentDeclined, 
  o.SalesRep_CustomerID, 
  o.Custom_Field_CATStatus, 
  o.Custom_Field_CATReason, 
  o.Custom_Field_CATDepartment 
FROM 
  orders o 
  LEFT OUTER JOIN fraudinsightdetails AS Fraud ON Fraud.OrderID = o.OrderID 
  LEFT JOIN (
    SELECT 
      OrderID, 
      Sum(Quantity) As Quantity, 
      Sum(QtyOnBackOrder) As QtyOnBackOrder, 
      Sum(QtyOnHold) As QtyOnHold, 
      Sum(QtyShipped) As QtyShipped 
    FROM 
      orderdetails 
    GROUP BY 
      OrderID
  ) orderdetails ON o.OrderID = orderdetails.OrderID 
WHERE 
  o.PaymentAmount <> o.Total_Payment_Received 
  AND o.OrderStatus <> 'Cancelled' 
  AND o.OrderDate < DATE_SUB(NOW(), INTERVAL 30 MINUTE)
ORDER BY 
  o.OrderDate DESC