DBA Data[Home] [Help]

PACKAGE BODY: APPS.FTP_BR_PREPAY_TABLE_PVT

Source


1 PACKAGE BODY ftp_br_prepay_table_pvt AS
2 /* $Header: ftpbpptb.pls 120.0 2005/06/06 19:11:23 appldev noship $ */
3 
4 G_PKG_NAME constant varchar2(30) := 'FTP_BR_PREPAY_TABLE_PVT';
5 
6 ------------------------------------------------------------
7 -- PRIVATE SPECS
8 ------------------------------------------------------------
9 
10 PROCEDURE DeletePrepayTableRuleRecs(
11   p_obj_def_id          in          number
12 );
13 
14 PROCEDURE DeleteTblDimensionValueRecs(
15   p_obj_def_id          in          number
16 );
17 
18 PROCEDURE DeleteTblHypercubeRecs(
19   p_obj_def_id          in          number
20 );
21 
22 
23 PROCEDURE CopyPrepayTableRuleRecs(
24   p_source_obj_def_id   in          number
25   ,p_target_obj_def_id  in          number
26   ,p_created_by         in          number
27   ,p_creation_date      in          date
28 );
29 
30 PROCEDURE CopyTblDimensionValueRecs(
31   p_source_obj_def_id   in          number
32   ,p_target_obj_def_id  in          number
33   ,p_created_by         in          number
34   ,p_creation_date      in          date
35 );
36 
37 PROCEDURE CopyTblHypercubeRecs(
38   p_source_obj_def_id   in          number
39   ,p_target_obj_def_id  in          number
40   ,p_created_by         in          number
41   ,p_creation_date      in          date
42 );
43 
44 ----------------------------------------
45 -- PUBLIC BODIES ------
46 ----------------------------------------
47 
48 ---------------------------------------------------------------------
49 -- Deletes all the details records of a Prepayment Table Definition.
50 ---------------------------------------------------------------------
51 
52 PROCEDURE DeleteObjectDefinition(
53   p_obj_def_id          in          number
54 )
55 IS
56 
57   g_api_name    constant varchar2(30)   := 'DeleteObjectDefinition';
58 
59 BEGIN
60   DeletePrepayTableRuleRecs(
61     p_obj_def_id    => p_obj_def_id
62   );
63 
64   DeleteTblDimensionValueRecs(
65     p_obj_def_id    => p_obj_def_id
66   );
67 
68   DeleteTblHypercubeRecs(
69     p_obj_def_id    => p_obj_def_id
70   );
71 EXCEPTION
72 
73   when others then
74     FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, g_api_name);
75     raise FND_API.G_EXC_UNEXPECTED_ERROR;
76 
77 END DeleteObjectDefinition;
78 
79 
80 
81 ----------------------------------------------------------------------------
82 -- Creates all the detail records of a new Prepayment Table Rule Definition (target)
83 -- by copying the detail records of another Prepayment Table Rule Definition (source).
84 --
85 -- IN Parameters
86 -- p_source_obj_def_id    - Source Object Definition ID.
87 -- p_target_obj_def_id    - Target Object Definition ID.
88 -- p_created_by           - FND User ID (optional).
89 -- p_creation_date        - System Date (optional).
90 ----------------------------------------------------------------------------
91 PROCEDURE CopyObjectDefinition(
92   p_source_obj_def_id   in          number
93   ,p_target_obj_def_id  in          number
94   ,p_created_by         in          number
95   ,p_creation_date      in          date
96 )
97 IS
98 
99   g_api_name    constant varchar2(30) := 'CopyObjectDefinition';
100 
101 BEGIN
102 
103   CopyPrepayTableRuleRecs(
104     p_source_obj_def_id   => p_source_obj_def_id
105     ,p_target_obj_def_id  => p_target_obj_def_id
106     ,p_created_by         => p_created_by
107     ,p_creation_date      => p_creation_date
108   );
109 
110   CopyTblDimensionValueRecs(
111     p_source_obj_def_id   => p_source_obj_def_id
112     ,p_target_obj_def_id  => p_target_obj_def_id
113     ,p_created_by         => p_created_by
114     ,p_creation_date      => p_creation_date
115   );
116 
117   CopyTblHypercubeRecs(
118     p_source_obj_def_id   => p_source_obj_def_id
119     ,p_target_obj_def_id  => p_target_obj_def_id
120     ,p_created_by         => p_created_by
121     ,p_creation_date      => p_creation_date
122   );
123 
124 EXCEPTION
125 
126   when others then
127     FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, g_api_name);
128     raise FND_API.G_EXC_UNEXPECTED_ERROR;
129 
130 END CopyObjectDefinition;
131 
132 
133 
134 ----------------------------------------
135 -- PRIVATE BODIES ----------------------
136 ----------------------------------------
137 
138 --
139 -- PROCEDURE
140 --	 DeleteTransferPriceRuleRec
141 --
142 -- DESCRIPTION
143 --   Deletes a Transfer Price Rule Definition by performing deletes on records
144 --   in the FTP_TRANSFER_PRICE_RULE table.
145 --
146 -- IN
147 --   p_obj_def_id    - Object Definition ID.
148 --
149 --------------------------------------------------------------------------------
150 PROCEDURE DeletePrepayTableRuleRecs(
151   p_obj_def_id in number
152 )
153 --------------------------------------------------------------------------------
154 IS
155 BEGIN
156 
157   delete from ftp_prepay_table_rule
158   where object_definition_id = p_obj_def_id;
159 
160 END DeletePrepayTableRuleRecs;
161 
162 
163 --
164 -- PROCEDURE
165 --	 DeleteUnpricedAccountRecs
166 --
167 -- DESCRIPTION
168 --   Deletes Transfer Price Rule Definition records by performing deletes on records
169 --   in the FTP_TP_UNPRICED_ACCT_DTL table.
170 --
171 -- IN
172 --   p_obj_def_id    - Object Definition ID.
173 --
174 --------------------------------------------------------------------------------
175 PROCEDURE DeleteTblDimensionValueRecs(
176   p_obj_def_id in number
177 )
178 --------------------------------------------------------------------------------
179 IS
180 BEGIN
181 
182   delete from ftp_pp_tbl_dim_value
183   where pptb_object_definition_id = p_obj_def_id;
184 
185 END DeleteTblDimensionValueRecs;
186 
187 
188 --
189 -- PROCEDURE
190 --	 DeleteRedemptionCurveRecs
191 --
192 -- DESCRIPTION
193 --   Deletes Transfer Price Rule Definition records by performing deletes on records
194 --   in the FTP_PP_TBL_HYPERCUBE table.
195 --
196 -- IN
197 --   p_obj_def_id    - Object Definition ID.
198 --
199 --------------------------------------------------------------------------------
200 PROCEDURE DeleteTblHypercubeRecs(
201   p_obj_def_id in number
202 )
203 --------------------------------------------------------------------------------
204 IS
205 BEGIN
206 
207   delete from ftp_pp_tbl_hypercube
208   where object_definition_id = p_obj_def_id;
209 
210 END DeleteTblHypercubeRecs;
211 
212 
213 
214 --
215 -- PROCEDURE
216 --	 CopTransferPriceRuleRec
217 --
218 -- DESCRIPTION
219 --   Creates a new Transfer Price Rule Definition by copying records in the
220 --   FTP_PREPAY_TABLE_RULE table.
221 --
222 -- IN
223 --   p_source_obj_def_id    - Source Object Definition ID.
224 --   p_target_obj_def_id    - Target Object Definition ID.
225 --   p_created_by           - FND User ID (optional).
226 --   p_creation_date        - System Date (optional).
227 --
228 --------------------------------------------------------------------------------
229 PROCEDURE CopyPrepayTableRuleRecs(
230   p_source_obj_def_id   in          number
231   ,p_target_obj_def_id  in          number
232   ,p_created_by         in          number
233   ,p_creation_date      in          date
234 )
235 --------------------------------------------------------------------------------
236 IS
237 BEGIN
238 
239   insert into ftp_prepay_table_rule (
240     object_definition_id
241     ,pp_dim_type_code
242     ,dim_display_seq
243     ,num_nodes
244     ,interpolation_flg
245     ,created_by
246     ,creation_date
247     ,last_updated_by
248     ,last_update_date
249     ,last_update_login
250     ,pptb_dimension_id
251   ) select
252     p_target_obj_def_id
253     ,pp_dim_type_code
254     ,dim_display_seq
255     ,num_nodes
256     ,interpolation_flg
257     ,nvl(p_created_by,created_by)
258     ,nvl(p_creation_date,creation_date)
259     ,FND_GLOBAL.user_id
260     ,sysdate
261     ,FND_GLOBAL.login_id
262     ,FTP.FTP_PPTB_DIM_ID_SEQ.NEXTVAL
263   from ftp_prepay_table_rule
264   where object_definition_id = p_source_obj_def_id;
265 
266 END CopyPrepayTableRuleRecs;
267 
268 
269 --
270 -- PROCEDURE
271 --	 CopyTblDimensionValueRecs
272 --
273 -- DESCRIPTION
274 --   Creates a new Transfer Price Rule Definition records by copying records in the
275 --   ftp_pp_tbl_dim_value table.
276 --
277 -- IN
278 --   p_source_obj_def_id    - Source Object Definition ID.
279 --   p_target_obj_def_id    - Target Object Definition ID.
280 --   p_created_by           - FND User ID (optional).
281 --   p_creation_date        - System Date (optional).
282 --
283 --------------------------------------------------------------------------------
284 PROCEDURE CopyTblDimensionValueRecs(
285   p_source_obj_def_id   in          number
286   ,p_target_obj_def_id  in          number
287   ,p_created_by         in          number
288   ,p_creation_date      in          date
289 )
290 --------------------------------------------------------------------------------
291 IS
292 BEGIN
293 
294   insert into ftp_pp_tbl_dim_value (
295     pptb_object_definition_id
296     ,pptb_dim_type_code
297     ,type_display_seq
298     ,type_value
299     ,created_by
300     ,creation_date
301     ,last_updated_by
302     ,last_update_date
303     ,last_update_login
304     ,pptb_dimension_value_id
305   ) select
306     p_target_obj_def_id
307     ,pptb_dim_type_code
308     ,type_display_seq
309     ,type_value
310     ,nvl(p_created_by,created_by)
311     ,nvl(p_creation_date,creation_date)
312     ,FND_GLOBAL.user_id
313     ,sysdate
314     ,FND_GLOBAL.login_id
315     ,FTP.FTP_PPTB_DIM_VALUE_ID_SEQ.NEXTVAL
316   from ftp_pp_tbl_dim_value
317   where pptb_object_definition_id = p_source_obj_def_id;
318 
319 END CopyTblDimensionValueRecs;
320 
321 
322 
323 
324 --
325 -- PROCEDURE
326 --	 CopyTblHypercubeRecs
327 --
328 -- DESCRIPTION
329 --   Creates a new Transfer Price Rule Definition records by copying records in the
330 --   ftp_pp_tbl_hypercube table.
331 --
332 -- IN
333 --   p_source_obj_def_id    - Source Object Definition ID.
334 --   p_target_obj_def_id    - Target Object Definition ID.
335 --   p_created_by           - FND User ID (optional).
336 --   p_creation_date        - System Date (optional).
337 --
338 --------------------------------------------------------------------------------
339 PROCEDURE CopyTblHypercubeRecs(
340   p_source_obj_def_id   in          number
341   ,p_target_obj_def_id  in          number
342   ,p_created_by         in          number
343   ,p_creation_date      in          date
344 )
345 --------------------------------------------------------------------------------
346 IS
347 BEGIN
348 
349   insert into ftp_pp_tbl_hypercube (
350     object_definition_id
351     ,original_term
352     ,reprice_freq
353     ,remain_term
354     ,expired_term
355     ,term_to_repr
356     ,coupon_rate
357     ,market_rate
358     ,rate_difference
359     ,rate_ratio
360     ,prepayment_rate
361     ,created_by
362     ,creation_date
363     ,last_updated_by
364     ,last_update_date
365     ,last_update_login
366     ,pptb_hypercube_id
367   ) select
368     p_target_obj_def_id
369     ,original_term
370     ,reprice_freq
371     ,remain_term
372     ,expired_term
373     ,term_to_repr
374     ,coupon_rate
375     ,market_rate
376     ,rate_difference
377     ,rate_ratio
378     ,prepayment_rate
379     ,nvl(p_created_by,created_by)
380     ,nvl(p_creation_date,creation_date)
381     ,FND_GLOBAL.user_id
382     ,sysdate
383     ,FND_GLOBAL.login_id
384     ,FTP.FTP_PPTB_HYPERCUBE_ID_SEQ.NEXTVAL
385   from ftp_pp_tbl_hypercube
386   where object_definition_id = p_source_obj_def_id;
387 
388 END CopyTblHypercubeRecs;
389 
390 
391 END FTP_BR_PREPAY_TABLE_PVT;