[Home] [Help]
PACKAGE BODY: APPS.HXC_REC_PERIODS_UPLOAD_PKG
Source
1 PACKAGE BODY hxc_rec_periods_upload_pkg AS
2 /* $Header: hxchrpupl.pkb 115.5 2002/06/10 00:37:22 pkm ship $ */
3
4 PROCEDURE load_recurring_period_row (
5 p_name IN VARCHAR2
6 , p_start_date IN VARCHAR2
7 , p_end_date IN VARCHAR2
8 , p_period_type IN VARCHAR2
9 , p_duration_in_days IN NUMBER
10 , p_owner IN VARCHAR2
11 , p_custom_mode IN VARCHAR2 ) IS
12
13 l_recurring_period_id hxc_recurring_periods.recurring_period_id%TYPE;
14 l_ovn hxc_recurring_periods.object_version_number%TYPE;
15 l_owner VARCHAR2(6);
16
17 BEGIN
18
19 SELECT recurring_period_id
20 ,object_version_number
21 ,DECODE( NVL(last_updated_by,-1), 1, 'SEED', 'CUSTOM')
22 INTO l_recurring_period_id
23 ,l_ovn
24 ,l_owner
25 FROM hxc_recurring_periods
26 WHERE name = p_name;
27
28 IF (p_custom_mode = 'FORCE' OR p_owner = 'SEED') THEN
29 hxc_recurring_periods_api.update_recurring_periods
30 (p_validate => false
31 ,p_recurring_period_id => l_recurring_period_id
32 ,p_object_version_number => l_ovn
33 ,p_name => p_name
34 ,p_period_type => p_period_type
35 ,p_duration_in_days => p_duration_in_days
36 ,p_start_date => to_date(p_start_date, 'DD-MM-YYYY')
37 ,p_end_date => to_date(p_end_date, 'DD-MM-YYYY')
38 ,p_effective_date => sysdate
39 );
40
41 /* Use API instead of Row Handler */
42 /*
43 hxc_hrp_upd.upd
44 (p_effective_date => sysdate
45 ,p_recurring_period_id => l_recurring_period_id
46 ,p_object_version_number => l_ovn
47 ,p_name => p_name
48 ,p_start_date => to_date(p_start_date, 'DD-MM-YYYY')
49 ,p_end_date => to_date(p_end_date, 'DD-MM-YYYY')
50 ,p_period_type => p_period_type
51 ,p_duration_in_days => p_duration_in_days);
52 */
53
54 END IF;
55
56 EXCEPTION WHEN NO_DATA_FOUND
57 THEN
58
59 hxc_recurring_periods_api.create_recurring_periods
60 (p_validate => false
61 ,p_recurring_period_id => l_recurring_period_id
62 ,p_object_version_number => l_ovn
63 ,p_name => p_name
64 ,p_period_type => p_period_type
65 ,p_duration_in_days => p_duration_in_days
66 ,p_start_date => to_date(p_start_date, 'DD-MM-YYYY')
67 ,p_end_date => to_date(p_end_date, 'DD-MM-YYYY')
68 ,p_effective_date => sysdate
69 );
70
71 /* Use API instead of Row Handler */
72 /*
73 hxc_hrp_ins.ins
74 (p_effective_date => sysdate
75 ,p_name => p_name
76 ,p_start_date => to_date(p_start_date, 'DD-MM-YYYY')
77 ,p_end_date => to_date(p_end_date, 'DD-MM-YYYY')
78 ,p_period_type => p_period_type
79 ,p_duration_in_days => p_duration_in_days
80 ,p_recurring_period_id => l_recurring_period_id
81 ,p_object_version_number => l_ovn);
82 */
83
84 END load_recurring_period_row;
85
86 END hxc_rec_periods_upload_pkg;