You cannot use CASE like it was a control flow statement. It's a complex function that returns a value. You can then compare the value to something else. In your case it would be better to drop the CASE entirely and use simple AND/OR to specify the condition:
WHERE (@InvCode IS NULL OR SD.[InvCode] = @InvCode)
AND (@InvCode IS NOT NULL OR SI.[Status] IN (1,2))
I believe this is much more readable than the CASE.