36: and effective_start_date <=p_effective_end_date
37: and effective_end_date >=p_session_date;
38: begin
39: --
40: hr_utility.set_location ('pay_formula_result_rules_pkg.check_unique',3);
41: --
42: open csr_duplicate_rule;
43: fetch csr_duplicate_rule into g_dummy;
44: v_duplicate_found := csr_duplicate_rule%found;
64: and (p_rowid is null
65: or (p_rowid is not null and p_rowid <> rowid));
66: begin
67: --
68: hr_utility.set_location ('pay_formula_result_rules_pkg.check_unique',4);
69: --
70: open csr_duplicate_rule;
71: fetch csr_duplicate_rule into g_dummy;
72: v_duplicate_found := csr_duplicate_rule%found;
94: and effective_end_date >=p_session_date
95: and element_type_id = p_element_type_id;
96: begin
97: --
98: hr_utility.set_location ('pay_formula_result_rules_pkg.check_unique',5);
99: --
100: open csr_duplicate_rule;
101: fetch csr_duplicate_rule into g_dummy;
102: v_duplicate_found := csr_duplicate_rule%found;
124: and effective_start_date <=p_effective_end_date
125: and effective_end_date >=p_session_date;
126: begin
127: --
128: hr_utility.set_location ('pay_formula_result_rules_pkg.check_unique',6);
129: --
130: open csr_duplicate_rule;
131: fetch csr_duplicate_rule into g_dummy;
132: v_duplicate_found := csr_duplicate_rule%found;
137: end other_rule_type_not_unique;
138: --
139: begin
140: --
141: hr_utility.set_location ('pay_formula_result_rules_pkg.check_unique',1);
142: --
143: --if (p_result_rule_type = 'D' and direct_result_rule_not_unique) then
144: --
145: -- hr_utility.set_message (801, 'HR_6503_FF_DIRECT');
141: hr_utility.set_location ('pay_formula_result_rules_pkg.check_unique',1);
142: --
143: --if (p_result_rule_type = 'D' and direct_result_rule_not_unique) then
144: --
145: -- hr_utility.set_message (801, 'HR_6503_FF_DIRECT');
146: --hr_utility.raise_error;
147: --
148: if (p_result_rule_type = 'M' and message_rule_not_unique)
149: or (p_result_rule_type = 'S' and stop_entry_rule_not_unique)
142: --
143: --if (p_result_rule_type = 'D' and direct_result_rule_not_unique) then
144: --
145: -- hr_utility.set_message (801, 'HR_6503_FF_DIRECT');
146: --hr_utility.raise_error;
147: --
148: if (p_result_rule_type = 'M' and message_rule_not_unique)
149: or (p_result_rule_type = 'S' and stop_entry_rule_not_unique)
150: or (p_result_rule_type in('U','I','D') and other_rule_type_not_unique) then
148: if (p_result_rule_type = 'M' and message_rule_not_unique)
149: or (p_result_rule_type = 'S' and stop_entry_rule_not_unique)
150: or (p_result_rule_type in('U','I','D') and other_rule_type_not_unique) then
151: --
152: hr_utility.set_message (801, 'HR_6478_FF_UNI_FRR');
153: hr_utility.raise_error;
154: --
155: end if;
156: --
149: or (p_result_rule_type = 'S' and stop_entry_rule_not_unique)
150: or (p_result_rule_type in('U','I','D') and other_rule_type_not_unique) then
151: --
152: hr_utility.set_message (801, 'HR_6478_FF_UNI_FRR');
153: hr_utility.raise_error;
154: --
155: end if;
156: --
157: end check_unique;
187:
188: --
189: begin
190: --
191: hr_utility.set_location ('pay_formula_result_rules_pkg.target_pay_value',1);
192: --
193: open csr_input_value;
194: fetch csr_input_value into v_input_value_id;
195: --
194: fetch csr_input_value into v_input_value_id;
195: --
196: if csr_input_value%notfound then
197: close csr_input_value;
198: hr_utility.set_message (801,'HR_6501_FF_INVALID_UOM');
199: hr_utility.raise_error;
200: else
201: close csr_input_value;
202: end if;
195: --
196: if csr_input_value%notfound then
197: close csr_input_value;
198: hr_utility.set_message (801,'HR_6501_FF_INVALID_UOM');
199: hr_utility.raise_error;
200: else
201: close csr_input_value;
202: end if;
203: --
229:
230: CURSOR C2 IS SELECT pay_formula_result_rules_s.nextval FROM sys.dual;
231: BEGIN
232: --
233: hr_utility.set_location ('pay_formula_result_rules_pkg.insert_row',1);
234: --
235: check_unique (p_status_processing_rule_id,
236: p_result_rule_type,
237: p_result_name,
240: p_rowid,
241: p_element_type_id,
242: p_input_value_id) ;
243: --
244: hr_utility.set_location ('pay_formula_result_rules_pkg.insert_row',2);
245: --
246: if (p_formula_result_rule_id is NULL) then
247: OPEN C2;
248: FETCH C2 INTO p_formula_result_rule_id;
248: FETCH C2 INTO p_formula_result_rule_id;
249: CLOSE C2;
250: end if;
251: --
252: hr_utility.set_location ('pay_formula_result_rules_pkg.insert_row',3);
253: --
254: insert into pay_formula_result_rules_f(
255: formula_result_rule_id,
256: effective_start_date,
281: p_Input_Value_Id,
282: sysdate);
283:
284: --
285: hr_utility.set_location ('pay_formula_result_rules_pkg.insert_row',4);
286: --
287: OPEN C;
288: FETCH C INTO p_Rowid;
289: if (C%NOTFOUND) then
450: 'PAY_INPUT_VALUES_F',input_value_id)
451: for update;
452: --
453: begin
454: hr_utility.set_location ('pay_sub_class_rules_pkg.parent_deleted',1);
455: --
456: <
457: for fetched_row in csr_rows_owned_by_parent LOOP
458: --
472: -- (and thereby prevent zapping of the parent element)
473:
474: if p_delete_mode = 'ZAP' and fetched_row.result_rule_type = 'S'
475: and p_parent_name = 'PAY_ELEMENT_TYPES_F' then
476: hr_utility.set_message (801,'PAY_6157_ELEMENT_NO_DEL_FRR');
477: hr_utility.raise_error;
478: end if;
479: --
480: delete from pay_formula_result_rules_f
473:
474: if p_delete_mode = 'ZAP' and fetched_row.result_rule_type = 'S'
475: and p_parent_name = 'PAY_ELEMENT_TYPES_F' then
476: hr_utility.set_message (801,'PAY_6157_ELEMENT_NO_DEL_FRR');
477: hr_utility.raise_error;
478: end if;
479: --
480: delete from pay_formula_result_rules_f
481: where current of csr_rows_owned_by_parent;
496: and p_parent_name = 'PAY_STATUS_PROCESSING_RULES_F' then
497: --
498: -- Do not allow delete-next-change to orphan result rules
499: --
500: hr_utility.set_message (801,'HR_7451_SPR_NO_DEL_NEXT_CHANGE');
501: hr_utility.raise_error;
502: --
503: end if;
504: --
497: --
498: -- Do not allow delete-next-change to orphan result rules
499: --
500: hr_utility.set_message (801,'HR_7451_SPR_NO_DEL_NEXT_CHANGE');
501: hr_utility.raise_error;
502: --
503: end if;
504: --
505: end loop remove_orphaned_rows;