PAY NZ Generate ED Payday Exception

Description
Categories: BI Publisher
Imported from BI Publisher
Application: Payroll
Source: NZ Generate ED Payday Exception Report
Short Name: PYNZEDEXP_XML
DB package:
WITH a as (
SELECT ACTION_INFORMATION9 EXPT_LIST FROM PAY_ACTION_INFORMATION
WHERE ACTION_INFORMATION_ID = :ACTION_INFORMATION_ID
),
B AS
(
SELECT trim(regexp_substr(a.EXPT_LIST, '[^,]+', 1, LEVEL)) EXPT_CODE FROM A
CONNECT BY regexp_substr(a.EXPT_LIST , '[^,]+', 1, LEVEL) IS NOT NULL
)
SELECT EXPT_CODE,
			CASE
        WHEN    EXPT_CODE = 'EMAIL'	THEN    'The email address is invalid.'
        WHEN    EXPT_CODE = 'TXC1'	THEN    'The employee has duplicate tax codes.'
		WHEN    EXPT_CODE = 'TXC2'	THEN    'The tax code is either invalid or no active tax code record is present.'
        WHEN    EXPT_CODE = 'TXC3'	THEN    'An employee can only have one primary tax code (one of M, M SL, ME, or ME SL).'
        WHEN    EXPT_CODE = 'TXC4'	THEN    'A valid student loan tax code (M SL, ME SL, SB SL, S SL, ST SL, or SH SL) must also exist for employee with SLCIR, SLBOR, or both  tax codes.'
        WHEN    EXPT_CODE = 'TXC5'	THEN    'No other tax code can exist if the employee has tax code as NSW.'
END AS EXPT_DESC
FROM    B