DBA Data[Home] [Help]

PACKAGE: APPS.HR_ASSIGNMENT_INTERNAL

Source


1 Package hr_assignment_internal AUTHID CURRENT_USER as
2 /* $Header: peasgbsi.pkh 120.3.12020000.2 2012/12/12 07:10:59 shpatro ship $ */
3 --
4 -- 70.2 change a start.
5 --
6 -- Start of 3335915
7    g_called_from_spp_asg boolean := false;
8 -- End of 3335915
9 -- ----------------------------------------------------------------------------
10 -- |------------------< actual_term_emp_asg_sup (overloaded) >----------------|
11 -- ----------------------------------------------------------------------------
12 -- {Start Of Comments}
13 --
14 -- This version of the API is now out-of-date however it has been provided to
15 -- you for backward compatibility support and will be removed in the future.
16 -- Oracle recommends you to modify existing calling programs in advance of the
17 -- support being withdrawn thus avoiding any potential disruption.
18 --
19 -- {End Of Comments}
20 --
21 procedure actual_term_emp_asg_sup
22   (p_assignment_id                in     number
23   ,p_object_version_number        in out nocopy number
24   ,p_actual_termination_date      in     date
25   ,p_last_standard_process_date   in     date
26   ,p_assignment_status_type_id    in     number
27   ,p_effective_start_date            out nocopy date
28   ,p_effective_end_date              out nocopy date
29   ,p_asg_future_changes_warning      out nocopy boolean
30   ,p_entries_changed_warning         out nocopy varchar2
31   ,p_pay_proposal_warning            out nocopy boolean
32   );
33 -- ----------------------------------------------------------------------------
34 -- |------------------------< actual_term_emp_asg_sup >-----------------------|
35 -- ----------------------------------------------------------------------------
36 -- {Start Of Comments}
37 --
38 -- Description:
39 --   This procedure processes one employee assignment when the actual
40 --   termination date is entered. This logic is common to the
41 --   'actual_termination_emp_asg' and 'actual_termination_emp' business
42 --   processes.
43 --
44 --   The 'actual_termination_emp_asg' business process only allows the user to
45 --   terminate one non-primary assignment at a time. Where as the
46 --   'actual_termination_emp' business process needs to terminate all
47 --   non-primary assignments and the primary assignment.
48 --
49 --   This business support process assumes the p_actual_termination_date,
50 --   p_last_standard_process_date and p_assignment_status_type_id parameters
51 --   have been correctly validated or derived by the calling logic. For US
52 --   legislation p_last_standard_process_date should always be set to null.
53 --   This will ensure unnecessary logic is not executed.
54 --
55 --   This business support process updates the assignment, date effectively
56 --   deletes element entries where the corresponding element termination rule
57 --   is actual_termination or last_standard_process, deletes affected
58 --   unprocessed run results, deletes affected pay proposals and deletes
59 --   affected assignment link usages.
60 --
61 -- Prerequisites:
62 --   A valid assignment (p_assignment_id) must exist as of the actual
63 --   termination date (p_actual_termination_date).
64 --
65 -- In Parameters:
66 --   Name                           Reqd Type     Description
67 --   p_assignment_id                 Yes number
68 --   p_actual_termination_date       Yes date
69 --   p_last_standard_process_date    Yes date
70 --   p_assignment_status_type_id     Yes number
71 --
72 -- Post Success:
73 --
74 --   Name                           Type     Description
75 --   p_object_version_number        number   The version number of this
76 --                                           assignment, as of the actual
77 --                                           termination date + 1.
78 --   p_effective_start_date         date     Effective start date of the
79 --                                           assignment row, which exists as of
80 --                                           the actual termination date.
81 --   p_effective_end_date           date     Effective end date of the
82 --                                           assignment row, which exists as of
83 --                                           the actual termination date.
84 --   p_asg_future_changes_warning   boolean  Set to true if at least one
85 --                                           assignment change, after the
86 --                                           actual termination date, has been
87 --                                           overwritten with the new
88 --                                           assignment status type. Set to
89 --                                           false when there are no changes in
90 --                                           the future.
91 --   p_entries_changed_warning      varchar2 Set to 'Y' when at least one
92 --                                           element entry was altered due to
93 --                                           the assignment change.
94 --                                           Set to 'S' if at least one salary
95 --                                           element entry was affected.
96 --                                           ('S' is a more specific case of
97 --                                           'Y' because non-salary entries may
98 --                                           or may not have been affected at
99 --                                           the same time). Otherwise set to
100 --                                           'N', when no element entries were
101 --                                           changed.
102 --   p_pay_proposal_warning         boolean  Set to true if any pay proposals
103 --                                           existing after the
104 --					     actual_termination_date,has been
105 --                                           deleted. Set to false when there
106 --                                           are no pay proposals after actual_
107 --                                           termination_date.
108 --   p_alu_change_warning           varchar2 Set to 'Y' when the termination
109 --                                           date will result in elements not
110 --                                           getting picked in the costing run
111 -- Post Failure:
112 --   The process will not process the assignment and raises an error.
113 --
114 -- Access Status:
115 --   Internal Development Use Only.
116 --
117 -- {End Of Comments}
118 --
119 procedure actual_term_emp_asg_sup
120   (p_assignment_id                in     number
121   ,p_object_version_number        in out nocopy number
122   ,p_actual_termination_date      in     date
123   ,p_last_standard_process_date   in     date
124   ,p_assignment_status_type_id    in     number
125   ,p_effective_start_date            out nocopy date
126   ,p_effective_end_date              out nocopy date
127   ,p_asg_future_changes_warning      out nocopy boolean
128   ,p_entries_changed_warning         out nocopy varchar2
129   ,p_pay_proposal_warning            out nocopy boolean
130   ,p_alu_change_warning              out nocopy varchar2
131   );
132 -- 70.2 change a end.
133 --
134 -- ----------------------------------------------------------------------------
135 -- |---------------------------< delete_first_spp >---------------------------|
136 -- ----------------------------------------------------------------------------
137 -- Description:
138 -- This is used in the case that you need to remove next change on the assignemnt
139 -- form and the next record has a grade step placement assigned which is the
140 -- the first date tracked fecord for this assignment on the table
141 -- per_spinal_point_placements_f.
142 -- The process removes next changes until the effective end date of the record
143 -- on per_spinal_point_placements_f matches the validation end date and then
144 -- this single record is then deleted using DML.
145 --
146 -- In Parameters
147 --   Name                           Reqd Type     Description
148 --   p_effective_date		    Yes  Date     Effective date that assigment
149 --						  record was updated.
150 --   p_assignment_id		    Yes  Number   Assignment id number
151 --   p_validation_start_date	    Yes  Date	  Start date of assignment record
152 --						  that is being removed.
153 --   p_validation_end_date	    Yes  Date	  End date of assignment record
154 --                                                that is being removed.
155 --
156 -- Out Parameters
157 --   Name                           Reqd Type     Description
158 --   p_future_spp_warning	    Yes  boolean  Set to yes if there are changes
159 --						  to the step for the period
160 --						  based on the validations dates
161 --						  other than the one starting
162 --						  on the validation_start_date.
163 --
164 -- Post Success
165 --  First record from spp deleted
166 --
167 -- Post Failure:
168 --  Nothing is modified.
169 --
170 -- Access Status:
171 --   Internal Development Use Only.
172 --
173 -- {End Of Comments}
174 --
175 procedure delete_first_spp
176   (p_effective_date             in     date
177   ,p_assignment_id              in     number
178   ,p_validation_start_date      in     date
179   ,p_validation_end_date        in     date
180   ,p_future_spp_warning            out nocopy boolean
181   );
182 --
183 -- ----------------------------------------------------------------------------
184 -- |------------------------< create_default_emp_asg >------------------------|
185 -- ----------------------------------------------------------------------------
186 -- {Start Of Comments}
187 --
188 -- Description:
189 --  This business support process creates a default employee assignment,
190 --  including the relevant standard element entries and assignment budget
191 --  values. This process only contains the common functionality for business
192 --  processes which need to create an initial primary assignment for an
193 --  employee, eg. 'create_employee'.
194 --
195 -- Prerequisites:
196 --   A valid person (p_person_id) must exist as of the effective insert date
197 --   (p_effective_date).
198 --   A valid period of service (p_period_of_service_id) must exist for this
199 --   person (p_person_id).
200 --   A valid business group (p_business_group_id)i must exist.
201 --
202 -- In Parameters:
203 --   Name                           Reqd Type     Description
204 --   p_effective_date                Yes date     The date from which this
205 --                                                assignment applies.
206 --   p_person_id                     Yes number
207 --   p_business_group_id             Yes number
208 --   p_period_of_service_id          Yes number
209 --
210 --
211 -- Post Success:
212 --
213 --   Name                           Type     Description
214 --   p_assignment_id                number   Uniquely identifies the assignment
215 --                                           created.
216 --   p_object_version_number        number   The version number of this
217 --                                           assignment.
218 --   p_assignment_sequence          number   Assignment sequence
219 --   p_assignment_number            varchar2 Assignment number
220 --
221 --
222 -- Post Failure:
223 --   The process will not create the assignment and raises an error.
224 --
225 -- Access Status:
226 --   Internal Development Use Only.
227 --
228 -- {End Of Comments}
229 --
230 procedure create_default_emp_asg
231   (p_effective_date               in     date
232   ,p_person_id                    in     number
233   ,p_business_group_id            in     number
234   ,p_period_of_service_id         in     number
235   ,p_assignment_id                   out nocopy number
236   ,p_object_version_number           out nocopy number
237   ,p_assignment_sequence             out nocopy number
238   ,p_assignment_number               out nocopy varchar2
239   );
240 --
241 -- ----------------------------------------------------------------------------
242 -- |------------------------< create_default_cwk_asg >------------------------|
243 -- ----------------------------------------------------------------------------
244 -- {Start Of Comments}
245 --
246 -- Description:
247 --  This business support process creates a default non payrolled worker
248 --  assignment,including the relevant standard element entries and assignment
249 --  budget values. This process only contains the common functionality for
250 --  business processes which need to create an initial primary assignment for
251 --  an employee, eg. 'create_employee'.
252 --
253 -- Prerequisites:
254 --   A valid person (p_person_id) must exist as of the effective insert date
255 --   (p_effective_date).
256 --   A valid period of placement (p_period_of_placement_id) must exist for this
257 --   person (p_person_id).
258 --   A valid business group (p_business_group_id)i must exist.
259 --
260 -- In Parameters:
261 --   Name                           Reqd Type     Description
262 --   p_effective_date                Yes date     The date from which this
263 --                                                assignment applies.
264 --   p_person_id                     Yes number
265 --   p_business_group_id             Yes number
266 --   p_placement_date_start          Yes date
267 --
268 --
269 -- Post Success:
270 --
271 --   Name                           Type     Description
272 --   p_assignment_id                number   Uniquely identifies the assignment
273 --                                           created.
274 --   p_object_version_number        number   The version number of this
275 --                                           assignment.
276 --   p_assignment_sequence          number   Assignment sequence
277 --   p_assignment_number            varchar2 Assignment number
278 --
279 --
280 -- Post Failure:
281 --   The process will not create the assignment and raises an error.
282 --
283 -- Access Status:
284 --   Internal Development Use Only.
285 --
286 -- {End Of Comments}
287 --
288 procedure create_default_cwk_asg
289   (p_effective_date                 in     date
290   ,p_person_id                      in     number
291   ,p_business_group_id              in     number
292   ,p_placement_date_start           in     date
293   ,p_assignment_id                   out nocopy number
294   ,p_object_version_number           out nocopy number
295   ,p_assignment_sequence             out nocopy number
296   ,p_assignment_number               out nocopy varchar2
297   );
298 --
299 -- ----------------------------------------------------------------------------
300 -- |------------------------< create_cwk_asg >--------------------------------|
301 -- ----------------------------------------------------------------------------
302 -- {Start Of Comments}
303 --
304 -- Description:
305 --  This is a common intermal routine used by create_default_cwk_asg
306 --  and create_secondary_cwk_asg to handle the insert of the assignment row.
307 --
308 -- Prerequisites:
309 --   A valid person (p_person_id) must exist as of the effective insert date
310 --   (p_effective_date).
311 --   A valid period of placement (p_placement_date_start) must exist for this
312 --   person (p_person_id).
313 --   A valid business group (p_business_group_id)i must exist.
314 --
315 -- In Parameters:
316 --   Name                           Reqd Type     Description
317 --   p_effective_date                 Yes date     The date from which this
318 --                                                 assignment applies.
319 --   p_person_id                      Yes number   Person
320 --   p_business_group_id              Yes number   Business Group
321 --   p_legislation_code               Yes varchar2 used to validate asg. status
322 --   p_placement_date_start           Yes date     Date of Period of placement for this asg.
323 --   p_organization_id                   number   Organization
324 --   p_primary_flag                      varchar2 marks primary assignment
325 --   p_assignment_number                 varchar2
326 --   p_assignment_category               varchar2
327 --   p_assignment_status_type_id         number
328 --   p_change_reason                     varchar2 reason for change of status
329 --   p_comments                          varchar2
330 --   p_default_code_comb_id              number
331 --   p_employment_category               varchar2
332 --   p_establishment_id                  number
333 --   p_frequency                         varchar2
334 --   p_internal_address_flag             varchar2
335 --   p_job_id                            number
336 --   p_labour_union_member_flag          varchar2
337 --   p_location_id                       number
338 --   p_manager_flag                      varchar2
339 --   p_normal_hours                      number
340 --   p_position_id                       number
341 --   p_grade_id                          number   This parameter is obsoleted.
342 --                                                Grade should not be maintained for CWK asg.
343 --   p_project_title                     varchar2
344 --   p_title                             varchar2
345 --   p_set_of_books_id                   number
346 --   p_source_type                       varchar2
347 --   p_supervisor_id                     number
348 --   p_time_normal_finish                varchar2
349 --   p_time_normal_start                 varchar2
350 --   p_vendor_assignment_number          varchar2
351 --   p_vendor_employee_number            varcahr2
352 --   p_vendor_id                         number  Supplier of assignment
353 --   p_vendor_site_id                    number  Supplier site of assignment
354 --   p_po_header_id                      number  Purchase Order ref for assignment
355 --   p_po_line_id                        number  Purchase Order line for assignment
356 --   p_projected_assignment_end          date    Projected end date of assignment
357 --   p_people_group_id                   number
358 --   p_soft_coding_keyflex_id            number
359 --   p_ass_attribute_category            varchar2
360 --   p_ass_attribute1                    varchar2 Descriptive flexfield.
361 --   p_ass_attribute2                    varchar2 Descriptive flexfield.
362 --   p_ass_attribute3                    varchar2 Descriptive flexfield.
363 --   p_ass_attribute4                    varchar2 Descriptive flexfield.
364 --   p_ass_attribute5                    varchar2 Descriptive flexfield.
365 --   p_ass_attribute6                    varchar2 Descriptive flexfield.
366 --   p_ass_attribute7                    varchar2 Descriptive flexfield.
367 --   p_ass_attribute8                    varchar2 Descriptive flexfield.
368 --   p_ass_attribute9                    varchar2 Descriptive flexfield.
369 --   p_ass_attribute10                   varchar2 Descriptive flexfield.
370 --   p_ass_attribute11                   varchar2 Descriptive flexfield.
371 --   p_ass_attribute12                   varchar2 Descriptive flexfield.
372 --   p_ass_attribute13                   varchar2 Descriptive flexfield.
373 --   p_ass_attribute14                   varchar2 Descriptive flexfield.
374 --   p_ass_attribute15                   varchar2 Descriptive flexfield.
375 --   p_ass_attribute16                   varchar2 Descriptive flexfield.
376 --   p_ass_attribute17                   varchar2 Descriptive flexfield.
377 --   p_ass_attribute18                   varchar2 Descriptive flexfield.
378 --   p_ass_attribute19                   varchar2 Descriptive flexfield.
379 --   p_ass_attribute20                   varchar2 Descriptive flexfield.
380 --   p_ass_attribute21                   varchar2 Descriptive flexfield.
381 --   p_ass_attribute22                   varchar2 Descriptive flexfield.
382 --   p_ass_attribute23                   varchar2 Descriptive flexfield.
383 --   p_ass_attribute24                   varchar2 Descriptive flexfield.
384 --   p_ass_attribute25                   varchar2 Descriptive flexfield.
385 --   p_ass_attribute26                   varchar2 Descriptive flexfield.
386 --   p_ass_attribute27                   varchar2 Descriptive flexfield.
387 --   p_ass_attribute28                   varchar2 Descriptive flexfield.
388 --   p_ass_attribute29                   varchar2 Descriptive flexfield.
389 --   p_ass_attribute30                   varchar2 Descriptive flexfield.
390 --   p_validate_df_flex                  boolean  perform/bypass descriptive
391 --                                                flexfield validation
392 --   p_supervisor_assignment_id          number   default null
393 --
394 -- Post Success:
395 --
396 --   Name                           Type     Description
397 --   p_assignment_id                number   Uniquely identifies the assignment
398 --                                           created.
399 --   p_object_version_number        number   The version number of this
400 --                                           assignment.
401 --   p_effective_start_date         date     The date from which this
402 --                                           assignment row is applied.
403 --   p_effective_end_date           date     The last date on which this
404 --                                           assignment row applies.
405 --   p_assignment_sequence          number   Assignment sequence
406 --   p_assignment_number            varchar2 Assignment number
407 --   p_comment_id                   number   Comments for this assignment
408 --   p_other_manager_warning        boolean  Set to true if manager_flag is 'Y'
409 --                                           and a manager already exists in
410 --                                           the organization
411 --                                           (p_organization_id) as of
412 --                                           p_effective_date.
413 --
414 -- Post Failure:
415 --   The process will not create the assignment and raises an error.
416 --
417 -- Access Status:
418 --   Internal Development Use Only.
419 --
420 -- {End Of Comments}
421 --
422 procedure create_cwk_asg
423   (p_validate                        in     boolean    default false
424   ,p_effective_date                  in     date
425   ,p_business_group_id               in     number
426   ,p_legislation_code                in     varchar2
427   ,p_person_id                       in     number
428   ,p_placement_date_start            in     date
429   ,p_organization_id                 in     number
430   ,p_primary_flag                    in     varchar2
431   ,p_assignment_number               in out nocopy varchar2
432   ,p_assignment_category             in     varchar2 default null
433   ,p_assignment_status_type_id       in     number   default null
434   ,p_change_reason                   in     varchar2 default null
435   ,p_comments                        in     varchar2 default null
436   ,p_default_code_comb_id            in     number   default null
437   ,p_employment_category             in     varchar2 default null
438   ,p_establishment_id                in     number   default null
439   ,p_frequency                       in     varchar2 default null
440   ,p_internal_address_line           in     varchar2 default null
441   ,p_job_id                          in     number   default null
442   ,p_labor_union_member_flag         in     varchar2 default null
443   ,p_location_id                     in     number   default null
447   ,p_grade_id                        in     number   default null
444   ,p_manager_flag                    in     varchar2 default null
445   ,p_normal_hours                    in     number   default null
446   ,p_position_id                     in     number   default null
448   ,p_project_title                   in     varchar2 default null
449   ,p_title                           in     varchar2 default null
450   ,p_set_of_books_id                 in     number   default null
451   ,p_source_type                     in     varchar2 default null
452   ,p_supervisor_id                   in     number   default null
453   ,p_time_normal_start               in     varchar2 default null
454   ,p_time_normal_finish              in     varchar2 default null
455   ,p_vendor_assignment_number        in     varchar2 default null
456   ,p_vendor_employee_number          in     varchar2 default null
457   ,p_vendor_id                       in     number   default null
458   ,p_vendor_site_id                  in     number   default null
459   ,p_po_header_id                    in     number   default null
460   ,p_po_line_id                      in     number   default null
461   ,p_projected_assignment_end        in     date     default null
462   ,p_people_group_id                 in     number   default null
463   ,p_soft_coding_keyflex_id          in     number   default null
464   ,p_ass_attribute_category       in     varchar2 default null
465   ,p_ass_attribute1               in     varchar2 default null
466   ,p_ass_attribute2               in     varchar2 default null
467   ,p_ass_attribute3               in     varchar2 default null
468   ,p_ass_attribute4               in     varchar2 default null
469   ,p_ass_attribute5               in     varchar2 default null
470   ,p_ass_attribute6               in     varchar2 default null
471   ,p_ass_attribute7               in     varchar2 default null
472   ,p_ass_attribute8               in     varchar2 default null
473   ,p_ass_attribute9               in     varchar2 default null
474   ,p_ass_attribute10              in     varchar2 default null
475   ,p_ass_attribute11              in     varchar2 default null
476   ,p_ass_attribute12              in     varchar2 default null
477   ,p_ass_attribute13              in     varchar2 default null
478   ,p_ass_attribute14              in     varchar2 default null
479   ,p_ass_attribute15              in     varchar2 default null
480   ,p_ass_attribute16              in     varchar2 default null
481   ,p_ass_attribute17              in     varchar2 default null
482   ,p_ass_attribute18              in     varchar2 default null
483   ,p_ass_attribute19              in     varchar2 default null
484   ,p_ass_attribute20              in     varchar2 default null
485   ,p_ass_attribute21              in     varchar2 default null
486   ,p_ass_attribute22              in     varchar2 default null
487   ,p_ass_attribute23              in     varchar2 default null
488   ,p_ass_attribute24              in     varchar2 default null
489   ,p_ass_attribute25              in     varchar2 default null
490   ,p_ass_attribute26              in     varchar2 default null
491   ,p_ass_attribute27              in     varchar2 default null
492   ,p_ass_attribute28              in     varchar2 default null
493   ,p_ass_attribute29              in     varchar2 default null
494   ,p_ass_attribute30              in     varchar2 default null
495   ,p_validate_df_flex             in     boolean  default true
496   ,p_supervisor_assignment_id     in     number   default null
497   ,p_assignment_id                   out nocopy number
498   ,p_object_version_number           out nocopy number
499   ,p_effective_start_date            out nocopy date
500   ,p_effective_end_date              out nocopy date
501   ,p_assignment_sequence             out nocopy number
502   ,p_comment_id                      out nocopy number
503   ,p_other_manager_warning           out nocopy boolean
504   );
505 --
506 -- ----------------------------------------------------------------------------
507 -- |-----------------------------< create_emp_asg >---------------------------|
508 -- ----------------------------------------------------------------------------
509 -- {Start Of Comments}
510 --
511 -- Description:
512 --  This business support process creates a new employee assignment, including
513 --  the relevant standard element entries and assignment budget values. This
514 --  process can be called in one of two situations from other business support
515 --  processes:
516 --      create_default_emp_asg   - part of creating a new employee
517 --      create_secondary_emp_asg - create a non-primary employee assignment.
518 --  This process only contains the common functionality for the above two
519 --  processes.
520 --
521 -- Prerequisites:
522 --   A valid person (p_person_id) must exist as of the effective insert date
523 --   (p_effective_date).
524 --   A valid period of service (p_period_of_service_id) must exist for this
525 --   person (p_person_id).
526 --   A valid legislation (p_legislation_code) must exist for the assignment's
527 --   business group (p_business_group_id).
528 --
529 -- In Parameters:
530 --   Name                           Reqd Type     Description
531 --   p_effective_date                Yes date     The date from which this
532 --                                                assignment applies.
533 --   p_legislation_code              Yes varchar2
534 --   p_business_group_id             Yes number
535 --   p_person_id                     Yes number
536 --   p_organization_id               Yes number
537 --   p_primary_flag                  Yes varchar2
538 --   p_period_of_service_id          Yes number
539 --   p_grade_id                          number
540 --   p_position_id                       number
541 --   p_job_id                            number
542 --   p_assignment_status_type_id         number
543 --   p_payroll_id                        number
544 --   p_location_id                       number
545 --   p_supervisor_id                     number
546 --   p_special_ceiling_step_id           number
547 --   p_people_group_id                   number
548 --   p_soft_coding_keyflex_id            number
549 --   p_pay_basis_id                      number
550 --   p_assignment_number                 varchar2
551 --   p_change_reason                     varchar2
552 --   p_comments                          varchar2
553 --   p_date_probation_end                date
554 --   p_default_code_comb_id              number
555 --   p_employment_category               varchar2
556 --   p_frequency                         varchar2
557 --   p_internal_address_line             varchar2
558 --   p_manager_flag                      varchar2
559 --   p_normal_hours                      number
560 --   p_perf_review_period                number
561 --   p_perf_review_period_frequency      varchar2
562 --   p_probation_period                  number
563 --   p_probation_unit                    varchar2
564 --   p_sal_review_period                 number
565 --   p_sal_review_period_frequency       varchar2
566 --   p_set_of_books_id                   number
567 --   p_source_type                       varchar2
568 --   p_time_normal_finish                varchar2
569 --   p_time_normal_start                 varchar2
570 --   p_bargaining_unit_code              varchar2
571 --   p_labour_union_member_flag          varchar2
572 --   p_hourly_salaried_code              varchar2
573 --   p_ass_attribute_category            varchar2
574 --   p_ass_attribute1                    varchar2 Descriptive flexfield.
575 --   p_ass_attribute2                    varchar2 Descriptive flexfield.
576 --   p_ass_attribute3                    varchar2 Descriptive flexfield.
577 --   p_ass_attribute4                    varchar2 Descriptive flexfield.
578 --   p_ass_attribute5                    varchar2 Descriptive flexfield.
579 --   p_ass_attribute6                    varchar2 Descriptive flexfield.
580 --   p_ass_attribute7                    varchar2 Descriptive flexfield.
581 --   p_ass_attribute8                    varchar2 Descriptive flexfield.
582 --   p_ass_attribute9                    varchar2 Descriptive flexfield.
583 --   p_ass_attribute10                   varchar2 Descriptive flexfield.
584 --   p_ass_attribute11                   varchar2 Descriptive flexfield.
585 --   p_ass_attribute12                   varchar2 Descriptive flexfield.
586 --   p_ass_attribute13                   varchar2 Descriptive flexfield.
587 --   p_ass_attribute14                   varchar2 Descriptive flexfield.
588 --   p_ass_attribute15                   varchar2 Descriptive flexfield.
589 --   p_ass_attribute16                   varchar2 Descriptive flexfield.
590 --   p_ass_attribute17                   varchar2 Descriptive flexfield.
591 --   p_ass_attribute18                   varchar2 Descriptive flexfield.
592 --   p_ass_attribute19                   varchar2 Descriptive flexfield.
593 --   p_ass_attribute20                   varchar2 Descriptive flexfield.
594 --   p_ass_attribute21                   varchar2 Descriptive flexfield.
595 --   p_ass_attribute22                   varchar2 Descriptive flexfield.
596 --   p_ass_attribute23                   varchar2 Descriptive flexfield.
597 --   p_ass_attribute24                   varchar2 Descriptive flexfield.
598 --   p_ass_attribute25                   varchar2 Descriptive flexfield.
599 --   p_ass_attribute26                   varchar2 Descriptive flexfield.
600 --   p_ass_attribute27                   varchar2 Descriptive flexfield.
601 --   p_ass_attribute28                   varchar2 Descriptive flexfield.
602 --   p_ass_attribute29                   varchar2 Descriptive flexfield.
603 --   p_ass_attribute30                   varchar2 Descriptive flexfield.
604 --   p_title                             varchar2
605 --   p_contract_id                       number
606 --   p_establishment_id                  number
607 --   p_collective_agreement_id           number
608 --   p_cagr_id_flex_num                  number
609 --   p_cagr_grade_def_id                 number
610 --   p_notice_period                     in number   Notice Period
611 --   p_notice_period_uom                 in varchar2 Notice Period Units
612 --   p_employee_category                 in varchar2 Employee Category
613 --   p_work_at_home                      in varchar2 Work At Home
614 --   p_job_post_source_name		 in varchar2 Job Source
615 --   p_validate_df_flex                  boolean  perform/bypass descriptive
616 --                                                flexfield validation
617 --   p_grade_ladder_pgm_id               number
618 --   p_supervisor_assignment_id          number
619 --
620 --
621 -- Post Success:
622 --
623 --   Name                           Type     Description
624 --   p_assignment_id                number   Uniquely identifies the assignment
625 --                                           created.
626 --   p_object_version_number        number   The version number of this
627 --                                           assignment.
628 --   p_effective_start_date         date     The date from which this
629 --                                           assignment row is applied.
630 --   p_effective_end_date           date     The last date on which this
631 --                                           assignment row applies.
632 --   p_assignment_sequence          number
633 --   p_assignment_number            varchar2 Validated or generated
634 --                                           assignment number.
635 --   p_comment_id                   number
636 --   p_other_manager_warning        boolean  Set to true if manager_flag is 'Y'
637 --                                           and a manager already exists in
638 --                                           the organization
639 --                                           (p_organization_id) as of
640 --                                           p_effective_date.
641 --
642 --
643 -- Post Failure:
644 --   The process will not create the assignment and raises an error.
645 --
646 -- Access Status:
647 --   Internal Development Use Only.
648 --
649 -- {End Of Comments}
650 --
651 procedure create_emp_asg
652   (p_effective_date               in     date
653   ,p_legislation_code             in     varchar2
654   ,p_business_group_id            in     number
655   ,p_person_id                    in     number
656   ,p_organization_id              in     number
657   ,p_primary_flag                 in     varchar2
658   ,p_period_of_service_id         in     number
659   ,p_grade_id                     in     number   default null
660   ,p_position_id                  in     number   default null
661   ,p_job_id                       in     number   default null
662   ,p_assignment_status_type_id    in     number   default null
663   ,p_payroll_id                   in     number   default null
664   ,p_location_id                  in     number   default null
665   ,p_supervisor_id                in     number   default null
666   ,p_special_ceiling_step_id      in     number   default null
667   ,p_people_group_id              in     number   default null
668   ,p_soft_coding_keyflex_id       in     number   default null
669   ,p_pay_basis_id                 in     number   default null
670   ,p_assignment_number            in out nocopy varchar2
671   ,p_change_reason                in     varchar2 default null
672   ,p_comments                     in     varchar2 default null
673   ,p_date_probation_end           in     date     default null
674   ,p_default_code_comb_id         in     number   default null
675   ,p_employment_category          in     varchar2 default null
676   ,p_frequency                    in     varchar2 default null
677   ,p_internal_address_line        in     varchar2 default null
678   ,p_manager_flag                 in     varchar2 default null
679   ,p_normal_hours                 in     number   default null
680   ,p_perf_review_period           in     number   default null
681   ,p_perf_review_period_frequency in     varchar2 default null
682   ,p_probation_period             in     number   default null
683   ,p_probation_unit               in     varchar2 default null
684   ,p_sal_review_period            in     number   default null
685   ,p_sal_review_period_frequency  in     varchar2 default null
686   ,p_set_of_books_id              in     number   default null
687   ,p_source_type                  in     varchar2 default null
688   ,p_time_normal_finish           in     varchar2 default null
689   ,p_time_normal_start            in     varchar2 default null
690   ,p_bargaining_unit_code         in     varchar2 default null
691   ,p_labour_union_member_flag     in     varchar2 default 'N'
692   ,p_hourly_salaried_code         in     varchar2 default null
693   ,p_ass_attribute_category       in     varchar2 default null
694   ,p_ass_attribute1               in     varchar2 default null
695   ,p_ass_attribute2               in     varchar2 default null
696   ,p_ass_attribute3               in     varchar2 default null
697   ,p_ass_attribute4               in     varchar2 default null
698   ,p_ass_attribute5               in     varchar2 default null
699   ,p_ass_attribute6               in     varchar2 default null
700   ,p_ass_attribute7               in     varchar2 default null
701   ,p_ass_attribute8               in     varchar2 default null
702   ,p_ass_attribute9               in     varchar2 default null
703   ,p_ass_attribute10              in     varchar2 default null
704   ,p_ass_attribute11              in     varchar2 default null
705   ,p_ass_attribute12              in     varchar2 default null
706   ,p_ass_attribute13              in     varchar2 default null
707   ,p_ass_attribute14              in     varchar2 default null
708   ,p_ass_attribute15              in     varchar2 default null
709   ,p_ass_attribute16              in     varchar2 default null
710   ,p_ass_attribute17              in     varchar2 default null
711   ,p_ass_attribute18              in     varchar2 default null
712   ,p_ass_attribute19              in     varchar2 default null
713   ,p_ass_attribute20              in     varchar2 default null
714   ,p_ass_attribute21              in     varchar2 default null
715   ,p_ass_attribute22              in     varchar2 default null
716   ,p_ass_attribute23              in     varchar2 default null
717   ,p_ass_attribute24              in     varchar2 default null
718   ,p_ass_attribute25              in     varchar2 default null
719   ,p_ass_attribute26              in     varchar2 default null
720   ,p_ass_attribute27              in     varchar2 default null
721   ,p_ass_attribute28              in     varchar2 default null
722   ,p_ass_attribute29              in     varchar2 default null
723   ,p_ass_attribute30              in     varchar2 default null
724   ,p_title                        in     varchar2 default null
725   ,p_contract_id                  in     number   default null
726   ,p_establishment_id             in     number   default null
727   ,p_collective_agreement_id      in     number   default null
728   ,p_cagr_id_flex_num             in     number   default null
729   ,p_cagr_grade_def_id            in     number   default null
730 -- added for collective agreeemnt module
731   ,p_notice_period		  in	 number   default null
732   ,p_notice_period_uom		  in     varchar2 default null
733   ,p_employee_category		  in     varchar2 default null
734   ,p_work_at_home		  in	 varchar2 default null
735   ,p_job_post_source_name         in     varchar2 default null
736   ,p_validate_df_flex             in     boolean  default true
737   ,p_grade_ladder_pgm_id	  in	 number   default null
738   ,p_supervisor_assignment_id	  in	 number   default null
739   ,p_assignment_id                   out nocopy number
740   ,p_object_version_number           out nocopy number
741   ,p_effective_start_date            out nocopy date
742   ,p_effective_end_date              out nocopy date
743   ,p_assignment_sequence             out nocopy number
744   ,p_comment_id                      out nocopy number
745   ,p_other_manager_warning           out nocopy boolean
746   );
747 
748 --
749 -- ----------------------------------------------------------------------------
750 -- |-----------------------------< create_emp_asg >-----------OVERLOADED------|
751 -- ----------------------------------------------------------------------------
752 -- {Start Of Comments}
753 --
754 -- Description:
755 --  This Procedure was overloaded to add new parameter to cre_emp_asg proc.
756 --  Hourly_salaried warning shows error for invalid pay_basis and
757 --     hourly_salaried code combinations
758 
759 procedure create_emp_asg
760   (p_effective_date               in     date
761   ,p_legislation_code             in     varchar2
762   ,p_business_group_id            in     number
763   ,p_person_id                    in     number
764   ,p_organization_id              in     number
765   ,p_primary_flag                 in     varchar2
766   ,p_period_of_service_id         in     number
767   ,p_grade_id                     in     number   default null
768   ,p_position_id                  in     number   default null
769   ,p_job_id                       in     number   default null
770   ,p_assignment_status_type_id    in     number   default null
771   ,p_payroll_id                   in     number   default null
772   ,p_location_id                  in     number   default null
773   ,p_supervisor_id                in     number   default null
774   ,p_special_ceiling_step_id      in     number   default null
775   ,p_people_group_id              in     number   default null
776   ,p_soft_coding_keyflex_id       in     number   default null
777   ,p_pay_basis_id                 in     number   default null
778   ,p_assignment_number            in out nocopy varchar2
779   ,p_change_reason                in     varchar2 default null
780   ,p_comments                     in     varchar2 default null
781   ,p_date_probation_end           in     date     default null
782   ,p_default_code_comb_id         in     number   default null
783   ,p_employment_category          in     varchar2 default null
784   ,p_frequency                    in     varchar2 default null
785   ,p_internal_address_line        in     varchar2 default null
786   ,p_manager_flag                 in     varchar2 default null
787   ,p_normal_hours                 in     number   default null
788   ,p_perf_review_period           in     number   default null
789   ,p_perf_review_period_frequency in     varchar2 default null
790   ,p_probation_period             in     number   default null
791   ,p_probation_unit               in     varchar2 default null
792   ,p_sal_review_period            in     number   default null
793   ,p_sal_review_period_frequency  in     varchar2 default null
794   ,p_set_of_books_id              in     number   default null
795   ,p_source_type                  in     varchar2 default null
796   ,p_time_normal_finish           in     varchar2 default null
797   ,p_time_normal_start            in     varchar2 default null
798   ,p_bargaining_unit_code         in     varchar2 default null
799   ,p_labour_union_member_flag     in     varchar2 default 'N'
800   ,p_hourly_salaried_code         in     varchar2 default null
801   ,p_ass_attribute_category       in     varchar2 default null
802   ,p_ass_attribute1               in     varchar2 default null
803   ,p_ass_attribute2               in     varchar2 default null
804   ,p_ass_attribute3               in     varchar2 default null
805   ,p_ass_attribute4               in     varchar2 default null
806   ,p_ass_attribute5               in     varchar2 default null
807   ,p_ass_attribute6               in     varchar2 default null
808   ,p_ass_attribute7               in     varchar2 default null
809   ,p_ass_attribute8               in     varchar2 default null
810   ,p_ass_attribute9               in     varchar2 default null
811   ,p_ass_attribute10              in     varchar2 default null
812   ,p_ass_attribute11              in     varchar2 default null
813   ,p_ass_attribute12              in     varchar2 default null
814   ,p_ass_attribute13              in     varchar2 default null
815   ,p_ass_attribute14              in     varchar2 default null
816   ,p_ass_attribute15              in     varchar2 default null
817   ,p_ass_attribute16              in     varchar2 default null
818   ,p_ass_attribute17              in     varchar2 default null
819   ,p_ass_attribute18              in     varchar2 default null
820   ,p_ass_attribute19              in     varchar2 default null
821   ,p_ass_attribute20              in     varchar2 default null
822   ,p_ass_attribute21              in     varchar2 default null
823   ,p_ass_attribute22              in     varchar2 default null
824   ,p_ass_attribute23              in     varchar2 default null
825   ,p_ass_attribute24              in     varchar2 default null
826   ,p_ass_attribute25              in     varchar2 default null
827   ,p_ass_attribute26              in     varchar2 default null
828   ,p_ass_attribute27              in     varchar2 default null
829   ,p_ass_attribute28              in     varchar2 default null
830   ,p_ass_attribute29              in     varchar2 default null
831   ,p_ass_attribute30              in     varchar2 default null
832   ,p_title                        in     varchar2 default null
833   ,p_contract_id                  in     number   default null
834   ,p_establishment_id             in     number   default null
835   ,p_collective_agreement_id      in     number   default null
836   ,p_cagr_id_flex_num             in     number   default null
837   ,p_cagr_grade_def_id            in     number   default null
838 -- added for collective agreeemnt module
839   ,p_notice_period		  in	 number   default null
840   ,p_notice_period_uom		  in     varchar2 default null
841   ,p_employee_category		  in     varchar2 default null
842   ,p_work_at_home		  in	 varchar2 default null
843   ,p_job_post_source_name         in     varchar2 default null
844   ,p_validate_df_flex             in     boolean  default true
845   ,p_grade_ladder_pgm_id	  in	 number   default null
846   ,p_supervisor_assignment_id	  in	 number   default null
847   ,p_assignment_id                   out nocopy number
848   ,p_object_version_number           out nocopy number
849   ,p_effective_start_date            out nocopy date
850   ,p_effective_end_date              out nocopy date
851   ,p_assignment_sequence             out nocopy number
852   ,p_comment_id                      out nocopy number
853   ,p_other_manager_warning           out nocopy boolean
854   ,p_hourly_salaried_warning         out nocopy boolean
855   );
856 
857 --
858 -- ----------------------------------------------------------------------------
859 -- |-----------------------< final_process_emp_asg_sup >----------------------|
860 -- ----------------------------------------------------------------------------
861 -- {Start Of Comments}
862 --
863 -- Description:
864 --   This procedure processes one employee assignment when the final process
865 --   date is entered. This logic is common to the 'final_process_emp_asg' and
866 --   'final_process_emp' business processes.
867 --
868 --   The 'final_process_emp_asg' business process only allows the user to end
869 --   one non-primary assignment at a time. Whereas the 'final_process_emp'
870 --   business process needs to terminate all non-primary assignments and the
871 --   primary assignment.
872 --
873 --   The employee assignment must already have an assignment status which
874 --   corresponds to the TERM_ASSIGN system status. (This is set by calling the
875 --   'actual_termination_emp_asg' or 'actual_termination_emp' business
876 --   process.) No changes will be allowed if the assignment status is not
877 --   TERM_ASSIGN on the date after the final process date.
878 --
879 --   This business support process date effectively deletes the assignment,
880 --   date effectively deletes element entries where the corresponding element
881 --   termination rule is last_standard_process or final_process, deletes
882 --   affected unprocessed run results, deletes affected pay proposals and
883 --   deletes affected assignment link usages.
884 --
885 --   Element entries which have a corresponding 'Last Standard Process'
886 --   termination rule will have already been date effectively deleted by the
887 --   'actual_term_emp_asg_sup' business support process. It is still necessary
888 --   for this procedure to process these element entries because the final
889 --   process date may come before the defaulted last_standard_process date.
890 --
891 -- Prerequisites:
892 --   A valid assignment (p_assignment_id) must exist as of the final process
893 --   date (p_final_process_date).
894 --
895 -- In Parameters:
896 --   Name                           Reqd Type     Description
897 --   p_assignment_id                 Yes number
898 --   p_final_process_date            Yes date
899 --   p_actual_termination_date       Yes date
900 --
901 --
902 -- Post Success:
903 --
904 --   Name                           Type     Description
905 --   p_object_version_number        number   The version number of this
906 --                                           assignment.
907 --   p_effective_start_date         date
908 --   p_effective_end_date           date
909 --   p_org_now_no_manager_warning   boolean  Set to true if this assignment
910 --                                           was a manager and due to its
911 --                                           termination there will be no
912 --                                           managers in assignment's
913 --                                           organization. Set to false if
914 --                                           there is still another manager
915 --                                           in the assignment's organization
916 --                                           or this assignment was not a
917 --                                           manager. The warning value only
918 --                                           applies as of
919 --                                           p_final_process_date.
920 --   p_asg_future_changes_warning   boolean  Set to true if at least one
921 --                                           assignment change, after the
922 --                                           actual termination date, has been
923 --                                           overwritten with the new
924 --                                           assignment status type. Set to
925 --                                           false when there are no changes in
926 --                                           the future.
927 --   p_entries_changed_warning      varchar2 Set to 'Y' when at least one
928 --                                           element entry was altered due to
929 --                                           the assignment change.
930 --                                           Set to 'S' if at least one salary
931 --                                           element entry was affected.
932 --                                           ('S' is a more specific case of
933 --                                           'Y' because non-salary entries may
934 --                                           or may not have been affected at
935 --                                           the same time). Otherwise set to
936 --                                           'N', when no element entries were
937 --                                           changed.
938 --
939 --
940 -- Post Failure:
941 --   The process will not process the assignment and raises an error.
942 --
943 -- Access Status:
944 --   Internal Development Use Only.
945 --
946 -- {End Of Comments}
947 --
948 --
949 procedure final_process_emp_asg_sup
950   (p_assignment_id                in     number
951   ,p_object_version_number        in out nocopy number
952   ,p_final_process_date           in     date
953   ,p_actual_termination_date      in     date
954   ,p_effective_start_date            out nocopy date
955   ,p_effective_end_date              out nocopy date
956   ,p_org_now_no_manager_warning      out nocopy boolean
957   ,p_asg_future_changes_warning      out nocopy boolean
958   ,p_entries_changed_warning         out nocopy varchar2
959   );
960 --
961 -- ----------------------------------------------------------------------------
962 -- |---------------------------< maintain_spp_asg >---------------------------|
963 -- ----------------------------------------------------------------------------
964 -- {Start Of Comments}
965 --
966 -- Description:
967 --   This business support process maintains spinal point placements when an
968 --   employee assignment is altered. It should be called when the assignment
969 --   rows are deleted; this includes all the DateTrack delete modes.
970 --
971 --   For updates it should only be called when the assignment's grade_id is
972 --   actually updated, i.e. when grade_id is updated from not null to null or
973 --   a not null value. It should not be called when the grade_id is being
974 --   updated from a null to a not null value because there cannot be any
975 --   spinal point placements which will be affected.
976 --
977 -- Prerequisites:
978 --   A valid assignment (p_assignment_id) must exist.
979 --
980 -- In Parameters:
981 --   Name                           Reqd Type     Description
982 --   p_assignment_id                 Yes number
983 --   p_datetrack_mode                Yes varchar2 The mode of update.
984 --   p_validation_start_date         Yes date
985 --   p_validation_end_date           Yes date
986 --
987 --
988 -- Post Success:
989 --
990 --   Name                           Type     Description
991 --   p_spp_delelete_warning         boolean  Only set to true if any spinal
992 --                                           point placement rows have been
993 --                                           affected.
994 --
995 -- Post Failure:
996 --   The process will not update the assignment and raises an error.
997 --
998 -- Access Status:
999 --   Internal Development Use Only.
1000 --
1001 -- {End Of Comments}
1002 --
1003 procedure maintain_spp_asg
1004   (p_assignment_id                in     number
1005   ,p_datetrack_mode               in     varchar2
1006   ,p_validation_start_date        in     date
1007   ,p_validation_end_date          in     date
1008   ,p_grade_id			  in     number
1009   ,p_spp_delete_warning              out nocopy boolean
1010   );
1011 --
1012 -- ----------------------------------------------------------------------------
1013 -- |----------------------< update_status_type_emp_asg >----------------------|
1014 -- ----------------------------------------------------------------------------
1015 -- {Start Of Comments}
1016 --
1017 -- Description:
1018 --   This business support process updates one employee assignment with a
1019 --   suspend or active assignment status type.
1020 --
1021 --   This is a supporting process for the 'suspend_emp_asg' and
1022 --   'activate_emp_asg' business processes. The logic required by both
1023 --   processes is very similar. The only difference is that the internal
1024 --   assignment status must be SUSP_ASSIGN for 'suspend_emp_asg' and
1025 --   ACTIVE_ASSIGN' for 'activate_emp_asg'.
1026 --
1027 --   If the caller does not explicitly pass in a status type, the process will
1028 --   use the default SUSP_ASSIGN or ACTIVE_ASSIGN status for the assignment's
1029 --   business group.
1030 --
1031 --   If the assignment's status is already of the correct type this process can
1032 --   be used to set a different suspend or active status. Updates from an
1033 --   applicant assignment status (ACCEPTED, ACTIVE_APL, TERM_APL and OFFER) are
1034 --   not allowed. Only employee assignments can be altered with this business
1035 --   support process.
1036 --
1037 -- Prerequisites:
1038 --   A valid assignment (p_assignment_id) must exist.
1039 --
1040 -- In Parameters:
1041 --   Name                           Reqd Type     Description
1042 --   p_effective_date                Yes date     The operation date.
1043 --   p_datetrack_update_mode         Yes varchar2 The mode of update.
1044 --   p_assignment_id                 Yes number
1045 --   p_object_version_number         Yes number
1046 --   p_expected_system_status        Yes varchar2 The intended system status of
1047 --                                                the assignment as a result of
1048 --                                                the update. Either
1049 --                                                ACTIVE_ASSIGN or SUSP_ASSIGN.
1050 --   p_assignment_status_type_id      No number   The new assignment status.
1051 --   p_change_reason                  No varchar2 New change reason
1052 --
1053 --
1054 -- Post Success:
1055 --
1056 --   Name                           Type     Description
1057 --   p_object_version_number        number   The version number of this
1058 --                                           assignment.
1059 --   p_effective_start_date         date     The date from which this change
1060 --                                           applies.
1061 --   p_effective_end_date           date     The last date on which this change
1062 --                                           applies.
1063 --
1064 -- Post Failure:
1065 --   The process will not update the assignment and raises an error.
1066 --
1067 -- Access Status:
1068 --   Internal Development Use Only.
1069 --
1070 -- {End Of Comments}
1071 --
1072 procedure update_status_type_emp_asg
1073   (p_effective_date               in     date
1074   ,p_datetrack_update_mode        in     varchar2
1075   ,p_assignment_id                in     number
1076   ,p_change_reason                in     varchar2 default hr_api.g_varchar2
1077   ,p_object_version_number        in out nocopy number
1078   ,p_expected_system_status       in     varchar2
1079   ,p_assignment_status_type_id    in     number   default hr_api.g_number
1080   ,p_effective_start_date            out nocopy date
1081   ,p_effective_end_date              out nocopy date
1082   );
1083 --
1084 -- ----------------------------------------------------------------------------
1085 -- |----------------------< update_status_type_cwk_asg >----------------------|
1086 -- ----------------------------------------------------------------------------
1087 -- {Start Of Comments}
1088 --
1089 -- Description:
1090 --   This business support process updates one cwk assignment with a
1091 --   suspend or active assignment status type.
1092 --
1093 --   This is a supporting process for the 'suspend_cwk_asg' and
1094 --   'activate_cwk_asg' business processes. The logic required by both
1095 --   processes is very similar. The only difference is that the internal
1096 --   assignment status must be SUSP_CWK_ASG for 'suspend_cwk_asg' and
1097 --   ACTIVE_CWK' for 'activate_cwk_asg'.
1098 --
1099 --   If the caller does not explicitly pass in a status type, the process will
1100 --   use the default SUSP_CWK_ASG or ACTIVE_CWK status for the assignment's
1101 --   business group.
1102 --
1103 --   If the assignment's status is already of the correct type this process can
1104 --   be used to set a different suspend or active status. Updates from an
1105 --   applicant assignment status (ACCEPTED, ACTIVE_APL, TERM_APL and OFFER) are
1106 --   not allowed nor are updates from emp statuses.  Only cwk assignments can be
1107 --   altered with this business support process.
1108 --
1109 -- Prerequisites:
1110 --   A valid assignment (p_assignment_id) must exist.
1111 --
1112 -- In Parameters:
1113 --   Name                           Reqd Type     Description
1114 --   p_effective_date                Yes date     The operation date.
1115 --   p_datetrack_update_mode         Yes varchar2 The mode of update.
1116 --   p_assignment_id                 Yes number
1117 --   p_object_version_number         Yes number
1118 --   p_expected_system_status        Yes varchar2 The intended system status of
1119 --                                                the assignment as a result of
1120 --                                                the update. Either
1121 --                                                ACTIVE_CWK or SUSP_CWK_ASG.
1122 --   p_assignment_status_type_id      No number   The new assignment status.
1123 --   p_change_reason                  No varchar2 New change reason
1124 --
1125 --
1126 -- Post Success:
1127 --
1128 --   Name                           Type     Description
1129 --   p_object_version_number        number   The version number of this
1130 --                                           assignment.
1131 --   p_effective_start_date         date     The date from which this change
1132 --                                           applies.
1133 --   p_effective_end_date           date     The last date on which this change
1134 --                                           applies.
1135 --
1136 -- Post Failure:
1137 --   The process will not update the assignment and raises an error.
1138 --
1139 -- Access Status:
1140 --   Internal Development Use Only.
1141 --
1142 -- {End Of Comments}
1143 --
1144 procedure update_status_type_cwk_asg
1145   (p_effective_date               in     date
1146   ,p_datetrack_update_mode        in     varchar2
1147   ,p_assignment_id                in     number
1148   ,p_change_reason                in     varchar2 default hr_api.g_varchar2
1149   ,p_object_version_number        in out nocopy number
1150   ,p_expected_system_status       in     varchar2
1151   ,p_assignment_status_type_id    in     number   default hr_api.g_number
1152   ,p_effective_start_date            out nocopy date
1153   ,p_effective_end_date              out nocopy date
1154   );
1155 --
1156 -- ----------------------------------------------------------------------------
1157 -- |-----------------------------< create_apl_asg >---------------------------|
1158 -- ----------------------------------------------------------------------------
1159 -- {Start Of Comments}
1160 --
1161 -- Description:
1162 --   This business support process creates a new applicant assignment and if
1163 --   neccessary, assignment budget values and a letter request. This
1164 --   process can be called in one of two situations from other business support
1165 --   processes:
1166 --      create_default_apl_asg   - part of creating a new applicant
1167 --      create_secondary_apl_asg - create additional applicant assignments.
1168 --   This process only contains the common functionality for the above two
1169 --   processes.
1170 --
1171 -- Prerequisites:
1172 --   A valid person (p_person_id) must exist as of the effective_date
1173 --   (p_effective_date).
1174 --   The legislation (p_legislation_code), must be the value for the person's
1175 --   business group (p_business_group_id).
1176 --   The business group (p_business_group_id) is for the person (p_person_id).
1177 --   A valid application (p_application_id) must exist for the person
1178 --   (p_person_id) as of the effective_date (p_effective_date).
1179 --
1180 -- In Parameters:
1181 --   Name                           Reqd Type     Description
1182 --   p_effective_date                Yes date     The date from which this
1183 --                                                assignment applies.
1184 --   p_legislation_code              Yes varchar2 Legislation for the person's
1185 --                                                business group.
1186 --   p_business_group_id             Yes number   The person's business group.
1187 --                                                reccord.
1188 --   p_recruiter_id                  No  number
1189 --   p_grade_id                      No  number
1190 --   p_position_id                   No  number
1191 --   p_job_id                        No  number
1192 --   p_assignment_status_type_id     No  number
1193 --   p_payroll_id                    No  number   Payroll
1194 --   p_location_id                   No  number
1195 --   p_person_referred_by_id         No  number
1196 --   p_supervisor_id                 No  number
1197 --   p_special_ceiling_step_id       No  number   Ceiling step
1198 --   p_person_id                     Yes number   Person.
1199 --   p_recruitment_activity_id       No  number
1200 --   p_source_organization_id        No  number
1201 --   p_organization_id               Yes number
1202 --   p_people_group_id               No  number
1203 --   p_soft_coding_keyflex_id        No  number   Soft coding keyflexfield
1204 --   p_vacancy_id                    No  number
1205 --   p_pay_basis_id                  No  number   Pay Basis
1206 --   p_application_id                Yes number   The person's application
1207 --   p_change_reason                 No  varchar2
1208 --   p_comments                      No  varchar2
1209 --   p_date_probation_end            No  date
1210 --   p_default_code_comb_id          No  number
1211 --   p_employment_category           No  varchar2
1212 --   p_frequency                     No  varchar2
1213 --   p_internal_address_line         No  varchar2 Internal address line
1214 --   p_manager_flag                  No  varchar2
1215 --   p_normal_hours                  No  number
1216 --   p_perf_review_period            No  number   Performance review period
1217 --   p_perf_review_period_frequency  No  varchar2 Performance review period
1218 --   p_probation_period              No  number
1219 --   p_probation_unit                No  varchar2
1220 --   p_sal_review_period             No  number   Salary review period
1221 --   p_sal_review_period_frequency   No  varchar2 Salary review period frequency
1222 --   p_set_of_books_id               No  number
1223 --   p_source_type                   No  varchar2
1224 --   p_time_normal_finish            No  varchar2
1225 --   p_time_normal_start             No  varchar2
1226 --   p_bargaining_unit_code          No  varchar2
1227 --   p_labour_union_member_flag      No  varchar2
1228 --   p_hourly_salaried_code          No  varchar2
1229 --   p_ass_attribute_category        No  varchar2
1230 --   p_ass_attribute1                No  varchar2 Descriptive flexfield.
1231 --   p_ass_attribute2                No  varchar2 Descriptive flexfield.
1232 --   p_ass_attribute3                No  varchar2 Descriptive flexfield.
1233 --   p_ass_attribute4                No  varchar2 Descriptive flexfield.
1234 --   p_ass_attribute5                No  varchar2 Descriptive flexfield.
1235 --   p_ass_attribute6                No  varchar2 Descriptive flexfield.
1236 --   p_ass_attribute7                No  varchar2 Descriptive flexfield.
1237 --   p_ass_attribute8                No  varchar2 Descriptive flexfield.
1238 --   p_ass_attribute9                No  varchar2 Descriptive flexfield.
1239 --   p_ass_attribute10               No  varchar2 Descriptive flexfield.
1240 --   p_ass_attribute11               No  varchar2 Descriptive flexfield.
1241 --   p_ass_attribute12               No  varchar2 Descriptive flexfield.
1242 --   p_ass_attribute13               No  varchar2 Descriptive flexfield.
1243 --   p_ass_attribute14               No  varchar2 Descriptive flexfield.
1244 --   p_ass_attribute15               No  varchar2 Descriptive flexfield.
1245 --   p_ass_attribute16               No  varchar2 Descriptive flexfield.
1246 --   p_ass_attribute17               No  varchar2 Descriptive flexfield.
1247 --   p_ass_attribute18               No  varchar2 Descriptive flexfield.
1248 --   p_ass_attribute19               No  varchar2 Descriptive flexfield.
1249 --   p_ass_attribute20               No  varchar2 Descriptive flexfield.
1250 --   p_ass_attribute21               No  varchar2 Descriptive flexfield.
1251 --   p_ass_attribute22               No  varchar2 Descriptive flexfield.
1252 --   p_ass_attribute23               No  varchar2 Descriptive flexfield.
1253 --   p_ass_attribute24               No  varchar2 Descriptive flexfield.
1254 --   p_ass_attribute25               No  varchar2 Descriptive flexfield.
1255 --   p_ass_attribute26               No  varchar2 Descriptive flexfield.
1256 --   p_ass_attribute27               No  varchar2 Descriptive flexfield.
1257 --   p_ass_attribute28               No  varchar2 Descriptive flexfield.
1258 --   p_ass_attribute29               No  varchar2 Descriptive flexfield.
1259 --   p_ass_attribute30               No  varchar2 Descriptive flexfield.
1260 --   p_title                         No  varchar2
1261 --   p_contract_id                   No  number
1262 --   p_establishment_id              No  number
1263 --   p_collective_agreement_id       No  number
1264 --   p_cagr_id_flex_num              No  number
1265 --   p_cagr_grade_def_id             No  number
1266 --   p_notice_period                 No  number   Notice Period
1267 --   p_notice_period_uom             No  varchar2 Notice Period Units
1268 --   p_employee_category             No  varchar2 Employee Category
1269 --   p_work_at_home                  No  varchar2 Work At Home
1270 --   p_job_post_source_name	     No  varchar2 Job Source
1271 --   p_validate_df_flex              No  boolean  perform/bypass descriptive
1272 --                                                flexfield validation
1273 --   p_grade_ladder_pgm_id	     No	 number   grade ladder id
1274 --   p_supervisor_assignment_id	     No	 number   supervisor assignment id
1275 --
1276 --
1277 -- Post Success:
1278 --
1279 --   The API creates the applicant assignment record, and if required,
1280 --   assignment budget values and a letter request.  The following out
1281 --   parameters are set.
1282 --
1283 --   Name                           Type     Description
1284 --   p_assignment_id                number   Uniquely identifies the assignment
1285 --                                           created.
1286 --   p_object_version_number        number   The version number of this
1287 --                                           assignment record.
1288 --   p_effective_start_date         date     The date from which this
1289 --                                           assignment row is applied.
1290 --   p_effective_end_date           date     The last date on which this
1291 --                                           assignment row applies.
1292 --   p_assignment_sequence          number   The assignment sequence number.
1293 --   p_assignment_number            varchar2 Validated or generated
1294 --                                           assignment number.
1295 --   p_comment_id                   number   The comment id if comment text
1296 --                                           was provided.
1297 --
1298 -- Post Failure:
1299 --   The process will not create the assignment and raises an error.
1300 --
1301 -- Access Status:
1302 --   Internal Development Use Only.
1303 --
1304 -- {End Of Comments}
1305 --
1306 procedure create_apl_asg
1307   (p_effective_date               in     date
1308   ,p_legislation_code             in     varchar2
1309   ,p_business_group_id            in     number
1310   ,p_recruiter_id                 in     number   default null
1311   ,p_grade_id                     in     number   default null
1312   ,p_position_id                  in     number   default null
1313   ,p_job_id                       in     number   default null
1314   ,p_assignment_status_type_id    in     number   default null
1315   ,p_payroll_id                   in     number   default null
1316   ,p_location_id                  in     number   default null
1317   ,p_person_referred_by_id        in     number   default null
1318   ,p_supervisor_id                in     number   default null
1319   ,p_special_ceiling_step_id      in     number   default null
1320   ,p_person_id                    in     number
1321   ,p_recruitment_activity_id      in     number   default null
1322   ,p_source_organization_id       in     number   default null
1323   ,p_organization_id              in     number
1324   ,p_people_group_id              in     number   default null
1325   ,p_soft_coding_keyflex_id       in     number   default null
1326   ,p_vacancy_id                   in     number   default null
1327   ,p_pay_basis_id                 in     number   default null
1328   ,p_application_id               in     number
1329   ,p_change_reason                in     varchar2 default null
1330   ,p_comments                     in     varchar2 default null
1331   ,p_date_probation_end           in     date     default null
1332   ,p_default_code_comb_id         in     number   default null
1333   ,p_employment_category          in     varchar2 default null
1334   ,p_frequency                    in     varchar2 default null
1335   ,p_internal_address_line        in     varchar2 default null
1336   ,p_manager_flag                 in     varchar2 default null
1337   ,p_normal_hours                 in     number   default null
1338   ,p_perf_review_period           in     number   default null
1339   ,p_perf_review_period_frequency in     varchar2 default null
1340   ,p_probation_period             in     number   default null
1341   ,p_probation_unit               in     varchar2 default null
1342   ,p_sal_review_period            in     number   default null
1343   ,p_sal_review_period_frequency  in     varchar2 default null
1344   ,p_set_of_books_id              in     number   default null
1345   ,p_source_type                  in     varchar2 default null
1346   ,p_time_normal_finish           in     varchar2 default null
1347   ,p_time_normal_start            in     varchar2 default null
1348   ,p_bargaining_unit_code         in     varchar2 default null
1349   ,p_labour_union_member_flag     in     varchar2 default 'N'
1350   ,p_hourly_salaried_code         in     varchar2 default null
1351   ,p_ass_attribute_category       in     varchar2 default null
1352   ,p_ass_attribute1               in     varchar2 default null
1353   ,p_ass_attribute2               in     varchar2 default null
1354   ,p_ass_attribute3               in     varchar2 default null
1355   ,p_ass_attribute4               in     varchar2 default null
1356   ,p_ass_attribute5               in     varchar2 default null
1357   ,p_ass_attribute6               in     varchar2 default null
1358   ,p_ass_attribute7               in     varchar2 default null
1359   ,p_ass_attribute8               in     varchar2 default null
1360   ,p_ass_attribute9               in     varchar2 default null
1361   ,p_ass_attribute10              in     varchar2 default null
1362   ,p_ass_attribute11              in     varchar2 default null
1363   ,p_ass_attribute12              in     varchar2 default null
1364   ,p_ass_attribute13              in     varchar2 default null
1365   ,p_ass_attribute14              in     varchar2 default null
1366   ,p_ass_attribute15              in     varchar2 default null
1367   ,p_ass_attribute16              in     varchar2 default null
1368   ,p_ass_attribute17              in     varchar2 default null
1369   ,p_ass_attribute18              in     varchar2 default null
1370   ,p_ass_attribute19              in     varchar2 default null
1371   ,p_ass_attribute20              in     varchar2 default null
1372   ,p_ass_attribute21              in     varchar2 default null
1373   ,p_ass_attribute22              in     varchar2 default null
1374   ,p_ass_attribute23              in     varchar2 default null
1375   ,p_ass_attribute24              in     varchar2 default null
1376   ,p_ass_attribute25              in     varchar2 default null
1377   ,p_ass_attribute26              in     varchar2 default null
1378   ,p_ass_attribute27              in     varchar2 default null
1379   ,p_ass_attribute28              in     varchar2 default null
1380   ,p_ass_attribute29              in     varchar2 default null
1381   ,p_ass_attribute30              in     varchar2 default null
1382   ,p_title                        in     varchar2 default null
1383   ,p_contract_id                  in     number   default null
1384   ,p_establishment_id             in     number   default null
1385   ,p_collective_agreement_id      in     number   default null
1386   ,p_cagr_id_flex_num             in     number   default null
1387   ,p_cagr_grade_def_id            in     number   default null
1388 -- added for collective agreeemnt module
1389   ,p_notice_period		  in	 number   default null
1390   ,p_notice_period_uom		  in     varchar2 default null
1391   ,p_employee_category		  in     varchar2 default null
1392   ,p_work_at_home		  in	 varchar2 default null
1393   ,p_job_post_source_name         in     varchar2 default null
1394   ,p_validate_df_flex             in     boolean  default true
1395   ,p_posting_content_id           in     number   default null
1396   ,p_applicant_rank               in     number   default null
1397   ,p_grade_ladder_pgm_id	  in	 number   default null
1398   ,p_supervisor_assignment_id	  in	 number   default null
1399   ,p_object_version_number           out nocopy number
1400   ,p_assignment_id                   out nocopy number
1401   ,p_effective_start_date            out nocopy date
1402   ,p_effective_end_date              out nocopy date
1403   ,p_assignment_sequence             out nocopy number
1404   ,p_comment_id                      out nocopy number
1405   );
1406 --
1407 -- ----------------------------------------------------------------------------
1408 -- |------------------------< create_default_apl_asg >------------------------|
1409 -- ----------------------------------------------------------------------------
1410 -- {Start Of Comments}
1411 --
1412 -- Description:
1413 --   This business support process creates a default applicant assignment and
1414 --   if neccessary, assignment budget values and a letter request. This process
1415 --   only contains the common functionality for business processes which need
1416 --   to create an initial assignment for an applicant (e.g. create_applicant).
1417 --
1418 -- Prerequisites:
1419 --
1420 --   A valid person (p_person_id) must exist as of the effective_date
1421 --   (p_effective_date).
1422 --   The legislation (p_legislation_code), must be the value for the person's
1423 --   business group (p_business_group_id).
1424 --   The business group (p_business_group_id) is for the person (p_person_id).
1425 --   A valid application (p_application_id) must exist for the person
1426 --   (p_person_id) as of the effective_date (p_effective_date).
1427 
1428 -- In Parameters:
1429 --   Name                           Reqd Type     Description
1430 --   p_effective_date                Yes date     The date from which this
1431 --                                                assignment applies.
1432 --   p_person_id                     Yes number   Person.
1433 --   p_business_group_id             Yes number   The person's business group.
1434 --   p_application_id                Yes number   The person's application
1435 --                                                record.
1436 --   p_vacancy_id                    No  Number   Vacancy_id for which this
1437 --                                                applicant is applying for.
1438 -- Post Success:
1439 --
1440 --   The API creates the applicant assignment record, and if required,
1441 --   assignment budget values and a letter request.  The following out
1442 --   parameters are set.
1443 --
1444 --   Name                           Type     Description
1445 --   p_assignment_id                number   Uniquely identifies the assignment
1446 --                                           created.
1447 --   p_object_version_number        number   The version number of this
1448 --                                           assignment.
1449 --   p_assignment_sequence          number   Assignment sequence.
1450 --
1451 -- Post Failure:
1452 --   The process will not create the assignment and raises an error.
1453 --
1454 -- Access Status:
1455 --   Internal Development Use Only.
1456 --
1457 -- {End Of Comments}
1458 --
1459 procedure create_default_apl_asg
1460   (p_effective_date               in     date
1461   ,p_person_id                    in     number
1462   ,p_business_group_id            in     number
1463   ,p_application_id               in     number
1464   ,p_vacancy_id                   in     number default null
1465   ,p_assignment_id                   out nocopy number
1466   ,p_object_version_number           out nocopy number
1467   ,p_assignment_sequence             out nocopy number
1468   );
1469 --
1470 -- ----------------------------------------------------------------------------
1471 -- |----------------------< update_status_type_apl_asg >----------------------|
1472 -- ----------------------------------------------------------------------------
1473 -- {Start Of Comments}
1474 --
1475 -- Description:
1476 --   This business support process updates an applicant assignment with an
1477 --   active, offer or accepted assignment status type.
1478 --
1479 --   Any out-of-date letter requests for the assignment will be removed.
1480 --   (i.e. If there is a pending letter request line, where the conditions for
1481 --   sending it are no longer met then the request line will be deleted.)
1482 --
1483 --   If a letter definition exists for the new assignment status type then a
1484 --   new letter request line will be created for this assignment.
1485 --
1486 --   This is a supporting process for business processes like 'offer_apl_asg'.
1487 --   The common features required by these business processes have been
1488 --   implemented in here to save duplication and dual maintenance.
1489 --
1490 --   If the caller does not explicitly pass in a status type, the process will
1491 --   use the default ACTIVE_APL, OFFER or ACCEPTED status for the assignment's
1492 --   business group will be used.
1493 --
1494 --   If the assignment's status is already of the correct system type this
1495 --   process can be used to set a different active, offer or accepted status.
1496 --   Updates from an employee assignment status (ACTIVE_ASSIGN, SUSP_ASSIGN,
1497 --   TERM_ASSIGN and END) are not allowed. Only applicant assignments can be
1498 --   altered with this process.  The 'update_status_type_emp_asg' business
1499 --   support process should be used for modifying employee assignments.
1500 --
1501 -- Prerequisites:
1502 --   A valid assignment (p_assignment_id) must exist.
1503 --
1504 -- In Parameters:
1505 --   Name                           Reqd Type     Description
1506 --   p_effective_date                Yes date     The operation date.
1507 --   p_datetrack_update_mode         Yes varchar2 The mode of update.
1508 --   p_assignment_id                 Yes number   Assignment
1509 --   p_object_version_number         Yes number   Version number of the
1510 --                                                assignment record.
1511 --   p_expected_system_status        Yes varchar2 The intended system status of
1512 --                                                the assignment as a result of
1513 --                                                the update. Either ACTIVE_APL,
1514 --                                                OFFER or ACCEPTED.
1515 --   p_assignment_status_type_id      No number   The new assignment status.
1516 --   p_change_reason                  No varchar2 Applicant assignment status
1517 --                                                change reason.
1518 --
1519 --
1520 -- Post Success:
1521 --
1522 --   The API updates the assignment record and if required, maintains the
1523 --   letter requests.  The following out parameters are set.
1524 --
1525 --   Name                           Type     Description
1526 --   p_effective_start_date         date     The date from which this change
1527 --                                           applies.
1528 --   p_effective_end_date           date     The last date on which this change
1529 --                                           applies.
1530 --
1531 -- Post Failure:
1532 --   The process will not update the assignment and raises an error.
1533 --
1534 -- Access Status:
1535 --   Internal Development Use Only.
1536 --
1537 -- {End Of Comments}
1538 --
1539 procedure update_status_type_apl_asg
1540   (p_effective_date               in     date
1541   ,p_datetrack_update_mode        in     varchar2
1542   ,p_assignment_id                in     number
1543   ,p_object_version_number        in out nocopy number
1544   ,p_expected_system_status       in     varchar2
1545   ,p_assignment_status_type_id    in     number   default hr_api.g_number
1546   ,p_change_reason                in     varchar2 default hr_api.g_varchar2
1547   ,p_effective_start_date            out nocopy date
1548   ,p_effective_end_date              out nocopy date
1549   );
1550 --
1551 --
1552 -- ----------------------------------------------------------------------------
1553 -- |------------------------< actual_term_cwk_asg >---------------------------|
1554 -- ----------------------------------------------------------------------------
1555 -- {Start Of Comments}
1556 --
1557 -- Description:
1558 --   This procedure processes one contingent worker assignment when the actual
1559 --   termination date is entered. This logic is common to the
1560 --   'actual_termination_cwk_asg' and 'actual_termination_cwk' business
1561 --   processes.
1562 --
1563 --   The 'actual_termination_cwk_asg' business process only allows the user to
1564 --   terminate one non-primary assignment at a time. Where as the
1565 --   'actual_termination_cwk' business process needs to terminate all
1566 --   non-primary assignments and the primary assignment.
1567 --
1568 --   This business support process assumes the p_actual_termination_date,
1569 --   p_last_standard_process_date and p_assignment_status_type_id parameters
1570 --   have been correctly validated or derived by the calling logic. For US
1571 --   legislation p_last_standard_process_date should always be set to null.
1572 --   This will ensure unnecessary logic is not executed.
1573 --
1574 --   This business support process updates the assignment, date effectively
1575 --   deletes element entries where the corresponding element termination rule
1576 --   is actual_termination or last_standard_process, deletes affected
1577 --   unprocessed run results, deletes affected pay proposals and deletes
1578 --   affected assignment link usages.
1579 --
1580 -- Prerequisites:
1581 --   A valid assignment (p_assignment_id) must exist as of the actual
1582 --   termination date (p_actual_termination_date).
1583 --
1584 -- In Parameters:
1585 --   Name                           Reqd Type     Description
1586 --   p_assignment_id                 Yes number
1587 --   p_actual_termination_date       Yes date
1588 --   p_last_standard_process_date    Yes date
1589 --   p_assignment_status_type_id     Yes number
1590 --
1591 -- Post Success:
1592 --
1593 --   Name                           Type     Description
1594 --   p_object_version_number        number   The version number of this
1595 --                                           assignment, as of the actual
1596 --                                           termination date + 1.
1597 --   p_effective_start_date         date     Effective start date of the
1598 --                                           assignment row, which exists as of
1599 --                                           the actual termination date.
1600 --   p_effective_end_date           date     Effective end date of the
1601 --                                           assignment row, which exists as of
1602 --                                           the actual termination date.
1603 --   p_asg_future_changes_warning   boolean  Set to true if at least one
1604 --                                           assignment change, after the
1605 --                                           actual termination date, has been
1606 --                                           overwritten with the new
1607 --                                           assignment status type. Set to
1608 --                                           false when there are no changes in
1609 --                                           the future.
1610 --   p_entries_changed_warning      varchar2 Set to 'Y' when at least one
1611 --                                           element entry was altered due to
1612 --                                           the assignment change.
1613 --                                           Set to 'S' if at least one salary
1614 --                                           element entry was affected.
1615 --                                           ('S' is a more specific case of
1616 --                                           'Y' because non-salary entries may
1617 --                                           or may not have been affected at
1618 --                                           the same time). Otherwise set to
1619 --                                           'N', when no element entries were
1620 --                                           changed.
1621 --   p_pay_proposal_warning         boolean  Set to true if any pay proposals
1622 --                                           existing after the
1623 --					     actual_termination_date,has been
1624 --                                           deleted. Set to false when there
1625 --                                           are no pay proposals after actual_
1626 --                                           termination_date.
1627 -- Post Failure:
1628 --   The process will not process the assignment and raises an error.
1629 --
1630 -- Access Status:
1631 --   Internal Development Use Only.
1632 --
1633 -- {End Of Comments}
1634 --
1635 procedure actual_term_cwk_asg
1636   (p_assignment_id                in     number
1637   ,p_object_version_number        in out nocopy number
1638   ,p_actual_termination_date      in     date
1639   ,p_last_standard_process_date   in     date
1640   ,p_assignment_status_type_id    in     number
1641   ,p_effective_start_date            out nocopy date
1642   ,p_effective_end_date              out nocopy date
1643   ,p_asg_future_changes_warning      out nocopy boolean
1644   ,p_entries_changed_warning         out nocopy varchar2
1645   ,p_pay_proposal_warning            out nocopy boolean
1646   );
1647 --
1648 -- ----------------------------------------------------------------------------
1649 -- |-----------------------< final_process_cwk_asg >--------------------------|
1650 -- ----------------------------------------------------------------------------
1651 -- {Start Of Comments}
1652 --
1653 -- Description:
1654 --   This procedure processes one contingent worker assignment when the final
1655 --   process date is entered. This logic is common to the
1656 --   'final_process_cwk_asg' and 'final_process_cwk' business processes.
1657 --
1658 --   The 'final_process_cwk_asg' business process only allows the user to end
1659 --   one non-primary assignment at a time. Whereas the 'final_process_emp'
1660 --   business process needs to terminate all non-primary assignments and the
1661 --   primary assignment.
1662 --
1663 --   The person assignment must already have an assignment status which
1664 --   corresponds to the TERM_CWK_ASSIGN system status. (This is set by calling
1665 --   the 'actual_termination_cwk_asg' or 'actual_termination_cwk' business
1666 --   process).  No changes will be allowed if the assignment status is not
1667 --   TERM_CWK_ASSIGN on the date after the final process date.
1668 --
1669 --   This business support process date effectively deletes the assignment,
1670 --   date effectively deletes element entries where the corresponding element
1671 --   termination rule is last_standard_process or final_process, deletes
1672 --   affected unprocessed run results, deletes affected pay proposals and
1673 --   deletes affected assignment link usages.
1674 --
1675 --   Element entries which have a corresponding 'Last Standard Process'
1676 --   termination rule will have already been date effectively deleted by the
1677 --   'actual_term_cwk_asg' business support process. It is still necessary
1678 --   for this procedure to process these element entries because the final
1679 --   process date may come before the defaulted last_standard_process date.
1680 --
1681 -- Prerequisites:
1682 --   A valid assignment (p_assignment_id) must exist as of the final process
1683 --   date (p_final_process_date).
1684 --
1685 -- In Parameters:
1686 --   Name                           Reqd Type     Description
1687 --   p_assignment_id                 Yes number
1688 --   p_final_process_date            Yes date
1689 --   p_actual_termination_date       Yes date
1690 --
1691 --
1692 -- Post Success:
1693 --
1694 --   Name                           Type     Description
1695 --   p_object_version_number        number   The version number of this
1696 --                                           assignment.
1697 --   p_effective_start_date         date
1698 --   p_effective_end_date           date
1699 --   p_org_now_no_manager_warning   boolean  Set to true if this assignment
1700 --                                           was a manager and due to its
1701 --                                           termination there will be no
1702 --                                           managers in assignment's
1703 --                                           organization. Set to false if
1704 --                                           there is still another manager
1705 --                                           in the assignment's organization
1706 --                                           or this assignment was not a
1707 --                                           manager. The warning value only
1708 --                                           applies as of
1709 --                                           p_final_process_date.
1710 --   p_asg_future_changes_warning   boolean  Set to true if at least one
1711 --                                           assignment change, after the
1712 --                                           actual termination date, has been
1713 --                                           overwritten with the new
1714 --                                           assignment status type. Set to
1715 --                                           false when there are no changes in
1716 --                                           the future.
1717 --   p_entries_changed_warning      varchar2 Set to 'Y' when at least one
1718 --                                           element entry was altered due to
1719 --                                           the assignment change.
1720 --                                           Set to 'S' if at least one salary
1721 --                                           element entry was affected.
1722 --                                           ('S' is a more specific case of
1723 --                                           'Y' because non-salary entries may
1724 --                                           or may not have been affected at
1725 --                                           the same time). Otherwise set to
1726 --                                           'N', when no element entries were
1727 --                                           changed.
1728 --
1729 --
1730 -- Post Failure:
1731 --   The process will not process the assignment and raises an error.
1732 --
1733 -- Access Status:
1734 --   Internal Development Use Only.
1735 --
1736 -- {End Of Comments}
1737 --
1738 --
1739 procedure final_process_cwk_asg
1740   (p_assignment_id                in     number
1741   ,p_object_version_number        in out nocopy number
1742   ,p_final_process_date           in     date
1743   ,p_actual_termination_date      in     date
1744   ,p_effective_start_date            out nocopy date
1745   ,p_effective_end_date              out nocopy date
1746   ,p_org_now_no_manager_warning      out nocopy boolean
1747   ,p_asg_future_changes_warning      out nocopy boolean
1748   ,p_entries_changed_warning         out nocopy varchar2
1749   );
1750 --
1751 -- ----------------------------------------------------------------------------
1752 -- |---------------------------< cleanup_spp >--------------------------------|
1753 -- ----------------------------------------------------------------------------
1754 -- {Start Of Comments}
1755 --
1756 -- Description:
1757 --
1758 --   This procedure will remove invalid SPP records for the given assignment.
1759 --
1760 -- Prerequisites:
1761 --
1762 --   None
1763 --
1764 -- In Parameters:
1765 --   Name                           Reqd Type     Description
1766 --   p_assignment_id                 Yes number
1767 --   p_datetrack_mode                Yes varchar2
1768 --   p_validation_start_date         Yes date
1769 --
1770 --
1771 -- Post Success:
1772 --
1773 --   Will remove all invalid SPP records for the given assignment id.
1774 --   Name                           Type          Description
1775 --   p_del_end_future_spp           boolean       Set to true if any
1776 --                                                invalid or future SPP
1777 --                                                records are deleted
1778 --                                                depends on DT mode
1779 --
1780 -- Post Failure:
1781 --
1782 --   None
1783 --
1784 -- Access Status:
1785 --   Internal Development Use Only.
1786 --
1787 -- {End Of Comments}
1788 --
1789 procedure cleanup_spp
1790    (p_assignment_id          in  per_all_assignments_f.assignment_id%Type
1791    ,p_datetrack_mode         in  varchar2
1792    ,p_validation_start_date  in  date
1793    ,p_del_end_future_spp     in  out nocopy boolean);
1794 --
1795 -- ----------------------------------------------------------------------------
1796 -- |-----------------------< chk_valid_placement_id >--------------------------|
1797 -- ----------------------------------------------------------------------------
1798 -- {Start Of Comments}
1799 --
1800 -- Description:
1801 --
1802 --   This procedure will remove invalid SPP records for the given assignment.
1803 --
1804 -- Prerequisites:
1805 --
1806 --   None
1807 --
1808 -- In Parameters:
1809 --   Name                           Reqd Type     Description
1810 --   p_assignment_id                 Yes number
1811 --   p_datetrack_mode                Yes varchar2
1812 --   p_validation_start_date         Yes date
1813 --
1814 --
1815 -- Post Success:
1816 --
1817 --   Will remove all invalid SPP records for the given assignment id.
1818 --   Name                           Type          Description
1819 --   p_del_end_future_spp           boolean       Set to true if any
1820 --                                                invalid or future SPP
1821 --                                                records are deleted
1822 --                                                depends on DT mode
1823 --
1824 -- Post Failure:
1825 --
1826 --   None
1827 --
1828 -- Access Status:
1829 --   Internal Development Use Only.
1830 --
1831 -- {End Of Comments}
1832 --
1833 procedure chk_valid_placement_id
1834    (p_assignment_id          in  per_all_assignments_f.assignment_id%Type
1835    ,p_placement_id           in  per_spinal_point_placements_f.placement_id%Type
1836    ,p_validation_start_date  in  date);
1837 --
1838 -- ----------------------------------------------------------------------------
1839 -- |-----------------------< ben_delete_assgt_checks >--------------------------|
1840 -- ----------------------------------------------------------------------------
1841 -- {Start Of Comments}
1842 --
1843 -- Description:
1844 --
1845 --   This procedure will set the out parameter p_life_events_exists if there
1846 --   are any Started Life Events exists for the assignment that is beign deleted.
1847 --
1848 -- Prerequisites:
1849 --
1850 --   None
1851 --
1852 -- In Parameters:
1853 --   Name                           Reqd Type     Description
1854 --   p_assignment_id                 Yes number
1855 --   p_datetrack_mode                Yes varchar2
1856 --
1857 --
1858 -- Post Success:
1859 --
1860 --   Name                           Type          Description
1861 --   p_life_events_exists           boolean       Set to true if any
1862 --                                                invalid or future SPP
1863 --                                                records are deleted
1864 --                                                depends on DT mode
1865 --
1866 -- Post Failure:
1867 --
1868 --   None
1869 --
1870 -- Access Status:
1871 --   Internal Development Use Only.
1872 --
1873 -- {End Of Comments}
1874 --
1875 procedure ben_delete_assgt_checks
1876    (p_assignment_id         in  per_all_assignments_f.assignment_id%Type
1877    ,p_datetrack_mode        in  varchar2
1878    ,p_life_events_exists    out NOCOPY boolean);
1879 --
1880 --
1881 -- ----------------------------------------------------------------------------
1882 -- |-----------------------< irc_delete_assgt_checks  >------------------------|
1883 -- ----------------------------------------------------------------------------
1884 -- {Start Of Comments}
1885 --
1886 -- Description:
1887 --
1888 --   If there is an Offer for an Assignment that is selected for Deletion, then
1889 --   User should not be allowed to process the Delete operation further.
1890 --
1891 --   When Deleting an Assignment or Date Track range of an Assignment, application
1892 --   should delete the corresponding Assignment Status History Rows.
1893 --
1894 --   If the Assignment that is selected for Deletion has any life events with status
1895 --   'Started', then user should be notified by setting a warning to back out the
1896 --   life events.
1897 --
1898 -- Prerequisites:
1899 --
1900 --   None
1901 --
1902 -- In Parameters:
1903 --   Name                           Reqd Type     Description
1904 --   p_assignment_id                 Yes number
1905 --   p_datetrack_mode                Yes varchar2
1906 --   p_validation_start_date         Yes date
1907 --
1908 --
1909 -- Post Success:
1910 --
1911 --   Will remove all the corresponding rows in irc_assignment_statuses
1912 --
1913 -- Post Failure:
1914 --
1915 --   None
1916 --
1917 -- Access Status:
1918 --   Internal Development Use Only.
1919 --
1920 -- {End Of Comments}
1921 --
1922 procedure irc_delete_assgt_checks
1923    (p_assignment_id         in per_all_assignments_f.assignment_id%Type
1924    ,p_datetrack_mode        in varchar2
1925    ,p_validation_start_date in date );
1926 --
1927 -- ----------------------------------------------------------------------------
1928 -- |------------------------------< pre_delete >-------------------------------|
1929 -- ----------------------------------------------------------------------------
1930 -- {Start Of Comments}
1931 --
1932 -- Description:
1933 --
1934 --   This procedure will remove invalid SPP records for the given assignment.
1935 --
1936 -- Prerequisites:
1937 --
1938 --   None
1939 --
1940 -- In Parameters:
1941 --   Name                           Reqd Type     Description
1942 --   p_rec                          Yes per_asg_shd.g_rec_type
1943 --   p_datetrack_mode               Yes varchar2
1944 --   p_validation_start_date        Yes date
1945 --   p_validation_end_date          Yes date
1946 --
1947 --
1948 -- Post Success:
1949 --
1950 --   Name                           Type          Description
1951 --   p_org_now_no_manager_warning   boolean       Set to true if organization
1952 --                                                do not have a manager now
1953 --   p_loc_change_tax_issues        boolean       Set to true if there is any
1954 --                                                affect on fed tax records due
1955 --                                                to the location change
1956 --   p_delete_asg_budgets           boolean       Set to true if assignment budget
1957 --                                                values are deleted
1958 --   p_element_salary_warning       boolean       Set to true if salary elements
1959 --                                                have an impact of the provided
1960 --                                                Delete operation.
1961 --   p_element_entries_warning      boolean       Set to true if any elements entries
1962 --                                                have an impact of the provided
1963 --                                                Delete operation.
1964 --   p_spp_warning                  boolean       Set to true if any grade step
1965 --                                                progression records have an
1966 --                                                impact due to the current Delete
1967 --   p_cost_warning                 boolean       Set to true if Cost records are
1968 --                                                not adjusted as per the assignment
1969 --   p_life_events_exists   	    boolean       Set to true if there are any
1970 --                                                Life Events with status "Started"
1971 --                                                are available for the deleted assignment
1972 --   p_cobra_coverage_elements      boolean       Set to true if COBRA coverage elements
1973 --                                                got Invalidated
1974 --   p_assgt_term_elements          boolean       Set to true if an Assignment with
1975 --                                                status "TERM_ASSIGN" has been
1976 --                                                deleted and elements are not adjusted
1977 --   Post Failure:
1978 --
1979 --   None
1980 --
1981 -- Access Status:
1982 --   Internal Development Use Only.
1983 --
1984 -- {End Of Comments}
1985 --
1986 procedure pre_delete
1987     (p_rec                         in  per_asg_shd.g_rec_type,
1988      p_effective_date              in  date,
1989      p_datetrack_mode              in  varchar2,
1990      p_validation_start_date       in  date,
1991      p_validation_end_date         in  date,
1992      p_org_now_no_manager_warning  out nocopy boolean,
1993      p_loc_change_tax_issues       OUT nocopy boolean,
1994      p_delete_asg_budgets          OUT nocopy boolean,
1995      p_element_salary_warning      OUT nocopy boolean,
1996      p_element_entries_warning     OUT nocopy boolean,
1997      p_spp_warning                 OUT nocopy boolean,
1998      p_cost_warning                OUT nocopy boolean,
1999      p_life_events_exists   	   OUT nocopy boolean,
2000      p_cobra_coverage_elements     OUT nocopy boolean,
2001      p_assgt_term_elements         OUT nocopy boolean,
2002      --
2003      p_new_prim_ass_id             OUT nocopy number,
2004      p_prim_change_flag            OUT nocopy varchar2,
2005      p_new_end_date                OUT nocopy date,
2006      p_new_primary_flag            OUT nocopy varchar2,
2007      p_s_pay_id                    OUT nocopy number,
2008      p_cancel_atd                  OUT nocopy date,
2009      p_cancel_lspd                 OUT nocopy date,
2010      p_reterm_atd                  OUT nocopy date,
2011      p_reterm_lspd                 OUT nocopy date,
2012      ---
2013      p_appl_asg_new_end_date       OUT nocopy date );
2014 --
2015 --
2016 -- ----------------------------------------------------------------------------
2017 -- |--------------------------------< post_delete >----------------------------|
2018 -- ----------------------------------------------------------------------------
2019 -- {Start Of Comments}
2020 --
2021 -- Description:
2022 --
2023 --   This procedure will remove invalid SPP records for the given assignment.
2024 --
2025 -- Prerequisites:
2026 --
2027 --   None
2028 --
2029 -- In Parameters:
2030 --   Name                           Reqd Type     Description
2031 --   p_rec                          Yes per_asg_shd.g_rec_type
2032 --   p_datetrack_mode               Yes varchar2
2033 --   p_validation_start_date        Yes date
2034 --   p_validation_end_date        Yes date
2035 --
2036 --
2037 -- Post Success:
2038 --
2039 --   Name                           Type          Description
2040 --   p_org_now_no_manager_warning   boolean       Set to true if organization
2041 --                                                do not have a manager now
2042 --   p_loc_change_tax_issues        boolean       Set to true if there is any
2043 --                                                affect on fed tax records due
2044 --                                                to the location change
2045 --   p_delete_asg_budgets           boolean       Set to true if assignment budget
2046 --                                                values are deleted
2047 --   p_element_salary_warning       boolean       Set to true if salary elements
2048 --                                                have an impact of the provided
2049 --                                                Delete operation.
2050 --   p_element_entries_warning      boolean       Set to true if any elements entries
2051 --                                                have an impact of the provided
2052 --                                                Delete operation.
2053 --   p_spp_warning                  boolean       Set to true if any grade step
2054 --                                                progression records have an
2055 --                                                impact due to the current Delete
2056 --   p_cost_warning                 boolean       Set to true if Cost records are
2057 --                                                not adjusted as per the assignment
2058 --   p_life_events_exists   	    boolean       Set to true if there are any
2059 --                                                Life Events with status "Started"
2060 --                                                are available for the deleted assignment
2061 --   p_cobra_coverage_elements      boolean       Set to true if COBRA coverage elements
2062 --                                                got Invalidated
2063 --   p_assgt_term_elements          boolean       Set to true if an Assignment with
2064 --                                                status "TERM_ASSIGN" has been
2065 --                                                deleted and elements are not adjusted
2066 --
2067 -- Post Failure:
2068 --
2069 --   None
2070 --
2071 -- Access Status:
2072 --   Internal Development Use Only.
2073 --
2074 -- {End Of Comments}
2075 --
2076 procedure post_delete
2077     (p_rec                         in per_asg_shd.g_rec_type,
2078      p_effective_date              in date,
2079      p_datetrack_mode              in varchar2,
2080      p_validation_start_date       in date,
2081      p_validation_end_date         in date,
2082      p_org_now_no_manager_warning  out nocopy boolean,
2083      p_loc_change_tax_issues       OUT nocopy boolean,
2084      p_delete_asg_budgets          OUT nocopy boolean,
2085      p_element_salary_warning      OUT nocopy boolean,
2086      p_element_entries_warning     OUT nocopy boolean,
2087      p_spp_warning                 OUT nocopy boolean,
2088      p_cost_warning                OUT nocopy boolean,
2089      p_life_events_exists   	   OUT nocopy boolean,
2090      p_cobra_coverage_elements     OUT nocopy boolean,
2091      p_assgt_term_elements         OUT nocopy boolean,
2092      --
2093      p_new_prim_ass_id             IN number,
2094      p_prim_change_flag            IN varchar2,
2095      p_new_end_date                IN date,
2096      p_new_primary_flag            IN varchar2,
2097      p_s_pay_id                    IN number,
2098      p_cancel_atd                  IN date,
2099      p_cancel_lspd                 IN date,
2100      p_reterm_atd                  IN date,
2101      p_reterm_lspd                 IN date,
2102      ---
2103      p_appl_asg_new_end_date       IN date );
2104 --
2105 -- ----------------------------------------------------------------------------
2106 -- Bug#14700032. FTE Calculation logic is available in PUI through PQH_GEN.pld
2107 -- The same code is available via pegbasgp.pkb from SSHR for UK legislation only.
2108 -- This procedure is created for calculating the FTE values from SSHR for all
2109 -- other legislations except GB.
2110 -- This procedure is used to calculate FTE.
2111 -- ----------------------------------------------------------------------------
2112 
2113 -- |-------------------------< auto_calc_FTE >--------------------------|
2114 
2115 
2116 procedure auto_calc_fte (p_assignment_id in number,
2117                          p_effective_start_date in Date);
2118 
2119 end hr_assignment_internal;