DBA Data[Home] [Help]
Skip to content

PACKAGE: APPS.HR_ENTRY

Source


1 package hr_entry as
2 /* $Header: pyeentry.pkh 120.0.12010000.1 2008/07/27 22:29:52 appldev ship $ */
3 --
4  -- Global TYPE definitions
5  type number_table   is table of number not null
6                         index by binary_integer;
7  type varchar2_table is table of varchar2(80)
8                         index by binary_integer;
9 --
10 -- ----------------- Assignment_eligible_for_link -----------------------------
11 --
12 -- NAME
13 -- hr_entry.Assignment_eligible_for_link
14 --
15 -- DESCRIPTION
16 -- Returns 'Y' if the specified assignment and link match as at the
17 -- specified date. A match indicates that the assignment is eligible for
18 -- the link as at that date. This function may be called from within SQL.
19 -- If no match is found then 'N' will be returned (it never returns NULL).
20 --
21 function Assignment_eligible_for_link (
22 --
23 p_assignment_id         in natural,
24 p_element_link_id       in natural,
25 p_effective_date        in date
26 ) return varchar2;
27 --
28 --pragma restrict_references (Assignment_eligible_for_link, WNDS, WNPS);
29 -- ---------------------------------------------------------------------------
30 --
31 -- NAME
32 -- hr_entry.return_termination_date
33 --
34 -- DESCRIPTION
35 -- Returns the actual_termination_date if an assignment has been
36 -- terminated.
37 -- If the assignment has not been terminated then the returned
38 -- actual_termination_date date will be null.
39 --
40  function return_termination_date(p_assignment_id in number,
41                                   p_session_date  in date)
42           return date;
43 --
44 -- NAME
45 -- hr_entry.get_nonrecurring_dates
46 --
47 -- DESCRIPTION
48 -- Called when a nonrecurring entry is about to be created. Makes sure that
49 -- the assignment is to a payroll and also a time period exists. Returns the
50 -- start and end dates of the nonrecurring entry taking into account
51 -- changes in payroll.
52 --
53  procedure get_nonrecurring_dates
54  (
55   p_assignment_id         in            number,
56   p_session_date          in            date,
57   p_effective_start_date     out nocopy date,
58   p_effective_end_date       out nocopy date,
59   p_payroll_id               out nocopy number,
60   p_period_start_date        out nocopy date,
61   p_period_end_date          out nocopy date
62  );
63 --
64 --
65 -- --------------------- return_qualifying_conditions -------------------------
66 --
67 -- Name: return_qualifying_conditions
68 --
69 -- Description: If the element entry link is discretionary and has
70 --              qualifying conditions then check the length of
71 --              service and age conditions.
72 --
73 -- Returns: p_los_date --> date at which the los is eligible.
74 --          p_age_date --> date at which the age is eligible.
75 --
76 --          If dates return null then check is not valid.
77 --
78 procedure return_qualifying_conditions
79 (
80  p_assignment_id        in        number,
81  p_element_link_id      in        number,
82  p_session_date         in        date,
83  p_los_date            out nocopy date,
84  p_age_date            out nocopy date
85 );
86 --
87  /*
88  NAME
89  hr_entry.generate_entry_id
90 
91  DESCRIPTION
92  Generates then next sequence value for inserting an element entry into the
93  PAY_ELEMENT_ENTRIES_F base table.
94  */
95 --
96  FUNCTION generate_entry_id return number;
97 --
98  /*
99  NAME
100  hr_entry.generate_run_result_id
101 
102  DESCRIPTION
103  Generates then next sequence value for inserting a run result into
104  PAY_RUN_RESULTS base table.
105  */
106 --
107  FUNCTION generate_run_result_id return number;
108 --
109  /*
110  NAME
111  hr_entry.entry_process_in_run
112 
113  DESCRIPTION
114  This function return a boolean value for the specified element_type_id
115  depending on the process_in_run_flag attribute. The function returns TRUE
116  if the process_in_run_flag = 'Y' or FALSE if the process_in_run_flag = 'N'
117  */
118 --
119  FUNCTION entry_process_in_run(p_element_type_id in number,
120                                p_session_date    in date) return boolean;
121 --
122  /*
123  NAME
124  hr_entry.get_eligibility_period
125 
126  DESCRIPTION
127  This procedure selects the minimum or maximum (or both) effective assignment
128  dates where the assignment is eligible for a given element link.
129  */
130  PROCEDURE get_eligibility_period (
131     p_assignment_id         in number,
132     p_element_link_id       in number,
133     p_session_date          in date,
134     p_min_eligibility_date in out nocopy date,
135     p_max_eligibility_date in out nocopy date
136  );
137 --
138  /*
139  NAME
140  hr_entry.entry_asg_pay_link_dates
141 
142  DESCRIPTION
143  This procedure returns the min(effective_start/end_date) for a specified
144  element link and payroll. Also, if the specified employee assignment has
145  been terminated the element termination date as of the termination rule
146  is returned.
147  */
148  PROCEDURE entry_asg_pay_link_dates (p_assignment_id            in number,
149               p_element_link_id          in number,
150               p_session_date             in date,
151               p_element_term_rule_date  out nocopy date,
152               p_element_link_start_date out nocopy date,
153               p_element_link_end_date   out nocopy date,
154               p_payroll_start_date      out nocopy date,
155               p_payroll_end_date        out nocopy date,
156               p_entry_mode               in boolean default true);
157 --
158  /*
159  NAME
160  hr_entry.recurring_entry_end_date
161 
162  DESCRIPTION
163  This function is used to return the valid effective end of a recurring entry.
164  */
165  function recurring_entry_end_date
166  (
167   p_assignment_id             in number,
168   p_element_link_id           in number,
169   p_session_date              in date,
170   p_overlap_chk               in varchar2 default 'Y',
171   p_mult_entries_allowed_flag in varchar2,
172   p_element_entry_id          in number,
173   p_original_entry_id         in number
174  ) return date;
175 --
176  /*
177  NAME
178  hr_entry.chk_element_entry_eligbility
179 
180  DESCRIPTION
181  This procedure is used to check if entries (which are defined below) are
182  eligble to be inserted/deleted.
183  This procedure is only called when:
184  1) Inserting an NONRECURRING element entry
185     (which is defined as: Nonrecurring, Additional, Override, Adjustment,
186      Balance Adjustment etc).
187     e.g. when (p_usage = 'INSERT'         and
188              ((p_processing_type  = 'R'   and
189                p_entry_type      != 'E')  or
190                p_processing_type  = 'N'))
191 
192  2) DateTrack deleting (Next/Future Changes) of a RECURRING element entry.
193     e.g. (p_dt_delete_mode    = 'DELETE_NEXT_CHANGE' or
194           p_dt_delete_mode    = 'FUTURE_CHANGES')
195  */
196  PROCEDURE chk_element_entry_eligbility (p_assignment_id         in number,
197                                          p_element_link_id       in number,
198                                          p_session_date          in date,
199                                          p_usage                 in varchar2,
200                                          p_validation_start_date in date,
201                                          p_validation_end_date   in date,
202                                          p_min_eligibility_date out nocopy date,
203                                          p_max_eligibility_date out nocopy date);
204  /*
205  NAME
206  hr_entry.chk_element_entry_open
207 
208  DESCRIPTION
209  This procedure does the following checks:
210  1) Ensure that the element type is not closed for entry currently
211     or in the future by determining the value of the
212     CLOSED_FOR_ENTRY_FLAG attribute on PAY_ELEMENT_TYPES_F.
213  2) If the employee assignment is to a payroll then ensure that
214     the current and future periods as of session date are open.
215     If the period is closed, you can only change entries providing
216  */
217  PROCEDURE chk_element_entry_open (p_element_type_id          in number,
218                                    p_session_date             in date,
219                                    p_validation_start_date    in date,
220                                    p_validation_end_date      in date,
221                                    p_assignment_id            in number);
222 --
223  /*
224  NAME
225  hr_entry.derive_default_value
226 
227  DESCRIPTION
228  This procedure is used to return default screen and database formatted
229  values in either a cold or hot format for the specified link and
230  input value. The default value can be for Minimum, Maximum or Default
231  values.
232  Therefore, it hot defaults are being used the returned database value
233  will be null but, the return screen value will be encapsulated in
234  */
235  PROCEDURE derive_default_value (p_element_link_id         in number,
236                                  p_input_value_id          in number,
237                                  p_session_date            in date,
238                                  p_input_currency_code     in varchar2,
239                                  p_min_max_def             in varchar2
240                                                               default 'DEF',
241                                  v_screen_format_value    out nocopy varchar2,
242                                  v_database_format_value  out nocopy varchar2);
243 --
244  /*
245  NAME
246  hr_entry.chk_mandatory_input_value
247 
248  DESCRIPTION
249  This procedure produces an error is any input value which is defined as
250  having a mandatory value is null.
251  */
252  PROCEDURE chk_mandatory_input_value (p_input_value_id  in number,
253                                       p_entry_value     in varchar2,
254                                       p_session_date    in date,
255                                       p_element_link_id in number);
256 --
257    /*
258    NAME
259    hr_entry.chk_element_entry
260 
261    DESCRIPTION
262    This procedure is a cover to chk_element_entry_main and simply calls
263    chk_element_entry_main with a null p_creator_type.
264    This change has been made because overloading can't be used because
265    chk_element_entry is called from forms.
266    */
267 --
268  procedure chk_element_entry
269  (
270   p_element_entry_id         in number,
271   p_original_entry_id        in number,
272   p_session_date             in date,
273   p_element_link_id          in number,
274   p_assignment_id            in number,
275   p_entry_type               in varchar2,
276   p_effective_start_date in out nocopy date,
277   p_effective_end_date   in out nocopy date,
278   p_validation_start_date    in date,
279   p_validation_end_date      in date,
280   p_dt_update_mode           in varchar2,
281   p_dt_delete_mode           in varchar2,
282   p_usage                    in varchar2,
283   p_target_entry_id          in number
284  );
285 --
286    /*
287    NAME
288    hr_entry.chk_element_entry_main
289 
290    DESCRIPTION
291    This procedure is used for referential/standard checks when inserting/
292    updating or deleteing element enries.
293    */
294 --
295  procedure chk_element_entry_main
296  (
297   p_element_entry_id         in number,
298   p_original_entry_id        in number,
299   p_session_date             in date,
300   p_element_link_id          in number,
301   p_assignment_id            in number,
302   p_entry_type               in varchar2,
303   p_effective_start_date in out nocopy date,
304   p_effective_end_date   in out nocopy date,
305   p_validation_start_date    in date,
306   p_validation_end_date      in date,
307   p_dt_update_mode           in varchar2,
308   p_dt_delete_mode           in varchar2,
309   p_usage                    in varchar2,
310   p_target_entry_id          in number,
311   p_creator_type             in varchar2
312  );
313 --
314    /*
315    NAME
316    hr_entry.del_3p_entry_values
317 
318    DESCRIPTION
319    This procedure is used for third party deletes from:
320    PAY_ELEMENT_ENTRIES_F      (If an abscence etc).
321    PAY_ELEMENT_ENTRY_VALUES_F (Entry Values are always deleted).
322    PAY_RUN_RESULTS            (If nonrecurring, and exist).
323    PAY_RUN_RESULT_VALUES      (If nonrecurring, and exist).
324    */
325 --
326  PROCEDURE del_3p_entry_values (p_assignment_id                  in number,
327                                 p_element_entry_id               in number,
328                                 p_element_type_id                in number,
329                                 p_element_link_id                in number,
330                                 p_entry_type                     in varchar2,
331                                 p_processing_type                in varchar2,
332                                 p_creator_type                   in varchar2,
333                                 p_creator_id                     in varchar2,
334                                 p_dt_delete_mode                 in varchar2,
335                                 p_session_date                   in date,
336                                 p_validation_start_date          in date,
337                                 p_validation_end_date            in date);
338 --
339 --
340    /*
341    NAME
342    hr_entry.trigger_workload_shifting
343 
344    DESCRIPTION
345    This procedure is used for triggering workload shifting.
346    */
347 --
348  PROCEDURE trigger_workload_shifting(p_mode                 varchar2,
349                                      p_assignment_id          number,
350                                      p_effective_start_date   date,
351                                      p_effective_end_date     date);
352 --
353 -- NAME
354 -- hr_entry.check_format
355 --
356 -- DESCRIPTION
357 -- Makes sure that the entry value is correct for the UOM and also convert the
358 -- screen value into the database value ie. internal format.
359 --
360  procedure check_format
361  (
362   p_element_link_id     in            number,
363   p_input_value_id      in            number,
364   p_session_date        in            date,
365   p_formatted_value     in out nocopy varchar2,
366   p_database_value      in out nocopy varchar2,
367   p_nullok              in            varchar2 default 'Y',
368   p_min_max_failure     in out nocopy varchar2,
369   p_warning_or_error       out nocopy varchar2,
370   p_minimum_value          out nocopy varchar2,
371   p_maximum_value          out nocopy varchar2
372  );
373 --
374 -- NAME
375 -- hr_entry.maintain_cost_keyflex
376 --
377 -- DESCRIPTION
378 --
379  function maintain_cost_keyflex(
380             p_cost_keyflex_structure     in number,
381             p_cost_allocation_keyflex_id in number,
382             p_concatenated_segments      in varchar2,
383             p_summary_flag               in varchar2,
384             p_start_date_active          in date,
385             p_end_date_active            in date,
386             p_segment1                   in varchar2,
387             p_segment2                   in varchar2,
388             p_segment3                   in varchar2,
389             p_segment4                   in varchar2,
390             p_segment5                   in varchar2,
391             p_segment6                   in varchar2,
392             p_segment7                   in varchar2,
393             p_segment8                   in varchar2,
394             p_segment9                   in varchar2,
395             p_segment10                  in varchar2,
396             p_segment11                  in varchar2,
400             p_segment15                  in varchar2,
397             p_segment12                  in varchar2,
398             p_segment13                  in varchar2,
399             p_segment14                  in varchar2,
401             p_segment16                  in varchar2,
402             p_segment17                  in varchar2,
403             p_segment18                  in varchar2,
404             p_segment19                  in varchar2,
405             p_segment20                  in varchar2,
406             p_segment21                  in varchar2,
407             p_segment22                  in varchar2,
408             p_segment23                  in varchar2,
409             p_segment24                  in varchar2,
410             p_segment25                  in varchar2,
411             p_segment26                  in varchar2,
412             p_segment27                  in varchar2,
413             p_segment28                  in varchar2,
414             p_segment29                  in varchar2,
415             p_segment30                  in varchar2)
416           return number;
417 --
418 -- NAME
419 -- hr_entry.return_entry_display_status
420 --
421 -- DESCRIPTION
422 -- Used by PAYEEMEE/PAYWSMEE to return current entry statuses during a
423 -- post-query.
424 --
425  procedure return_entry_display_status(p_element_entry_id  in number,
426                                        p_element_type_id   in number,
427                                        p_element_link_id   in number,
428                                        p_assignment_id     in number,
429                                        p_entry_type        in varchar2,
430                                        p_session_date      in date,
431                                        p_additional       out nocopy varchar2,
432                                        p_adjustment       out nocopy varchar2,
433                                        p_overridden       out nocopy varchar2,
434                                        p_processed        out nocopy varchar2);
435 --
436 -- NAME
437 -- hr_entry.Ins_3p_entry_values
438 --
439 -- DESCRIPTION
440 -- This function is used for third party inserts into:
441 -- PAY_ELEMENT_ENTRIES_F      (If an abscence, or DT functions are being used).
442 -- PAY_ELEMENT_ENTRY_VALUES_F (Entry Values are always inserted).
443 -- PAY_RUN_RESULTS            (If nonrecurring).
444 -- PAY_RUN_RESULT_VBALUES     (If nonrecurring).
445 --
446 -- NB. this function is OVERLOADED !
447 --
448  procedure ins_3p_entry_values
449  (
450   p_element_link_id    number,
451   p_element_entry_id   number,
452   p_session_date       date,
453   p_num_entry_values   number,
454   p_input_value_id_tbl hr_entry.number_table,
455   p_entry_value_tbl    hr_entry.varchar2_table
456  );
457 --
458 --
459 -- NAME
460 -- hr_entry.ins_3p_entry_values
461 --
462 -- DESCRIPTION
463 -- This function is used for third party inserts into:
464 -- PAY_ELEMENT_ENTRIES_F      (If an abscence, or DT functions are being used).
465 -- PAY_ELEMENT_ENTRY_VALUES_F (Entry Values are always inserted).
466 -- PAY_RUN_RESULTS            (If nonrecurring).
467 -- PAY_RUN_RESULT_VBALUES     (If nonrecurring).
468 --
469 -- NB. this function is OVERLOADED !
470 --
471  procedure ins_3p_entry_values
472  (
473   p_element_link_id  number,
474   p_element_entry_id number,
475   p_session_date     date,
476 /** sbilling **/
477   p_creator_type     varchar2,
478   p_entry_type       varchar2,
479   p_input_value_id1  number,
480   p_input_value_id2  number,
481   p_input_value_id3  number,
482   p_input_value_id4  number,
483   p_input_value_id5  number,
484   p_input_value_id6  number,
485   p_input_value_id7  number,
486   p_input_value_id8  number,
487   p_input_value_id9  number,
488   p_input_value_id10 number,
489   p_input_value_id11 number,
490   p_input_value_id12 number,
491   p_input_value_id13 number,
492   p_input_value_id14 number,
493   p_input_value_id15 number,
494   p_entry_value1     varchar2,
495   p_entry_value2     varchar2,
496   p_entry_value3     varchar2,
497   p_entry_value4     varchar2,
498   p_entry_value5     varchar2,
499   p_entry_value6     varchar2,
500   p_entry_value7     varchar2,
501   p_entry_value8     varchar2,
502   p_entry_value9     varchar2,
503   p_entry_value10    varchar2,
504   p_entry_value11    varchar2,
505   p_entry_value12    varchar2,
506   p_entry_value13    varchar2,
507   p_entry_value14    varchar2,
508   p_entry_value15    varchar2
509  );
510 --
511 -- NAME
512 -- hr_entry.upd_3p_entry_values
513 --
514 -- DESCRIPTION
515 -- This procedure is used for third party updates into:
516 -- PAY_ELEMENT_ENTRY_VALUES_F
517 -- PAY_RUN_RESULTS           (If nonrecurring).
518 -- PAY_RUN_RESULT_VALUES     (If nonrecurring).
519 --
520 -- NB. this procedure is OVERLOADED !
521 --
522  procedure upd_3p_entry_values
523  (
524   p_element_entry_id           number,
525   p_element_type_id            number,
526   p_element_link_id            number,
527   p_cost_allocation_keyflex_id number,
528   p_entry_type                 varchar2,
529   p_processing_type            varchar2,
530   p_creator_type               varchar2,
531   p_creator_id                 number,
532   p_assignment_id              number,
533   p_input_currency_code        varchar2,
534   p_output_currency_code       varchar2,
535   p_validation_start_date      date,
536   p_validation_end_date        date,
537   p_session_date               date,
538   p_dt_update_mode             varchar2,
539   p_num_entry_values           number,
540   p_input_value_id_tbl         hr_entry.number_table,
541   p_entry_value_tbl            hr_entry.varchar2_table
542  );
543 --
544 -- NAME
545 -- hr_entry.upd_3p_entry_values
546 --
547 -- DESCRIPTION
548 -- This procedure is used for third party updates into:
549 -- PAY_ELEMENT_ENTRY_VALUES_F
550 -- PAY_RUN_RESULTS           (If nonrecurring).
551 -- PAY_RUN_RESULT_VALUES     (If nonrecurring).
552 --
553 -- NB. this Procedure is OVERLOADED !
554 --
555  procedure upd_3p_entry_values
556  (
557   p_element_entry_id           number,
558   p_element_type_id            number,
559   p_element_link_id            number,
560   p_cost_allocation_keyflex_id number,
561   p_entry_type                 varchar2,
562   p_processing_type            varchar2,
563   p_creator_type               varchar2,
564   p_creator_id                 number,
565   p_assignment_id              number,
566   p_input_currency_code        varchar2,
567   p_output_currency_code       varchar2,
568   p_validation_start_date      date,
569   p_validation_end_date        date,
570   p_session_date               date,
571   p_dt_update_mode             varchar2,
572   p_input_value_id1            number,
573   p_input_value_id2            number,
574   p_input_value_id3            number,
575   p_input_value_id4            number,
576   p_input_value_id5            number,
577   p_input_value_id6            number,
578   p_input_value_id7            number,
579   p_input_value_id8            number,
580   p_input_value_id9            number,
581   p_input_value_id10           number,
582   p_input_value_id11           number,
583   p_input_value_id12           number,
584   p_input_value_id13           number,
585   p_input_value_id14           number,
586   p_input_value_id15           number,
587   p_entry_value1               varchar2,
588   p_entry_value2               varchar2,
589   p_entry_value3               varchar2,
590   p_entry_value4               varchar2,
591   p_entry_value5               varchar2,
592   p_entry_value6               varchar2,
593   p_entry_value7               varchar2,
594   p_entry_value8               varchar2,
595   p_entry_value9               varchar2,
596   p_entry_value10              varchar2,
597   p_entry_value11              varchar2,
598   p_entry_value12              varchar2,
599   p_entry_value13              varchar2,
600   p_entry_value14              varchar2,
601   p_entry_value15              varchar2
602  );
603 --
604 procedure chk_creator_type(p_element_entry_id      in number,
605                            p_creator_type          in varchar2,
606                            p_quickpay_mode         in varchar2,
607                            p_dml_operation         in varchar2,
608                            p_dt_update_mode        in varchar2,
609                            p_dt_delete_mode        in varchar2,
610                            p_validation_start_date in date,
611                            p_validation_end_date   in date);
612 --
613 --------------------------------------
614 --
615 -- NAME hr_entry.delete_covered_dependants
616 --
617 -- DESCRIPTION deals with calls to update BEN_COVERED_DPENDENTS for a given
618 --             element_entry
619 --
620 ---------------------------------------
621 procedure delete_covered_dependants(
622    p_validation_start_date in date,
623    p_element_entry_id      in number,
624    p_start_date            in date DEFAULT NULL,
625    p_end_date              in date DEFAULT NULL);
626 
627 
628 
629 ------------------------------------------
630 --
631 -- NAME hr_entry.delete_beneficiaries
632 --
633 -- DESCRIPTION deals with calls to update BEN_BENEFICIARIES for a given
634 --             element_entry
635 --
636 -------------------------------------------
637 procedure delete_beneficiaries(
638    p_validation_start_date in date,
639    p_element_entry_id      in number,
640    p_start_date            in date DEFAULT NULL,
641    p_end_date              in date DEFAULT NULL);
642 
643 end hr_entry;