Can you clarify your logic
For example:
If, Brand = 'BK' and customer code = '5123' (starts with 5 ) then print Value "3299971" else value "Y then ...etc
The sintax is incorrect because always return else condition.
for example return "3299971"; return "3299973";return "3299978";
if (Brand.equalsIgnoreCase ("BK") && CustNo.startsWith("5")){ return "3299970";"; }else if (Brand.equalsIgnoreCase ("DQ") && CustNo.startsWith("5")){ return "3299972";