72: ORDER BY DECODE
73: (pay_1099r_pkg.get_parameter ('SORT_1',
74: ppa1.legislative_parameters
75: ),
76: 'Employee_Name', hr_us_w2_rep.get_per_item
77: (paa.assignment_action_id,
78: 'A_PER_LAST_NAME'
79: )
80: || hr_us_w2_rep.get_per_item (paa.assignment_action_id,
76: 'Employee_Name', hr_us_w2_rep.get_per_item
77: (paa.assignment_action_id,
78: 'A_PER_LAST_NAME'
79: )
80: || hr_us_w2_rep.get_per_item (paa.assignment_action_id,
81: 'A_PER_FIRST_NAME'
82: )
83: || DECODE
84: (hr_us_w2_rep.get_per_item (paa.assignment_action_id,
80: || hr_us_w2_rep.get_per_item (paa.assignment_action_id,
81: 'A_PER_FIRST_NAME'
82: )
83: || DECODE
84: (hr_us_w2_rep.get_per_item (paa.assignment_action_id,
85: 'A_PER_MIDDLE_NAMES'
86: ),
87: NULL, NULL,
88: SUBSTR
85: 'A_PER_MIDDLE_NAMES'
86: ),
87: NULL, NULL,
88: SUBSTR
89: (hr_us_w2_rep.get_per_item (paa.assignment_action_id,
90: 'A_PER_MIDDLE_NAMES'
91: ),
92: 1,
93: 1
93: 1
94: )
95: ),
96: 'Social_Security_Number', NVL
97: (hr_us_w2_rep.get_per_item (paa.assignment_action_id,
98: 'A_PER_NATIONAL_IDENTIFIER'
99: ),
100: 'Applied For'
101: ),
98: 'A_PER_NATIONAL_IDENTIFIER'
99: ),
100: 'Applied For'
101: ),
102: 'Zip_Code', hr_us_w2_rep.get_w2_postal_code
103: (TO_NUMBER (paa.serial_number),
104: ppa1.effective_date
105: ),
106: hr_us_w2_rep.get_per_item (paa.assignment_action_id,
102: 'Zip_Code', hr_us_w2_rep.get_w2_postal_code
103: (TO_NUMBER (paa.serial_number),
104: ppa1.effective_date
105: ),
106: hr_us_w2_rep.get_per_item (paa.assignment_action_id,
107: 'A_PER_LAST_NAME'
108: )
109: || hr_us_w2_rep.get_per_item (paa.assignment_action_id,
110: 'A_PER_FIRST_NAME'
105: ),
106: hr_us_w2_rep.get_per_item (paa.assignment_action_id,
107: 'A_PER_LAST_NAME'
108: )
109: || hr_us_w2_rep.get_per_item (paa.assignment_action_id,
110: 'A_PER_FIRST_NAME'
111: )
112: || DECODE
113: (hr_us_w2_rep.get_per_item (paa.assignment_action_id,
109: || hr_us_w2_rep.get_per_item (paa.assignment_action_id,
110: 'A_PER_FIRST_NAME'
111: )
112: || DECODE
113: (hr_us_w2_rep.get_per_item (paa.assignment_action_id,
114: 'A_PER_MIDDLE_NAMES'
115: ),
116: NULL, NULL,
117: SUBSTR
114: 'A_PER_MIDDLE_NAMES'
115: ),
116: NULL, NULL,
117: SUBSTR
118: (hr_us_w2_rep.get_per_item (paa.assignment_action_id,
119: 'A_PER_MIDDLE_NAMES'
120: ),
121: 1,
122: 1
126: DECODE
127: (pay_1099r_pkg.get_parameter ('SORT_2',
128: ppa1.legislative_parameters
129: ),
130: 'Employee_Name', hr_us_w2_rep.get_per_item
131: (paa.assignment_action_id,
132: 'A_PER_LAST_NAME'
133: )
134: || hr_us_w2_rep.get_per_item (paa.assignment_action_id,
130: 'Employee_Name', hr_us_w2_rep.get_per_item
131: (paa.assignment_action_id,
132: 'A_PER_LAST_NAME'
133: )
134: || hr_us_w2_rep.get_per_item (paa.assignment_action_id,
135: 'A_PER_FIRST_NAME'
136: )
137: || DECODE
138: (hr_us_w2_rep.get_per_item (paa.assignment_action_id,
134: || hr_us_w2_rep.get_per_item (paa.assignment_action_id,
135: 'A_PER_FIRST_NAME'
136: )
137: || DECODE
138: (hr_us_w2_rep.get_per_item (paa.assignment_action_id,
139: 'A_PER_MIDDLE_NAMES'
140: ),
141: NULL, NULL,
142: SUBSTR
139: 'A_PER_MIDDLE_NAMES'
140: ),
141: NULL, NULL,
142: SUBSTR
143: (hr_us_w2_rep.get_per_item (paa.assignment_action_id,
144: 'A_PER_MIDDLE_NAMES'
145: ),
146: 1,
147: 1
147: 1
148: )
149: ),
150: 'Social_Security_Number', NVL
151: (hr_us_w2_rep.get_per_item (paa.assignment_action_id,
152: 'A_PER_NATIONAL_IDENTIFIER'
153: ),
154: 'Applied For'
155: ),
152: 'A_PER_NATIONAL_IDENTIFIER'
153: ),
154: 'Applied For'
155: ),
156: 'Zip_Code', hr_us_w2_rep.get_w2_postal_code
157: (TO_NUMBER (paa.serial_number),
158: ppa1.effective_date
159: ),
160: NULL
162: DECODE
163: (pay_1099r_pkg.get_parameter ('SORT_3',
164: ppa1.legislative_parameters
165: ),
166: 'Employee_Name', hr_us_w2_rep.get_per_item
167: (paa.assignment_action_id,
168: 'A_PER_LAST_NAME'
169: )
170: || hr_us_w2_rep.get_per_item (paa.assignment_action_id,
166: 'Employee_Name', hr_us_w2_rep.get_per_item
167: (paa.assignment_action_id,
168: 'A_PER_LAST_NAME'
169: )
170: || hr_us_w2_rep.get_per_item (paa.assignment_action_id,
171: 'A_PER_FIRST_NAME'
172: )
173: || DECODE
174: (hr_us_w2_rep.get_per_item (paa.assignment_action_id,
170: || hr_us_w2_rep.get_per_item (paa.assignment_action_id,
171: 'A_PER_FIRST_NAME'
172: )
173: || DECODE
174: (hr_us_w2_rep.get_per_item (paa.assignment_action_id,
175: 'A_PER_MIDDLE_NAMES'
176: ),
177: NULL, NULL,
178: SUBSTR
175: 'A_PER_MIDDLE_NAMES'
176: ),
177: NULL, NULL,
178: SUBSTR
179: (hr_us_w2_rep.get_per_item (paa.assignment_action_id,
180: 'A_PER_MIDDLE_NAMES'
181: ),
182: 1,
183: 1
183: 1
184: )
185: ),
186: 'Social_Security_Number', NVL
187: (hr_us_w2_rep.get_per_item (paa.assignment_action_id,
188: 'A_PER_NATIONAL_IDENTIFIER'
189: ),
190: 'Applied For'
191: ),
188: 'A_PER_NATIONAL_IDENTIFIER'
189: ),
190: 'Applied For'
191: ),
192: 'Zip_Code', hr_us_w2_rep.get_w2_postal_code
193: (TO_NUMBER (paa.serial_number),
194: ppa1.effective_date
195: ),
196: NULL