144: null;
145: END get_old_position_data;
146:
147: BEGIN
148: hr_utility.set_location('Entering:'|| l_proc , 1);
149: ghr_history_api.get_g_session_var( l_session_var);
150:
151: hr_utility.set_location('Program Name : ' || l_session_var.program_name, 1);
152: hr_utility.set_location('Fire Trigger : ' || l_session_var.fire_trigger, 1);
147: BEGIN
148: hr_utility.set_location('Entering:'|| l_proc , 1);
149: ghr_history_api.get_g_session_var( l_session_var);
150:
151: hr_utility.set_location('Program Name : ' || l_session_var.program_name, 1);
152: hr_utility.set_location('Fire Trigger : ' || l_session_var.fire_trigger, 1);
153:
154: IF l_session_var.fire_trigger = 'Y' THEN
155: hr_utility.set_location('Fire Trigger Y :'|| l_proc , 10);
148: hr_utility.set_location('Entering:'|| l_proc , 1);
149: ghr_history_api.get_g_session_var( l_session_var);
150:
151: hr_utility.set_location('Program Name : ' || l_session_var.program_name, 1);
152: hr_utility.set_location('Fire Trigger : ' || l_session_var.fire_trigger, 1);
153:
154: IF l_session_var.fire_trigger = 'Y' THEN
155: hr_utility.set_location('Fire Trigger Y :'|| l_proc , 10);
156: IF lower(l_session_var.program_name) = 'core' THEN
151: hr_utility.set_location('Program Name : ' || l_session_var.program_name, 1);
152: hr_utility.set_location('Fire Trigger : ' || l_session_var.fire_trigger, 1);
153:
154: IF l_session_var.fire_trigger = 'Y' THEN
155: hr_utility.set_location('Fire Trigger Y :'|| l_proc , 10);
156: IF lower(l_session_var.program_name) = 'core' THEN
157: hr_utility.set_location( l_proc , 180);
158: ghr_history_api.get_session_date( l_session_date);
159: IF inserting THEN
153:
154: IF l_session_var.fire_trigger = 'Y' THEN
155: hr_utility.set_location('Fire Trigger Y :'|| l_proc , 10);
156: IF lower(l_session_var.program_name) = 'core' THEN
157: hr_utility.set_location( l_proc , 180);
158: ghr_history_api.get_session_date( l_session_date);
159: IF inserting THEN
160: hr_utility.set_location( l_proc , 170);
161: IF :new.effective_start_date >= l_session_date THEN
156: IF lower(l_session_var.program_name) = 'core' THEN
157: hr_utility.set_location( l_proc , 180);
158: ghr_history_api.get_session_date( l_session_date);
159: IF inserting THEN
160: hr_utility.set_location( l_proc , 170);
161: IF :new.effective_start_date >= l_session_date THEN
162: hr_utility.set_location( l_proc , 160);
163: -- For core forms effective date must be set to effective start date.
164: -- Currently this is not set correctly thru core form. As it sets the
158: ghr_history_api.get_session_date( l_session_date);
159: IF inserting THEN
160: hr_utility.set_location( l_proc , 170);
161: IF :new.effective_start_date >= l_session_date THEN
162: hr_utility.set_location( l_proc , 160);
163: -- For core forms effective date must be set to effective start date.
164: -- Currently this is not set correctly thru core form. As it sets the
165: -- effective date to session date.
166: l_session_var.date_effective := :new.effective_start_date;
174: p_old_record_data => l_old_position_hist_data,
175: p_row_id => :new.rowid
176: );
177: ELSE
178: hr_utility.set_location( l_proc , 150);
179: /* As core form creates a new record for the old record and
180: end dates it. This is not the record which needs to be
181: considered for history.
182: */
185: ELSIF updating THEN
186: IF l_session_date between :new.effective_start_date and
187: :new.effective_end_date
188: THEN
189: hr_utility.set_location( l_proc , 140);
190: get_old_position_data(l_old_position_data);
191: ghr_history_conv_rg.conv_position_rg_to_hist_rg( p_position_data => l_old_position_data,
192: p_history_data => l_old_position_hist_data);
193: -- For core forms effective date must be set to effective start date.
205: p_old_record_data => l_old_position_hist_data,
206: p_row_id => :new.rowid
207: );
208: ELSE
209: hr_utility.set_location( l_proc , 130);
210: /* This is the case when a record is end dated. No need to
211: maintain History for this record
212: */
213: NULL;
212: */
213: NULL;
214: END IF;
215: ELSE /* ie deleting */
216: hr_utility.set_location( l_proc , 120);
217: ghr_history_api.get_g_session_var( l_session_var);
218: /* Should we allow deletes from core. How should it be handled?? */
219: NULL;
220: END IF;
219: NULL;
220: END IF;
221: ELSIF lower(l_session_var.program_name) = 'sf50' THEN
222: IF inserting THEN
223: hr_utility.set_location( l_proc , 110);
224: ghr_history_api.set_operation_info(
225: p_table_name => ghr_history_api.g_posn_table,
226: p_program_name => l_session_var.program_name,
227: p_date_effective => l_session_var.date_effective,
231: p_row_id => :new.rowid
232: );
233: ELSIF updating THEN
234: IF (:new.effective_end_date <> :old.effective_end_date) THEN
235: hr_utility.set_location( l_proc , 100);
236: NULL;
237: ELSE
238: hr_utility.set_location('sf50 Updating '|| l_proc , 20);
239: get_old_position_data(l_old_position_data);
234: IF (:new.effective_end_date <> :old.effective_end_date) THEN
235: hr_utility.set_location( l_proc , 100);
236: NULL;
237: ELSE
238: hr_utility.set_location('sf50 Updating '|| l_proc , 20);
239: get_old_position_data(l_old_position_data);
240: ghr_history_conv_rg.conv_position_rg_to_hist_rg( p_position_data => l_old_position_data,
241: p_history_data => l_old_position_hist_data);
242: ghr_history_api.set_operation_info(
250: );
251: END IF;
252: END IF;
253: ELSE /* Not a known type */
254: hr_utility.set_location('Unknown Program Name - ' || l_session_var.program_name ||' :' || l_proc , 10);
255: hr_utility.set_message( 8301, 'GHR_UNKNOWN_PGM_TYPE');
256: fnd_message.set_token('PROGRAM_TYPE', l_session_var.program_name);
257: hr_utility.raise_error;
258: /* History not maintained */
251: END IF;
252: END IF;
253: ELSE /* Not a known type */
254: hr_utility.set_location('Unknown Program Name - ' || l_session_var.program_name ||' :' || l_proc , 10);
255: hr_utility.set_message( 8301, 'GHR_UNKNOWN_PGM_TYPE');
256: fnd_message.set_token('PROGRAM_TYPE', l_session_var.program_name);
257: hr_utility.raise_error;
258: /* History not maintained */
259: END IF;
253: ELSE /* Not a known type */
254: hr_utility.set_location('Unknown Program Name - ' || l_session_var.program_name ||' :' || l_proc , 10);
255: hr_utility.set_message( 8301, 'GHR_UNKNOWN_PGM_TYPE');
256: fnd_message.set_token('PROGRAM_TYPE', l_session_var.program_name);
257: hr_utility.raise_error;
258: /* History not maintained */
259: END IF;
260: END IF;
261: hr_utility.set_location('Leaving:'|| l_proc , 1);
257: hr_utility.raise_error;
258: /* History not maintained */
259: END IF;
260: END IF;
261: hr_utility.set_location('Leaving:'|| l_proc , 1);
262: END GHR_HR_ALL_POSITIONS_F_AFIUD;