package queries

const GetProductNewColors = `
SELECT
    CAST(@p1 AS NVARCHAR(30)) AS ProductCode,
    LTRIM(RTRIM(c.ColorCode)) AS ColorCode,
    ISNULL(NULLIF(LTRIM(RTRIM(cd.ColorDescription)), ''), ISNULL(NULLIF(LTRIM(RTRIM(c.ColorHex)), ''), LTRIM(RTRIM(c.ColorCode)))) AS ColorDescription
FROM dbo.cdColor AS c
LEFT JOIN dbo.cdColorDesc AS cd
    ON cd.ColorCode = c.ColorCode
    AND cd.LangCode = 'TR'
WHERE ISNULL(c.IsBlocked, 0) = 0
  AND LEN(LTRIM(RTRIM(ISNULL(c.ColorCode, '')))) = 3
  AND LTRIM(RTRIM(ISNULL(c.ColorCatalogCode1, ''))) = N'ÜRÜN'
ORDER BY LTRIM(RTRIM(c.ColorCode));
`
