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