1 Package Body PAY_KW_XDO_TEMPLATE as
2 /* $Header: pykwxdtp.pkb 120.4.12020000.3 2013/02/26 11:13:11 bkeshary ship $ */
3 --
4 PROCEDURE end_date_2005(p_file_id NUMBER)
5 IS
6 l_upload_name VARCHAR2(1000);
7 l_file_name VARCHAR2(1000);
8 l_gb_file_id NUMBER;
9 l_start_date DATE ;
10 l_end_date DATE ;
11 BEGIN
12
13 L_START_DATE := TO_DATE('01/01/2005', 'mm/dd/yyyy');
14 l_end_date := TO_DATE('12/31/4712', 'mm/dd/yyyy');
15 -- program_name will be used to store the file_name
16 -- this is bcos the file_name in fnd_lobs contains
17 -- the full patch of the doc and not just the file name
18 SELECT program_name
19 INTO l_file_name
20 FROM fnd_lobs
21 WHERE file_id = p_file_id;
22
23 -- the delete will ensure that the patch is rerunnable!
24 DELETE FROM per_gb_xdo_templates
25 WHERE file_name = l_file_name AND
26 effective_start_date = l_start_date AND
27 effective_end_date = l_end_date;
28
29 INSERT INTO per_gb_xdo_templates
30 (file_id,
31 file_name,
32 file_description,
33 effective_start_date,
34 effective_end_date)
35 SELECT p_file_id, l_file_name, 'Template for year 2005',
36 l_start_date, l_end_date
37 FROM fnd_lobs
38 WHERE file_id = p_file_id;
39 END end_date_2005;
40 --
41 PROCEDURE end_date_2006(p_file_id NUMBER)
42 IS
43 l_upload_name VARCHAR2(1000);
44 l_file_name VARCHAR2(1000);
45 l_gb_file_id NUMBER;
46 l_start_date DATE ;
47 l_end_date DATE ;
48 BEGIN
49
50 L_START_DATE := TO_DATE('01/01/2006', 'mm/dd/yyyy');
51 l_end_date := TO_DATE('12/31/4712', 'mm/dd/yyyy');
52 -- program_name will be used to store the file_name
53 -- this is bcos the file_name in fnd_lobs contains
54 -- the full patch of the doc and not just the file name
55 SELECT program_name
56 INTO l_file_name
57 FROM fnd_lobs
58 WHERE file_id = p_file_id;
59
60 -- the delete will ensure that the patch is rerunnable!
61 DELETE FROM per_gb_xdo_templates
62 WHERE file_name = l_file_name AND
63 effective_start_date = l_start_date AND
64 effective_end_date = l_end_date;
65
66 INSERT INTO per_gb_xdo_templates
67 (file_id,
68 file_name,
69 file_description,
70 effective_start_date,
71 effective_end_date)
72 SELECT p_file_id, l_file_name, 'Template for year 2006',
73 l_start_date, l_end_date
74 FROM fnd_lobs
75 WHERE file_id = p_file_id;
76 END end_date_2006;
77 --
78
79 --
80 PROCEDURE end_date_2007(p_file_id NUMBER)
81 IS
82 l_upload_name VARCHAR2(1000);
83 l_file_name VARCHAR2(1000);
84 l_gb_file_id NUMBER;
85 l_start_date DATE ;
86 l_end_date DATE ;
87 BEGIN
88
89 L_START_DATE := TO_DATE('01/08/2007', 'mm/dd/yyyy');
90 l_end_date := TO_DATE('12/31/4712', 'mm/dd/yyyy');
91 -- program_name will be used to store the file_name
92 -- this is bcos the file_name in fnd_lobs contains
93 -- the full patch of the doc and not just the file name
94 SELECT program_name
95 INTO l_file_name
96 FROM fnd_lobs
97 WHERE file_id = p_file_id;
98
99 -- the delete will ensure that the patch is rerunnable!
100 DELETE FROM per_gb_xdo_templates
101 WHERE file_name = l_file_name AND
102 effective_start_date = l_start_date AND
103 effective_end_date = l_end_date;
104
105 INSERT INTO per_gb_xdo_templates
106 (file_id,
107 file_name,
108 file_description,
109 effective_start_date,
110 effective_end_date)
111 SELECT p_file_id, l_file_name, 'Template for year 2007',
112 l_start_date, l_end_date
113 FROM fnd_lobs
114 WHERE file_id = p_file_id;
115 END end_date_2007;
116
117 --
118
119 --
120 /* Bug 9719231 */
121 PROCEDURE end_date_2010(p_file_id NUMBER)
122 IS
123 l_upload_name VARCHAR2(1000);
124 l_file_name VARCHAR2(1000);
125 l_gb_file_id NUMBER;
126 l_start_date DATE ;
127 l_end_date DATE ;
128 BEGIN
129
130 L_START_DATE := TO_DATE('08/01/2010', 'mm/dd/yyyy');
131 l_end_date := TO_DATE('12/31/4712', 'mm/dd/yyyy');
132 -- program_name will be used to store the file_name
133 -- this is bcos the file_name in fnd_lobs contains
134 -- the full patch of the doc and not just the file name
135 SELECT program_name
136 INTO l_file_name
137 FROM fnd_lobs
138 WHERE file_id = p_file_id;
139
140 -- the delete will ensure that the patch is rerunnable!
141 DELETE FROM per_gb_xdo_templates
142 WHERE file_name = l_file_name AND
143 effective_start_date = l_start_date AND
144 effective_end_date = l_end_date;
145
146 INSERT INTO per_gb_xdo_templates
147 (file_id,
148 file_name,
149 file_description,
150 effective_start_date,
151 effective_end_date)
152 SELECT p_file_id, l_file_name, 'Template for year 2010',
153 l_start_date, l_end_date
154 FROM fnd_lobs
155 WHERE file_id = p_file_id;
156 END end_date_2010;
157 --
158
159 /* changes in oct 2012 for report 166 */
160 PROCEDURE end_date_2012(p_file_id NUMBER)
161 IS
162 l_upload_name VARCHAR2(1000);
163 l_file_name VARCHAR2(1000);
164 l_gb_file_id NUMBER;
165 l_start_date DATE ;
166 l_end_date DATE ;
167 BEGIN
168
169 ad_zd_seed.prepare('PER_GB_XDO_TEMPLATES'); -- bug 16398512
170
171 L_START_DATE := TO_DATE('10/01/2012', 'mm/dd/yyyy');
172 l_end_date := TO_DATE('12/31/4712', 'mm/dd/yyyy');
173 -- program_name will be used to store the file_name
174 -- this is bcos the file_name in fnd_lobs contains
175 -- the full patch of the doc and not just the file name
176 SELECT program_name
177 INTO l_file_name
178 FROM fnd_lobs
179 WHERE file_id = p_file_id;
180
181 -- the delete will ensure that the patch is rerunnable!
182 DELETE FROM per_gb_xdo_templates
183 WHERE file_name = l_file_name AND
184 effective_start_date = l_start_date AND
185 effective_end_date = l_end_date;
186
187 INSERT INTO per_gb_xdo_templates
188 (file_id,
189 file_name,
190 file_description,
191 effective_start_date,
192 effective_end_date)
193 SELECT p_file_id, l_file_name, 'Template for year 2012',
194 l_start_date, l_end_date
195 FROM fnd_lobs
196 WHERE file_id = p_file_id;
197 END end_date_2012;
198 --
199
200 END;