51: l_proc varchar2(30):= 'update_last_change_date';
52:
53: begin
54:
55: hr_utility.set_location('Entering:'||l_proc,5);
56: hr_utility.set_location('p_assignment_id:'||p_assignment_id,15);
57: hr_utility.set_location('p_change_date:'||p_change_date,25);
58:
59: l_last_change_date:=p_change_date;
52:
53: begin
54:
55: hr_utility.set_location('Entering:'||l_proc,5);
56: hr_utility.set_location('p_assignment_id:'||p_assignment_id,15);
57: hr_utility.set_location('p_change_date:'||p_change_date,25);
58:
59: l_last_change_date:=p_change_date;
60:
53: begin
54:
55: hr_utility.set_location('Entering:'||l_proc,5);
56: hr_utility.set_location('p_assignment_id:'||p_assignment_id,15);
57: hr_utility.set_location('p_change_date:'||p_change_date,25);
58:
59: l_last_change_date:=p_change_date;
60:
61: OPEN csr_next_proposal;
60:
61: OPEN csr_next_proposal;
62: FETCH csr_next_proposal into l_pay_proposal_id,l_row_id;
63:
64: hr_utility.set_location('l_pay_proposal_id:'||l_pay_proposal_id,15);
65:
66: if csr_next_proposal%FOUND then
67: hr_utility.set_location('Cursor found:',25);
68:
63:
64: hr_utility.set_location('l_pay_proposal_id:'||l_pay_proposal_id,15);
65:
66: if csr_next_proposal%FOUND then
67: hr_utility.set_location('Cursor found:',25);
68:
69: update per_pay_proposals
70: set last_change_date = l_last_change_date
71: where rowid=l_row_id;
68:
69: update per_pay_proposals
70: set last_change_date = l_last_change_date
71: where rowid=l_row_id;
72: hr_utility.set_location('Updated successfuly:',35);
73: end if;
74:
75: CLOSE csr_next_proposal;
76:
73: end if;
74:
75: CLOSE csr_next_proposal;
76:
77: hr_utility.set_location('Leaving:'||l_proc,5);
78:
79: EXCEPTION
80: When others then
81: --
80: When others then
81: --
82: -- An unexpected error has occured
83: --
84: hr_utility.set_location('When Others:'||l_proc,5);
85: raise;
86: --
87: end update_last_change_date;
88:
117: l_proc varchar2(30):= 'end_date_proposed_proposal';
118:
119: begin
120:
121: hr_utility.set_location('Entering:'||l_proc,5);
122: hr_utility.set_location('p_assignment_id:'||p_assignment_id,15);
123: hr_utility.set_location('p_date_to:'||p_date_to,25);
124:
125: OPEN csr_prev_prop_details;
118:
119: begin
120:
121: hr_utility.set_location('Entering:'||l_proc,5);
122: hr_utility.set_location('p_assignment_id:'||p_assignment_id,15);
123: hr_utility.set_location('p_date_to:'||p_date_to,25);
124:
125: OPEN csr_prev_prop_details;
126: FETCH csr_prev_prop_details into l_pay_proposal_id,l_date_to;
119: begin
120:
121: hr_utility.set_location('Entering:'||l_proc,5);
122: hr_utility.set_location('p_assignment_id:'||p_assignment_id,15);
123: hr_utility.set_location('p_date_to:'||p_date_to,25);
124:
125: OPEN csr_prev_prop_details;
126: FETCH csr_prev_prop_details into l_pay_proposal_id,l_date_to;
127:
124:
125: OPEN csr_prev_prop_details;
126: FETCH csr_prev_prop_details into l_pay_proposal_id,l_date_to;
127:
128: hr_utility.set_location('l_pay_proposal_id:'||l_pay_proposal_id,15);
129: hr_utility.set_location('l_date_to:'||l_date_to,25);
130:
131: if csr_prev_prop_details%FOUND then
132: hr_utility.set_location('Cursor found:',35);
125: OPEN csr_prev_prop_details;
126: FETCH csr_prev_prop_details into l_pay_proposal_id,l_date_to;
127:
128: hr_utility.set_location('l_pay_proposal_id:'||l_pay_proposal_id,15);
129: hr_utility.set_location('l_date_to:'||l_date_to,25);
130:
131: if csr_prev_prop_details%FOUND then
132: hr_utility.set_location('Cursor found:',35);
133: if l_date_to is null OR l_date_to > p_date_to then
128: hr_utility.set_location('l_pay_proposal_id:'||l_pay_proposal_id,15);
129: hr_utility.set_location('l_date_to:'||l_date_to,25);
130:
131: if csr_prev_prop_details%FOUND then
132: hr_utility.set_location('Cursor found:',35);
133: if l_date_to is null OR l_date_to > p_date_to then
134: hr_utility.set_location('About to update',45);
135: update per_pay_proposals
136: set date_to = p_date_to,
130:
131: if csr_prev_prop_details%FOUND then
132: hr_utility.set_location('Cursor found:',35);
133: if l_date_to is null OR l_date_to > p_date_to then
134: hr_utility.set_location('About to update',45);
135: update per_pay_proposals
136: set date_to = p_date_to,
137: -- added by vkodedal fix for 6831216
138: last_update_date = sysdate,
140: last_update_login = fnd_global.login_id
141: -- end of fix
142: where assignment_id = p_assignment_id
143: and pay_proposal_id = l_pay_proposal_id;
144: hr_utility.set_location('Updated successfuly:',85);
145: end if;
146: end if;
147: CLOSE csr_prev_prop_details;
148:
145: end if;
146: end if;
147: CLOSE csr_prev_prop_details;
148:
149: hr_utility.set_location('Leaving:'||l_proc,5);
150:
151: end end_date_proposed_proposal;
152: --
153: --
198: l_del_warn boolean;
199:
200: begin
201:
202: hr_utility.set_location('Entering:'||l_proc,5);
203: hr_utility.set_location('p_assignment_id:'||p_assignment_id,15);
204: hr_utility.set_location('p_date_to:'||p_date_to,25);
205:
206: OPEN csr_prev_prop_details;
199:
200: begin
201:
202: hr_utility.set_location('Entering:'||l_proc,5);
203: hr_utility.set_location('p_assignment_id:'||p_assignment_id,15);
204: hr_utility.set_location('p_date_to:'||p_date_to,25);
205:
206: OPEN csr_prev_prop_details;
207: FETCH csr_prev_prop_details into l_pay_proposal_id,l_date_to;
200: begin
201:
202: hr_utility.set_location('Entering:'||l_proc,5);
203: hr_utility.set_location('p_assignment_id:'||p_assignment_id,15);
204: hr_utility.set_location('p_date_to:'||p_date_to,25);
205:
206: OPEN csr_prev_prop_details;
207: FETCH csr_prev_prop_details into l_pay_proposal_id,l_date_to;
208:
206: OPEN csr_prev_prop_details;
207: FETCH csr_prev_prop_details into l_pay_proposal_id,l_date_to;
208:
209: if csr_prev_prop_details%FOUND then
210: hr_utility.set_location('Cursor found:',35);
211: if l_date_to is null OR l_date_to > p_date_to then
212: hr_utility.set_location('About to update',45);
213: update per_pay_proposals
214: set date_to = p_date_to,
208:
209: if csr_prev_prop_details%FOUND then
210: hr_utility.set_location('Cursor found:',35);
211: if l_date_to is null OR l_date_to > p_date_to then
212: hr_utility.set_location('About to update',45);
213: update per_pay_proposals
214: set date_to = p_date_to,
215: -- added by vkodedal fix for 6831216
216: last_update_date = sysdate,
218: last_update_login = fnd_global.login_id
219: -- end of fix
220: where assignment_id = p_assignment_id
221: and pay_proposal_id = l_pay_proposal_id;
222: hr_utility.set_location('Updated successfuly:',85);
223: end if;
224: end if;
225: CLOSE csr_prev_prop_details;
226: -- This condition is added to delete the proposed proposals in case it is not yet done from
226: -- This condition is added to delete the proposed proposals in case it is not yet done from
227: -- the OA layer. schowdhu - 01-Dec-2008
228: if( HR_MAINTAIN_PROPOSAL_API.g_deleted_from_oa = 'N')
229: then
230: hr_utility.set_location('Within delete from OA',90);
231: -- now delete all the inactivated proposed proposals. Bug#7386307 by schowdhu
232: for a in get_all_proposed_proposals loop
233: hr_maintain_proposal_api.delete_salary_proposal
234: (p_pay_proposal_id => a.pay_proposal_id
237: ,p_salary_warning => l_del_warn);
238: end loop;
239: end if;
240:
241: hr_utility.set_location('Leaving:'||l_proc,100);
242:
243: end end_date_approved_proposal;
244: --
245: -----------------------------------------------------------------------------
277: and assignment_id = p_assignment_id
278: and change_date = p_date_to +1 ;
279: begin
280:
281: hr_utility.set_location('Entering:'||l_proc,5);
282: hr_utility.set_location('p_assignment_id:'||p_assignment_id,15);
283: hr_utility.set_location('p_date_to:'||p_date_to,25);
284: /*
285: OPEN csr_prev_prop_details;
278: and change_date = p_date_to +1 ;
279: begin
280:
281: hr_utility.set_location('Entering:'||l_proc,5);
282: hr_utility.set_location('p_assignment_id:'||p_assignment_id,15);
283: hr_utility.set_location('p_date_to:'||p_date_to,25);
284: /*
285: OPEN csr_prev_prop_details;
286: FETCH csr_prev_prop_details into l_pay_proposal_id,l_date_to;
279: begin
280:
281: hr_utility.set_location('Entering:'||l_proc,5);
282: hr_utility.set_location('p_assignment_id:'||p_assignment_id,15);
283: hr_utility.set_location('p_date_to:'||p_date_to,25);
284: /*
285: OPEN csr_prev_prop_details;
286: FETCH csr_prev_prop_details into l_pay_proposal_id,l_date_to;
287:
284: /*
285: OPEN csr_prev_prop_details;
286: FETCH csr_prev_prop_details into l_pay_proposal_id,l_date_to;
287:
288: hr_utility.set_location('l_pay_proposal_id:'||l_pay_proposal_id,15);
289: hr_utility.set_location('l_date_to:'||l_date_to,25);
290:
291:
292: if csr_prev_prop_details%FOUND then
285: OPEN csr_prev_prop_details;
286: FETCH csr_prev_prop_details into l_pay_proposal_id,l_date_to;
287:
288: hr_utility.set_location('l_pay_proposal_id:'||l_pay_proposal_id,15);
289: hr_utility.set_location('l_date_to:'||l_date_to,25);
290:
291:
292: if csr_prev_prop_details%FOUND then
293: hr_utility.set_location('Cursor found:',35);
289: hr_utility.set_location('l_date_to:'||l_date_to,25);
290:
291:
292: if csr_prev_prop_details%FOUND then
293: hr_utility.set_location('Cursor found:',35);
294: if l_date_to is null OR l_date_to > p_date_to then
295: hr_utility.set_location('About to update',45);
296: update per_pay_proposals
297: set date_to = p_date_to,
291:
292: if csr_prev_prop_details%FOUND then
293: hr_utility.set_location('Cursor found:',35);
294: if l_date_to is null OR l_date_to > p_date_to then
295: hr_utility.set_location('About to update',45);
296: update per_pay_proposals
297: set date_to = p_date_to,
298: -- added by vkodedal fix for 6831216
299: last_update_date = sysdate,
301: last_update_login = fnd_global.login_id
302: -- end of fix
303: where assignment_id = p_assignment_id
304: and pay_proposal_id = l_pay_proposal_id;
305: hr_utility.set_location('Updated successfuly:',85);
306: end if;
307: end if;
308: CLOSE csr_prev_prop_details;
309: */
316: end_date_approved_proposal (p_assignment_id, p_date_to, p_proposal_id);
317: end if;
318: CLOSE chk_approved_flg;
319:
320: hr_utility.set_location('Leaving:'||l_proc,5);
321:
322: end end_date_salary_proposal;
323:
324: -----------------------------------------------------------------------------
904: where assignment_id = p_assignment_id
905: and change_date > p_change_date;
906:
907: begin
908: hr_utility.set_location('Entering:'|| l_proc, 5);
909: --
910: -- Issue a savepoint
911: --
912: savepoint upload_salary_proposal;
1145: (
1146: l_change_amount_table
1147: ,l_change_percentage_table
1148: );
1149: hr_utility.set_location(l_proc, 10);
1150: --
1151: -- get the last salary proposal.
1152: --
1153: open csr_get_last_approved_salary;
1152: --
1153: open csr_get_last_approved_salary;
1154: fetch csr_get_last_approved_salary into l_last_proposed_salary;
1155: if csr_get_last_approved_salary%notfound then
1156: hr_utility.set_location(l_proc, 15);
1157: --
1158: -- this means that, this is the first proposal, hence apply
1159: -- create proposal (i.e.first) or update proposal depending
1160: -- on the value of the l_pay_proposal_id
1165: -- raise the component error if any of the components
1166: -- were set. Note: the first proposal has no components.
1167: --
1168: if (l_is_component_not_null) then
1169: hr_utility.set_location(l_proc, 20);
1170: close csr_get_last_approved_salary;
1171: hr_utility.set_message(801,'HR_51312_PPC_COMP_NOT_ALLOWED');
1172: hr_utility.raise_error;
1173: end if;
1167: --
1168: if (l_is_component_not_null) then
1169: hr_utility.set_location(l_proc, 20);
1170: close csr_get_last_approved_salary;
1171: hr_utility.set_message(801,'HR_51312_PPC_COMP_NOT_ALLOWED');
1172: hr_utility.raise_error;
1173: end if;
1174: --
1175: if (l_trunc_date IS NULL AND p_proposed_salary IS NULL AND
1168: if (l_is_component_not_null) then
1169: hr_utility.set_location(l_proc, 20);
1170: close csr_get_last_approved_salary;
1171: hr_utility.set_message(801,'HR_51312_PPC_COMP_NOT_ALLOWED');
1172: hr_utility.raise_error;
1173: end if;
1174: --
1175: if (l_trunc_date IS NULL AND p_proposed_salary IS NULL AND
1176: p_proposal_reason IS NULL ) then
1176: p_proposal_reason IS NULL ) then
1177: --
1178: -- this means that no action need to be taken for this record
1179: --
1180: hr_utility.set_location(l_proc, 25);
1181: --
1182: else
1183: --
1184: -- p_next_sal_review_date is being set to null if it is
1190: -- This means that the record need to be inserted
1191: -- Note that the proposal gets approved automatically,
1192: -- because it is the first proposal.
1193: --
1194: hr_utility.set_location(l_proc, 30);
1195: l_multiple_components := 'N';
1196: --
1197: -- insert an unapproved single component salary proposal
1198: -- record in per_pay_proposal_table using the row_handler
1201: --Retain auto approve first proposal functionality if profile is null or set to Yes
1202: l_approved :='N';
1203: l_autoApprove:=fnd_profile.value('HR_AUTO_APPROVE_FIRST_PROPOSAL');
1204: if(l_autoApprove is null or l_autoApprove ='Y') then
1205: hr_utility.set_location(l_proc, 32);
1206: l_approved:='Y';
1207: end if;
1208: per_pyp_ins.ins
1209: (p_pay_proposal_id => l_pay_proposal_id
1257: open csr_get_element_detail;
1258: fetch csr_get_element_detail into l_element_type_id,
1259: l_input_value_id;
1260: if csr_get_element_detail%notfound then
1261: hr_utility.set_location(l_proc,35);
1262: close csr_get_element_detail;
1263: hr_utility.set_message(801,'HR_289855_SAL_ASS_NOT_SAL_ELIG');
1264: hr_utility.raise_error;
1265: else
1259: l_input_value_id;
1260: if csr_get_element_detail%notfound then
1261: hr_utility.set_location(l_proc,35);
1262: close csr_get_element_detail;
1263: hr_utility.set_message(801,'HR_289855_SAL_ASS_NOT_SAL_ELIG');
1264: hr_utility.raise_error;
1265: else
1266: close csr_get_element_detail;
1267: if (l_element_type_id IS NULL OR l_input_value_id IS NULL)
1260: if csr_get_element_detail%notfound then
1261: hr_utility.set_location(l_proc,35);
1262: close csr_get_element_detail;
1263: hr_utility.set_message(801,'HR_289855_SAL_ASS_NOT_SAL_ELIG');
1264: hr_utility.raise_error;
1265: else
1266: close csr_get_element_detail;
1267: if (l_element_type_id IS NULL OR l_input_value_id IS NULL)
1268: then
1265: else
1266: close csr_get_element_detail;
1267: if (l_element_type_id IS NULL OR l_input_value_id IS NULL)
1268: then
1269: hr_utility.set_location(l_proc,40);
1270: hr_utility.set_message
1271: (801,'HR_289855_SAL_ASS_NOT_SAL_ELIG');
1272: hr_utility.raise_error;
1273: else
1266: close csr_get_element_detail;
1267: if (l_element_type_id IS NULL OR l_input_value_id IS NULL)
1268: then
1269: hr_utility.set_location(l_proc,40);
1270: hr_utility.set_message
1271: (801,'HR_289855_SAL_ASS_NOT_SAL_ELIG');
1272: hr_utility.raise_error;
1273: else
1274: l_element_link_id := hr_entry_api.get_link
1268: then
1269: hr_utility.set_location(l_proc,40);
1270: hr_utility.set_message
1271: (801,'HR_289855_SAL_ASS_NOT_SAL_ELIG');
1272: hr_utility.raise_error;
1273: else
1274: l_element_link_id := hr_entry_api.get_link
1275: (p_assignment_id
1276: ,l_element_type_id
1275: (p_assignment_id
1276: ,l_element_type_id
1277: ,l_trunc_date);
1278: if l_element_link_id IS NULL then
1279: hr_utility.set_message
1280: (801,'HR_13016_SAL_ELE_NOT_ELIG');
1281: hr_utility.raise_error;
1282: end if;
1283: --
1277: ,l_trunc_date);
1278: if l_element_link_id IS NULL then
1279: hr_utility.set_message
1280: (801,'HR_13016_SAL_ELE_NOT_ELIG');
1281: hr_utility.raise_error;
1282: end if;
1283: --
1284: -- Now we insert an element entry for this proposal
1285: -- by calling the insert_element_entry_api.
1326: fetch csr_get_proposal_detail into l_change_date,l_proposed_salary_db,
1327: l_multiple_components,l_pyp_approved,l_proposal_reason,
1328: l_pyp_object_version_number;
1329: if csr_get_proposal_detail%notfound then
1330: hr_utility.set_location(l_proc,45);
1331: close csr_get_proposal_detail;
1332: hr_utility.set_message(801,'HR_51310_PPC_INVAL_PRO_ID');
1333: hr_utility.raise_error;
1334: else
1328: l_pyp_object_version_number;
1329: if csr_get_proposal_detail%notfound then
1330: hr_utility.set_location(l_proc,45);
1331: close csr_get_proposal_detail;
1332: hr_utility.set_message(801,'HR_51310_PPC_INVAL_PRO_ID');
1333: hr_utility.raise_error;
1334: else
1335: close csr_get_proposal_detail;
1336: --
1329: if csr_get_proposal_detail%notfound then
1330: hr_utility.set_location(l_proc,45);
1331: close csr_get_proposal_detail;
1332: hr_utility.set_message(801,'HR_51310_PPC_INVAL_PRO_ID');
1333: hr_utility.raise_error;
1334: else
1335: close csr_get_proposal_detail;
1336: --
1337: -- check that the object version number is the same (the record has
1337: -- check that the object version number is the same (the record has
1338: -- not been changed since it has been out via the HRMS)
1339: --
1340: if (l_pyp_object_version_number <> p_object_version_number) then
1341: hr_utility.set_location(l_proc,50);
1342: hr_utility.set_message(801,'HR_51348_PYP_RECORD_CHG');
1343: hr_utility.raise_error;
1344: end if;
1345: --
1338: -- not been changed since it has been out via the HRMS)
1339: --
1340: if (l_pyp_object_version_number <> p_object_version_number) then
1341: hr_utility.set_location(l_proc,50);
1342: hr_utility.set_message(801,'HR_51348_PYP_RECORD_CHG');
1343: hr_utility.raise_error;
1344: end if;
1345: --
1346: -- Check that the proposal is multiple or single component.
1339: --
1340: if (l_pyp_object_version_number <> p_object_version_number) then
1341: hr_utility.set_location(l_proc,50);
1342: hr_utility.set_message(801,'HR_51348_PYP_RECORD_CHG');
1343: hr_utility.raise_error;
1344: end if;
1345: --
1346: -- Check that the proposal is multiple or single component.
1347: -- if it is single_component and some components exists then
1348: -- raise error.
1349: --
1350: if (l_multiple_components = 'N') then
1351: if (l_is_component_not_null) then
1352: hr_utility.set_location(l_proc,55);
1353: hr_utility.set_message(801,'HR_51312_PPC_COMP_NOT_ALLOWED');
1354: hr_utility.raise_error;
1355: else
1356: --
1349: --
1350: if (l_multiple_components = 'N') then
1351: if (l_is_component_not_null) then
1352: hr_utility.set_location(l_proc,55);
1353: hr_utility.set_message(801,'HR_51312_PPC_COMP_NOT_ALLOWED');
1354: hr_utility.raise_error;
1355: else
1356: --
1357: -- check that the change_date has not been updated
1350: if (l_multiple_components = 'N') then
1351: if (l_is_component_not_null) then
1352: hr_utility.set_location(l_proc,55);
1353: hr_utility.set_message(801,'HR_51312_PPC_COMP_NOT_ALLOWED');
1354: hr_utility.raise_error;
1355: else
1356: --
1357: -- check that the change_date has not been updated
1358: -- This extra check is done here since the update api has
1360: -- the change date we need to do this validation before
1361: -- calling the update routine
1362: --
1363: if (l_trunc_date <> l_change_date) then
1364: hr_utility.set_location(l_proc,60);
1365: hr_utility.set_message(801,'HR_51349_PYP_CNT_UPD_CHG_DATE');
1366: hr_utility.raise_error;
1367: end if;
1368: --
1361: -- calling the update routine
1362: --
1363: if (l_trunc_date <> l_change_date) then
1364: hr_utility.set_location(l_proc,60);
1365: hr_utility.set_message(801,'HR_51349_PYP_CNT_UPD_CHG_DATE');
1366: hr_utility.raise_error;
1367: end if;
1368: --
1369: --
1362: --
1363: if (l_trunc_date <> l_change_date) then
1364: hr_utility.set_location(l_proc,60);
1365: hr_utility.set_message(801,'HR_51349_PYP_CNT_UPD_CHG_DATE');
1366: hr_utility.raise_error;
1367: end if;
1368: --
1369: --
1370: -- update the salary proposal
1404: ,p_attribute19 => p_attribute19
1405: ,p_attribute20 => p_attribute20
1406: );
1407: --
1408: hr_utility.set_location(l_proc,65);
1409: --
1410: end if;
1411: else
1412: --
1413: -- l_multiple_components = 'Y'
1414: -- This is when the proposal has multiple components.
1415: -- We need to calculate the sum of the components in this case
1416: --
1417: hr_utility.set_location(l_proc,70);
1418: l_component_cal := TRUE;
1419: --
1420: end if;
1421: --
1427: -- already existed( i.e. it need to be created).
1428: -- first of all we need to determine whether the proposal is of type
1429: -- multiple components or not. This is done by checking the components.
1430: --
1431: hr_utility.set_location(l_proc,75);
1432: if (l_is_component_not_null) then
1433: l_multiple_components := 'Y';
1434: l_component_cal := TRUE;
1435: hr_utility.set_location(l_proc,80);
1431: hr_utility.set_location(l_proc,75);
1432: if (l_is_component_not_null) then
1433: l_multiple_components := 'Y';
1434: l_component_cal := TRUE;
1435: hr_utility.set_location(l_proc,80);
1436: else l_multiple_components := 'N';
1437: hr_utility.set_location(l_proc,85);
1438: --
1439: end if;
1433: l_multiple_components := 'Y';
1434: l_component_cal := TRUE;
1435: hr_utility.set_location(l_proc,80);
1436: else l_multiple_components := 'N';
1437: hr_utility.set_location(l_proc,85);
1438: --
1439: end if;
1440: --
1441: if l_next_sal_review_date = hr_api.g_date then
1497: ,p_attribute19 => p_attribute19
1498: ,p_attribute20 => p_attribute20
1499: );
1500: --
1501: hr_utility.set_location(l_proc,90);
1502: --
1503: end if; -- l_pay_proposal_id is not null
1504: --
1505: end if; -- csr_get_last_approved_salary not found
1505: end if; -- csr_get_last_approved_salary not found
1506: --
1507: if (csr_get_last_approved_salary%isopen) then
1508: close csr_get_last_approved_salary;
1509: hr_utility.set_location(l_proc,95);
1510: end if;
1511: --
1512: if (csr_get_proposal_detail%isopen) then
1513: close csr_get_proposal_detail;
1510: end if;
1511: --
1512: if (csr_get_proposal_detail%isopen) then
1513: close csr_get_proposal_detail;
1514: hr_utility.set_location(l_proc,100);
1515: end if;
1516: --
1517: -- Now loop round the components and insert the components followed by
1518: -- updating the appropriate proposal
1517: -- Now loop round the components and insert the components followed by
1518: -- updating the appropriate proposal
1519: --
1520: if(l_component_cal = true and l_last_proposed_salary IS NOT NULL) then
1521: hr_utility.set_location(l_proc,105);
1522: for i in 1 .. MAX_COMP_NO
1523: loop
1524: --
1525: -- set the value of the local parameters to be the appropriate
1534: l_object_version_number_in := get_value(l_ovn_table,i);
1535:
1536:
1537: if (l_component_id_in IS NOT NULL ) then
1538: hr_utility.set_location(l_proc,110);
1539: open csr_get_component_detail (l_component_id_in);
1540: fetch csr_get_component_detail into l_component_reason, l_change_amount,
1541: l_change_percentage,l_ppc_approved, l_ppc_object_version_number;
1542: if csr_get_component_detail%notfound then
1540: fetch csr_get_component_detail into l_component_reason, l_change_amount,
1541: l_change_percentage,l_ppc_approved, l_ppc_object_version_number;
1542: if csr_get_component_detail%notfound then
1543: close csr_get_component_detail;
1544: hr_utility.set_location(l_proc,115);
1545: hr_utility.set_message(801,'HR_51319_PPC_INVAL_COMP_ID');
1546: hr_utility.raise_error;
1547: else
1548: close csr_get_component_detail;
1541: l_change_percentage,l_ppc_approved, l_ppc_object_version_number;
1542: if csr_get_component_detail%notfound then
1543: close csr_get_component_detail;
1544: hr_utility.set_location(l_proc,115);
1545: hr_utility.set_message(801,'HR_51319_PPC_INVAL_COMP_ID');
1546: hr_utility.raise_error;
1547: else
1548: close csr_get_component_detail;
1549: hr_utility.set_location(l_proc,120);
1542: if csr_get_component_detail%notfound then
1543: close csr_get_component_detail;
1544: hr_utility.set_location(l_proc,115);
1545: hr_utility.set_message(801,'HR_51319_PPC_INVAL_COMP_ID');
1546: hr_utility.raise_error;
1547: else
1548: close csr_get_component_detail;
1549: hr_utility.set_location(l_proc,120);
1550: --
1545: hr_utility.set_message(801,'HR_51319_PPC_INVAL_COMP_ID');
1546: hr_utility.raise_error;
1547: else
1548: close csr_get_component_detail;
1549: hr_utility.set_location(l_proc,120);
1550: --
1551: -- check that the record has not been changed since last time.
1552: --
1553: if (l_ppc_object_version_number <> l_object_version_number_in) then
1550: --
1551: -- check that the record has not been changed since last time.
1552: --
1553: if (l_ppc_object_version_number <> l_object_version_number_in) then
1554: hr_utility.set_location(l_proc,125);
1555: hr_utility.set_message(801,'HR_51455_PPC_RECORD_CHANGED');
1556: hr_utility.raise_error;
1557: end if;
1558: --
1551: -- check that the record has not been changed since last time.
1552: --
1553: if (l_ppc_object_version_number <> l_object_version_number_in) then
1554: hr_utility.set_location(l_proc,125);
1555: hr_utility.set_message(801,'HR_51455_PPC_RECORD_CHANGED');
1556: hr_utility.raise_error;
1557: end if;
1558: --
1559: -- Do nothing if the component has not changed at all.
1552: --
1553: if (l_ppc_object_version_number <> l_object_version_number_in) then
1554: hr_utility.set_location(l_proc,125);
1555: hr_utility.set_message(801,'HR_51455_PPC_RECORD_CHANGED');
1556: hr_utility.raise_error;
1557: end if;
1558: --
1559: -- Do nothing if the component has not changed at all.
1560: --
1567: --
1568: -- this means that the component has not changed
1569: -- we just adding the amount.
1570: --
1571: hr_utility.set_location(l_proc,130);
1572: l_component_sum
1573: := l_component_sum + l_change_amount;
1574: --
1575: elsif (l_component_reason = l_component_reason_in AND
1586: l_component_sum
1587: := l_component_sum + l_change_amount;
1588: l_comp_update := true;
1589: --
1590: hr_utility.set_location(l_proc,135);
1591: --
1592: -- issue an error if updating an approved component
1593: --
1594: elsif (l_ppc_approved = 'Y' AND
1596: nvl(l_change_amount,hr_api.g_number)
1597: <> nvl(l_change_amount_in,hr_api.g_number) OR
1598: nvl(l_change_percentage,hr_api.g_number)
1599: <> nvl(l_change_percentage_in,hr_api.g_number))) then
1600: hr_utility.set_location(l_proc,140);
1601: hr_utility.set_message(801,'HR_51454_PPC_CANT_UPD_COMP');
1602: hr_utility.raise_error;
1603: elsif (l_ppc_approved = 'N') then
1604: --
1597: <> nvl(l_change_amount_in,hr_api.g_number) OR
1598: nvl(l_change_percentage,hr_api.g_number)
1599: <> nvl(l_change_percentage_in,hr_api.g_number))) then
1600: hr_utility.set_location(l_proc,140);
1601: hr_utility.set_message(801,'HR_51454_PPC_CANT_UPD_COMP');
1602: hr_utility.raise_error;
1603: elsif (l_ppc_approved = 'N') then
1604: --
1605: -- This is when the component is not already approved and some
1598: nvl(l_change_percentage,hr_api.g_number)
1599: <> nvl(l_change_percentage_in,hr_api.g_number))) then
1600: hr_utility.set_location(l_proc,140);
1601: hr_utility.set_message(801,'HR_51454_PPC_CANT_UPD_COMP');
1602: hr_utility.raise_error;
1603: elsif (l_ppc_approved = 'N') then
1604: --
1605: -- This is when the component is not already approved and some
1606: -- changes has taken place, hence we need to update or delete
1612: --
1613: -- calculate the component_sum from the change_percentage
1614: -- and update the record.
1615: --
1616: hr_utility.set_location(l_proc,145);
1617: l_component_sum := l_component_sum +
1618: l_last_proposed_salary
1619: * l_change_percentage_in /100;
1620: --
1622: -- update the record and set the approved flag to Y
1623: --
1624: l_prop_update := true;
1625: l_comp_update := true;
1626: hr_utility.set_location(l_proc,150);
1627: else
1628: --
1629: -- the change_amount and the change percentage are
1630: -- both null, this means that the component need to
1642: := l_component_sum - l_change_amount;
1643:
1644: l_prop_update := true;
1645: --
1646: hr_utility.set_location(l_proc,155);
1647: --
1648: end if; -- l_change_percentage IS NOT NULL
1649: else
1650: --
1657: -- Set the comp_update and prop_update to true
1658: --
1659: l_comp_update := true;
1660: l_prop_update := true;
1661: hr_utility.set_location(l_proc,160);
1662: end if; -- l_change_amount_is not null
1663: --
1664: end if;
1665: --
1674: ,p_approved => l_approved_in
1675: ,p_object_version_number => l_object_version_number_in
1676: ,p_validate => false
1677: );
1678: hr_utility.set_location(l_proc, 165);
1679: end if;
1680: --
1681: end if; -- csr_get_component_details
1682: --
1693: l_prop_update := true;
1694: if (l_change_amount_in IS NOT NULL ) then
1695: l_component_sum := l_component_sum +
1696: l_change_amount_in;
1697: hr_utility.set_location(l_proc, 170);
1698: else
1699: if (l_change_percentage_in IS NOT NULL) then
1700: l_component_sum := l_component_sum +
1701: l_last_proposed_salary *
1699: if (l_change_percentage_in IS NOT NULL) then
1700: l_component_sum := l_component_sum +
1701: l_last_proposed_salary *
1702: l_change_percentage_in /100;
1703: hr_utility.set_location(l_proc, 175);
1704: end if;
1705: --
1706: end if;
1707: --
1715: ,p_approved => l_approved_in
1716: ,p_object_version_number => l_object_version_number_in
1717: ,p_validate => false
1718: );
1719: hr_utility.set_location(l_proc, 180);
1720: --
1721: end if;
1722: end if; -- the l_component_id is null
1723: --
1799: ,p_payroll_warning => l_payroll_warning
1800: ,p_validate => false
1801: );
1802: --
1803: hr_utility.set_location(l_proc, 185);
1804: end if;
1805: end if; -- L_component_cal
1806: --
1807: -- Call After Process User Hook upload_salary_proposal
1936: p_component_id_10 := l_component_id_10;
1937: p_ppc_object_version_number_10:= l_ppc_ovn_10;
1938:
1939: --
1940: hr_utility.set_location(' Leaving:'||l_proc, 190);
1941: exception
1942: when hr_api.validate_enabled then
1943: --
1944: -- As the Validate_Enabled exception has been raised
1975: p_ppc_object_version_number_9 := lt_ppc_ovn_9;
1976: p_component_id_10 := lt_component_id_10;
1977: p_ppc_object_version_number_10:= lt_ppc_ovn_10;
1978: --
1979: hr_utility.set_location(' Leaving:'||l_proc, 195);
1980: --
1981: when others then
1982: --
1983: -- A validation or unexpected error has occurred