DECLARE @OrderHeaderId INT = 827;
DECLARE @OrderType NVARCHAR(50) = 'M Caballero';
DECLARE @OrderColor NVARCHAR(50) = '';
DECLARE @OrderSize NVARCHAR(50) = '';

SELECT
    p.ProductSKU,
    s.SizeName,
    pod.ProductOrdersDetailsQty,
    pod.iProductPrice,
    pod.ProductOrdersDetailsComment,
    ptc.iProductTypeColor,
    c.ColorName,
    pt.ProductType,
    cus.CustomerName,
    poh.ProductOrderHeaderDateTime,
    p.ProductTitle,
    poh.ProductOrderHeaderSent,
    poh.ProductOrderHeaderFinished,
	poh.ProductOrderHeaderNumber
FROM ProductOrdersDetails as pod
LEFT JOIN Products as p ON pod.iProduct = p.iProduct
LEFT JOIN ProductSizes as ps ON pod.iProductSize = ps.iProductSize
LEFT JOIN Sizes as s ON ps.iSize = s.iSize
LEFT JOIN ProductTypeColors as ptc ON pod.iProductTypeColor = ptc.iProductTypeColor
LEFT JOIN Colors as c ON ptc.iColor = c.iColor
LEFT JOIN ProductTypes as pt ON ptc.iProductType = pt.iProductType
LEFT JOIN ProductImages as pi ON pod.iProduct = pi.iProduct
LEFT JOIN ProductOrdersHeaders  as poh ON pod.iProductOrderHeader = poh.iProductOrderHeader
LEFT JOIN Customers as cus ON poh.iCustomer = cus.iCustomer


AQUI PONLE QUE  CUANDO SEA UN ORDERNUMBER SEA IGUAL A 0 que mande el de los demas filtros de color o talla o tipo de ropa