36: select pay_sub_classification_rules_s.nextval
37: from sys.dual;
38: BEGIN
39:
40: hr_utility.set_location ('PAY_SUB_CLASS_RULES_PKG.INSERT_ROW',1);
41:
42: if p_sub_classification_rule_id is null then
43: open csr_next_id;
44: fetch csr_next_id into p_sub_classification_rule_id;
44: fetch csr_next_id into p_sub_classification_rule_id;
45: close csr_next_id;
46: end if;
47:
48: hr_utility.set_location ('PAY_SUB_CLASS_RULES_PKG.INSERT_ROW',2);
49: insert into pay_sub_classification_rules_f(
50:
51: sub_classification_rule_id,
52: effective_start_date,
74: c_user_id,
75: sysdate
76:
77: );
78: hr_utility.set_location ('PAY_SUB_CLASS_RULES_PKG.INSERT_ROW',3);
79:
80: open csr_new_rowid;
81: fetch csr_new_rowid into p_rowid;
82: if csr_new_rowid%notfound then
80: open csr_new_rowid;
81: fetch csr_new_rowid into p_rowid;
82: if csr_new_rowid%notfound then
83: close csr_new_rowid;
84: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
85: hr_utility.set_message_token('PROCEDURE','PAY_SUB_CLASS_RULES_PKG.INSERT_ROW');
86: hr_utility.set_message_token('STEP','1');
87: hr_utility.raise_error;
88: end if;
81: fetch csr_new_rowid into p_rowid;
82: if csr_new_rowid%notfound then
83: close csr_new_rowid;
84: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
85: hr_utility.set_message_token('PROCEDURE','PAY_SUB_CLASS_RULES_PKG.INSERT_ROW');
86: hr_utility.set_message_token('STEP','1');
87: hr_utility.raise_error;
88: end if;
89: close csr_new_rowid;
82: if csr_new_rowid%notfound then
83: close csr_new_rowid;
84: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
85: hr_utility.set_message_token('PROCEDURE','PAY_SUB_CLASS_RULES_PKG.INSERT_ROW');
86: hr_utility.set_message_token('STEP','1');
87: hr_utility.raise_error;
88: end if;
89: close csr_new_rowid;
90: --
83: close csr_new_rowid;
84: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
85: hr_utility.set_message_token('PROCEDURE','PAY_SUB_CLASS_RULES_PKG.INSERT_ROW');
86: hr_utility.set_message_token('STEP','1');
87: hr_utility.raise_error;
88: end if;
89: close csr_new_rowid;
90: --
91: -- Create application ownership for startup data
95: -- entered. This could arise because the forms startup code also handles
96: -- application ownerships where a user enters a value on the form, but
97: -- this code is intended to handle third party insertion from the element
98: --
99: hr_utility.set_location ('PAY_SUB_CLASS_RULES_PKG.INSERT_ROW',4);
100: insert into hr_application_ownerships
101: (key_name,
102: key_value,
103: product_name)
115: and ao.key_value = p_element_type_id);
116: --
117: end if;
118: --
119: hr_utility.set_location ('PAY_SUB_CLASS_RULES_PKG.INSERT_ROW',5);
120: hr_balance_feeds.ins_bf_sub_class_rule (p_Sub_Classification_Rule_Id);
121:
122: end insert_row;
123:
148: open csr_existing_row;
149: fetch csr_existing_row into fetched_record;
150: if csr_existing_row%notfound then
151: close csr_existing_row;
152: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
153: hr_utility.set_message_token('PROCEDURE','PAY_SUB_CLASS_RULES_PKG.LOCK_ROW');
154: hr_utility.set_message_token('STEP','1');
155: hr_utility.raise_error;
156: end if;
149: fetch csr_existing_row into fetched_record;
150: if csr_existing_row%notfound then
151: close csr_existing_row;
152: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
153: hr_utility.set_message_token('PROCEDURE','PAY_SUB_CLASS_RULES_PKG.LOCK_ROW');
154: hr_utility.set_message_token('STEP','1');
155: hr_utility.raise_error;
156: end if;
157: close csr_existing_row;
150: if csr_existing_row%notfound then
151: close csr_existing_row;
152: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
153: hr_utility.set_message_token('PROCEDURE','PAY_SUB_CLASS_RULES_PKG.LOCK_ROW');
154: hr_utility.set_message_token('STEP','1');
155: hr_utility.raise_error;
156: end if;
157: close csr_existing_row;
158: if (
151: close csr_existing_row;
152: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
153: hr_utility.set_message_token('PROCEDURE','PAY_SUB_CLASS_RULES_PKG.LOCK_ROW');
154: hr_utility.set_message_token('STEP','1');
155: hr_utility.raise_error;
156: end if;
157: close csr_existing_row;
158: if (
159: ( (fetched_record.sub_classification_rule_id = p_Sub_Classification_Rule_Id)
212: last_update_login = c_login_id
213: WHERE rowid = p_rowid;
214:
215: if (SQL%NOTFOUND) then
216: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
217: hr_utility.set_message_token('PROCEDURE','PAY_SUB_CLASS_RULES_PKG.UPDATE_ROW');
218: hr_utility.set_message_token('STEP','1');
219: hr_utility.raise_error;
220: end if;
213: WHERE rowid = p_rowid;
214:
215: if (SQL%NOTFOUND) then
216: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
217: hr_utility.set_message_token('PROCEDURE','PAY_SUB_CLASS_RULES_PKG.UPDATE_ROW');
218: hr_utility.set_message_token('STEP','1');
219: hr_utility.raise_error;
220: end if;
221:
214:
215: if (SQL%NOTFOUND) then
216: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
217: hr_utility.set_message_token('PROCEDURE','PAY_SUB_CLASS_RULES_PKG.UPDATE_ROW');
218: hr_utility.set_message_token('STEP','1');
219: hr_utility.raise_error;
220: end if;
221:
222: END Update_Row;
215: if (SQL%NOTFOUND) then
216: hr_utility.set_message(801,'HR_6153_ALL_PROCEDURE_FAIL');
217: hr_utility.set_message_token('PROCEDURE','PAY_SUB_CLASS_RULES_PKG.UPDATE_ROW');
218: hr_utility.set_message_token('STEP','1');
219: hr_utility.raise_error;
220: end if;
221:
222: END Update_Row;
223: --------------------------------------------------------------------------------
260: ));
261: --
262: begin
263: --
264: hr_utility.set_location ('pay_sub_class_rules_pkg.insert_defaults',1);
265: --
266: for default_insertion in csr_next_default LOOP
267: --
268: insert_row (
308: and classification_id = p_classification_id
309: and effective_end_date > p_session_date;
310: --
311: begin
312: hr_utility.set_location ('pay_sub_class_rules_pkg.allowable_end_date',1);
313: --
314: open csr_end_date;
315: fetch csr_end_date into v_end_date;
316: close csr_end_date;
314: open csr_end_date;
315: fetch csr_end_date into v_end_date;
316: close csr_end_date;
317: --
318: hr_utility.trace ('End Date = '||v_end_date);
319: --
320: -- Return an error if the maximum allowable end date is prior to session date
321: if p_error_if_true and v_end_date <= p_session_date then
322: hr_utility.set_message (801,'HR_7128_SUB_CLASS_OVERLAPS');
318: hr_utility.trace ('End Date = '||v_end_date);
319: --
320: -- Return an error if the maximum allowable end date is prior to session date
321: if p_error_if_true and v_end_date <= p_session_date then
322: hr_utility.set_message (801,'HR_7128_SUB_CLASS_OVERLAPS');
323: hr_utility.raise_error;
324: end if;
325: --
326: return v_end_date;
319: --
320: -- Return an error if the maximum allowable end date is prior to session date
321: if p_error_if_true and v_end_date <= p_session_date then
322: hr_utility.set_message (801,'HR_7128_SUB_CLASS_OVERLAPS');
323: hr_utility.raise_error;
324: end if;
325: --
326: return v_end_date;
327: --
361: p_validation_end_date date ) is
362: --
363: begin
364: --
365: hr_utility.set_location ('pay_sub_class_rules_pkg.MAINTAIN_DELETION_INTEGRITY',1);
366: --
367: -- Delete balance feeds for this sub classification rule
368: hr_balance_feeds.del_bf_sub_class_rule (
369: --
391: p_validation_end_date date ) is
392: --
393: begin
394: --
395: hr_utility.set_location ('pay_sub_class_rules_pkg.DELETE_ROW',1);
396: --
397: pay_sub_class_rules_pkg.maintain_deletion_integrity (
398: --
399: p_sub_classification_rule_id,
406: delete from pay_sub_classification_rules_f
407: where rowid = p_rowid;
408: --
409: if sql%notfound then -- system error trap
410: hr_utility.set_message (801,'HR_6153_ALL_PROCEDURE_FAIL');
411: hr_utility.set_message_token('PROCEDURE',
412: 'PAY_SUB_CLASS_RULES_PKG.DELETE_ROW');
413: hr_utility.set_message_token('STEP','2');
414: hr_utility.raise_error;
407: where rowid = p_rowid;
408: --
409: if sql%notfound then -- system error trap
410: hr_utility.set_message (801,'HR_6153_ALL_PROCEDURE_FAIL');
411: hr_utility.set_message_token('PROCEDURE',
412: 'PAY_SUB_CLASS_RULES_PKG.DELETE_ROW');
413: hr_utility.set_message_token('STEP','2');
414: hr_utility.raise_error;
415: end if;
409: if sql%notfound then -- system error trap
410: hr_utility.set_message (801,'HR_6153_ALL_PROCEDURE_FAIL');
411: hr_utility.set_message_token('PROCEDURE',
412: 'PAY_SUB_CLASS_RULES_PKG.DELETE_ROW');
413: hr_utility.set_message_token('STEP','2');
414: hr_utility.raise_error;
415: end if;
416: --
417: delete from hr_application_ownerships
410: hr_utility.set_message (801,'HR_6153_ALL_PROCEDURE_FAIL');
411: hr_utility.set_message_token('PROCEDURE',
412: 'PAY_SUB_CLASS_RULES_PKG.DELETE_ROW');
413: hr_utility.set_message_token('STEP','2');
414: hr_utility.raise_error;
415: end if;
416: --
417: delete from hr_application_ownerships
418: where key_name = 'SUB_CLASSIFICATION_RULE_ID'
451: classification_id)
452: for update;
453: --
454: begin
455: hr_utility.set_location ('pay_sub_class_rules_pkg.parent_deleted',1);
456: --
457: <
458: for fetched_rule in csr_rows_owned_by_parent LOOP
459: --