DBA Data[Home] [Help]

PACKAGE: APPS.FA_INS_ADJUST_PKG

Source


1 PACKAGE FA_INS_ADJUST_PKG as
2 /* $Header: FAXIAJ2S.pls 120.3 2005/06/24 16:59:21 snarayan ship $ */
3 
4   adj_ptr	FA_ADJUST_TYPE_PKG.fa_adj_row_struct;
5   dpr_ptr	FA_STD_TYPES.fa_deprn_row_struct;
6   H_DPR_ROW     FA_STD_TYPES.fa_deprn_row_struct;
7   adj_table     FA_ADJUST_TYPE_PKG.fa_adj_ins_table;
8   h_cache_index number:=0;
9   h_mrc_sob_type_code varchar2(1);
10 
11 /*
12  ---------------------------------------------------------------------
13  *
14  * Name		fadoflx
15  *
16  *
17  * Description
18  *		 This function calls the flex API to generate the CCID
19  *		 to insert in FA_ADJUSTMENTS table based on the table
20  *		 settings
21  *
22  * Parameters
23  *		book_type_code   in varchar2
24  *		account_type	 in varchar2
25  *		dist_ccid	 in number
26  *		spec_ccid	 in number
27  *		account		 in number
28  *		calculated_ccid  out number
29  *		gen_ccid_flag	 in number
30  *		asset_id	 in number
31  *		cat_id		 out number
32  *		distribution_id  in number
33  *		source_type_code in varchar2
34  * Modifies
35  *	adj_ptr
36  * Returns
37  *		True on successful retrieval. Otherwise False.
38  *
39  * Notes
40  *
41  * History
42  *  01/27/97    tpershad	Created
43  *--------------------------------------------------------------------
44 */
45 FUNCTION fadoflx (X_book_type_code  in varchar2,
46 		  X_account_type    in varchar2,
47 		  X_dist_ccid	    in number,
48 		  X_spec_ccid	    in number,
49 		  X_account	    in varchar2,
50 	  	  X_calculated_ccid out nocopy number,
51 		  X_gen_ccid_flag   in boolean,
52 		  X_asset_id 	    in number,
53 		  X_cat_id	    in out nocopy number,
54 		  X_distribution_id in number,
55 		  X_source_type_code in varchar2,
56                   p_log_level_rec in fa_api_types.log_level_rec_type default null)
57    return boolean;
58 /*
59  ---------------------------------------------------------------------
60  *
61  * Name		factotp
62  *
63  *
64  * Description
65  *
66  *  This function calculates the total amount to prorate over all the
67  *  distributions based on the adjustment type.
68  *
69  * Parameters
70  *   total_amount out number;
71  *   adj_ptr and dpr_ptr are already available to this function
72  *   as they are defined as globals for the package
73  * Modifies
74  *	total_amount
75  * Returns
76  *		True on successful retrieval. Otherwise False.
77  *
78  * Notes
79  *  Since we don't store COST in FA_DEPRN_SUMMARY, the cost returned
80  *  from fauqadd() is 0 +/- any adjustments to COST; for the purposes
81  *  of inserting into FA_ADJUSTMENTS, we need to add it the FA_BOOKS.COST
82  *  to the total_amount to prorate.
83 
84  * History
85  *  01/29/97    tpershad	Created
86  *--------------------------------------------------------------------
87 */
88  FUNCTION factotp (total_amount  out nocopy number,
89 		adjustment_amount in number,
90                 p_log_level_rec in fa_api_types.log_level_rec_type default null)
91  return boolean;
92 /*
93  ---------------------------------------------------------------------
94  *
95  * Name		facdamt
96  *
97  *
98  * Description
99  *		 This function calculates the detail amount to substract
100  *		 from a single distribution based on the adjustment type
101  *		 The two structures adj_ptr and dpr_ptr are already
102  *		 available to this function as they are global to this
103  *		 package and hence is not passed as parameters
104  *
105  * Parameters
106  *		adj_dd_amount  out number
107  *
108  * Modifies
109  *	adj_dd_amount
110  * Returns
111  *		True on successful retrieval. Otherwise False.
112  *
113  * Notes
114  *
115  * History
116  *  01/27/97    tpershad	Created
117  *--------------------------------------------------------------------
118 */
119 FUNCTION facdamt (adj_dd_amount   out nocopy number,
120                   p_log_level_rec in fa_api_types.log_level_rec_type default null)
121 return boolean;
122 /*
123  ---------------------------------------------------------------------
124  *
125  * Name		fagetcc
126  *
127  *
128  * Description
129  *		 This function gets the current cost for the asset
130  *		 The  structures adj_ptr is already available to
131  *		 this function it is defined as global to this
132  *		 package and hence is not passed as parameter
133  *
134  * Parameters
135  *		cost  out number
136  *
137  * Modifies
138  *	cost
139  * Returns
140  *		True on successful retrieval. Otherwise False.
141  *
142  * Notes
143  *
144  * History
145  *  01/29/97    tpershad	Created
146  *--------------------------------------------------------------------
147 */
148 FUNCTION fagetcc(X_cost out nocopy number,
149                  p_log_level_rec in fa_api_types.log_level_rec_type default null)
150 return boolean;
151 /*
152  ---------------------------------------------------------------------
153  *
154  * Name		fainajc
155  *
156  *
157  * Description
158  *		 The function inserts one row into FA_ADJUSTMENTS tablei
159  *		 with  the values passed in, OR it flushes out the cache
160  *	         to the database.
161  *		 The adj_ptr and dpr_ptr are defined as global and hence
162  *	         are not passed as parameters.
163  * Parameters
164  *		 X_flush_mode  in boolean
165  *	         X_mode	      in boolean
166  * Modifies
167 *	        none. Inserts rows into FA_ADJUSTMENTS table
168  * Returns
169  *		True on successful retrieval. Otherwise False.
170  *
171  * Notes
172  *
173  * History
174  *  01/30/97    tpershad	Created
175  *--------------------------------------------------------------------
176 */
177 FUNCTION fainajc(X_flush_mode boolean,
178 	         X_mode       boolean,
179 		 X_last_update_date date default sysdate,
180 		 X_last_updated_by  number default -1,
181 		 X_last_update_login number default -1,
182                  p_log_level_rec in fa_api_types.log_level_rec_type default null)
183 return boolean;
184 /*
185  ---------------------------------------------------------------------
186  *
187  * Name		fadoact
188  *
189  *
190  * Description
191  *   This function does all the processing of ACTIVE mode
192  *
193  * Parameters
194  *
195  * Modifies
196  *	        none.
197  * Returns
198  *		True on success. Otherwise False.
199  *
200  * Notes
201  *
202  * History
203  *  01/30/97    tpershad	Created
204  *--------------------------------------------------------------------
205 */
206 FUNCTION fadoact(X_last_update_date date default sysdate,
207 		 X_last_updated_by  number default -1,
208 		 X_last_update_login number default -1,
209                  p_log_level_rec in fa_api_types.log_level_rec_type default null)
210 return boolean;
211 /*
212  ---------------------------------------------------------------------
213  *
214  * Name		fadoclr
215  *
216  *
217  * Description
218  *	 The adj_ptr is defined as global for this package and hence
219  *       not passed as parameters.
220  * Parameters
221  *	         None
222  * Modifies
223  *	        None.It calls the function fainajc to insert rows into
224  *		FA_ADJUSTMENTS table
225  * Returns
226  *		True on successful retrieval. Otherwise False.
227  *
228  * Notes
229  *
230  * History
231  *  02/05/97    tpershad	Created
232  *--------------------------------------------------------------------
233 */
234 FUNCTION fadoclr(X_last_update_date date default sysdate,
235 		 X_last_updated_by  number default -1,
236 		 X_last_update_login number default -1,
237                  p_log_level_rec in fa_api_types.log_level_rec_type default null)
238 return boolean;
239 /*
240  ---------------------------------------------------------------------
241  *
242  * Name		fadosglf
243  *
244  *
245  * Description
246  *	FA DO Single mode, with cache flush
247  *	 This function does all processing of SINGLE mode.
248  *	 Flushes cache as well.. used for transfers/reclass only.
249  * Parameters
250  *	         adj_ptr. (Since this is global to the package we need
251  *		 not pass it as a parameter.
252  * Modifies
253  *
254  * Returns
255  *		True on successful retrieval. Otherwise False.
256  *
257  * Notes
258  *
259  * History
260  *  02/25/97    tpershad	Created
261  *--------------------------------------------------------------------
262 */
263 FUNCTION fadosglf(X_last_update_date date default sysdate,
264 		 X_last_updated_by  number default -1,
265 		 X_last_update_login number default -1,
266                  p_log_level_rec in fa_api_types.log_level_rec_type default null)
267 return boolean;
268 /*
269  ---------------------------------------------------------------------
270  *
271  * Name		fadosgl
272  *
273  *
274  * Description
275  *	FA DO Single mode
276  *	 This function does all processing of SINGLE mode.
277  *
278  * Parameters
279  *	         adj_ptr. (Since this is global to the package we need
280  *		 not pass it as a parameter.
281  * Modifies
282  *
283  * Returns
284  *		True on success. Otherwise False.
285  *
286  * Notes
287  *
288  * History
289  *  02/25/97    tpershad	Created
290  *--------------------------------------------------------------------
291 */
292 FUNCTION fadosgl(X_last_update_date date default sysdate,
293 		 X_last_updated_by  number default -1,
294 		 X_last_update_login number default -1,
295                  p_log_level_rec in fa_api_types.log_level_rec_type default null)
296 return boolean;
297 
298 /*
299  ---------------------------------------------------------------------
300  *
301  * Name		fadoret
302  *
303  *
304  * Description
305  *	FA DO Retirement mode
306  *	 This function does all processing of RETIRE mode.
307  *
308  * Parameters
309  *	         adj_ptr. (Since this is global to the package we need
310  *		 not pass it as a parameter.
311  * Modifies
312  *
313  * Returns
314  *		True on success. Otherwise False.
315  *
316  * Notes
317  *
318  * History
319  *  02/25/97    tpershad	Created
320  *--------------------------------------------------------------------
321 */
322 FUNCTION fadoret(X_last_update_date date default sysdate,
323 		 X_last_updated_by  number default -1,
324 		 X_last_update_login number default -1,
325                  p_log_level_rec in fa_api_types.log_level_rec_type default null)
326 return boolean;
327 
328 /*
329  ---------------------------------------------------------------------
330  *
331  * Name		faxinaj
332  *
333  *
334  * Description
335  *	 This is the driver function for Insert into FA_ADJUSTMENTS
336  *	 engine.
337  *
338  * Parameters
339  *	         adj_ptr. (Since this is global to the package we need
340  *		 not pass it as a parameter.
341  * Modifies
342  *
343  * Returns
344  *		True on success. Otherwise False.
345  *
346  * Notes
347  *
348  * History
349  *  02/25/97    tpershad	Created
350  *--------------------------------------------------------------------
351 */
352 FUNCTION faxinaj(adj_ptr_passed  in out nocopy FA_ADJUST_TYPE_PKG.fa_adj_row_struct,
353 		 X_last_update_date date default sysdate,
354 		 X_last_updated_by  number default -1,
355 		 X_last_update_login number default -1,
356                  p_log_level_rec in fa_api_types.log_level_rec_type default null)
357 return boolean;
358 
359 /*
360  ---------------------------------------------------------------------
361  *
362  * Name		faxinadj
363  *
364  *
365  * Description
366  *  This function is the FORMS specific code that gets the parameters
367  *  passed in by the form, and makes the call to the Insert Into
368  *  FA_ADJUSTMENTS Function.This is not called from any of the
369  *  user exits or concurrent programs
370  *
371  *    This function handles inserts into the FA_ADJUSTMENTS table in
372  *    four modes:
373  *	1. ACTIVE mode
374  *		When run in ACTIVE mode, the function prorates an adjustment
375  *		amount over all of the asset's distribution lines. The
376  *		adjustment amount can be an adjustment to cost,
377  *		revaluation reserve, or depreciation reserve.
378  *
379  *	2. SINGLE mode
380  *		When run in SINGLE mode, the function inserts
381  *		the adjustment amount for a single distribution line.
382  *      3. CLEAR mode
383  *              When run in CLEAR mode, the function inserts the adjustments
384  *              rows necessary to reverse out the current Query Fin Info
385  *              value for each distribution which is active or terminated
386  *              by the selection_thid, but not created by the transaction.
387  *
388  *      4. RETIRE mode
389  *              This user exit shouldn't be called using this mode; it's
390  *              for the retirements program. The hooks are here for future
391  *              use though.
392  * * Parameters
393  *	         adj_ptr. (Since this is global to the package we need
394  *		 not pass it as a parameter.
395  * Modifies
396  *
397  * Returns
398  *		True on success. Otherwise False.
399  *
400  * Notes
401  *
402  * History
403  *  02/27/97    tpershad	Created
404  *--------------------------------------------------------------------
405 */
406 FUNCTION faxinadj (X_transaction_header_id   in number,
407 		   X_source_type_code        in varchar2,
408 		   X_adjustment_type         in varchar2,
409 		   X_debit_credit_flag 	     in varchar2,
410 		   X_code_combination_id     in number,
411 		   X_book_type_code 	     in varchar2,
412 		   X_period_counter_created  in number,
413 		   X_asset_id		     in number,
414 		   X_adjustment_amount	     in number,
415 		   X_period_counter_adjusted in number,
416 		   X_distribution_id	     in number,
417 		   X_annualized_adjustment   in number,
418 		   X_last_update_date	     in date  default sysdate,
419 		   X_account		     in varchar2,
420 		   X_account_type	     in varchar2,
421 		   X_current_units	     in number,
422 		   X_selection_mode	     in varchar2,
423 		   X_flush_adj_flag	     in varchar2,
424 		   X_gen_ccid_flag	     in varchar2,
425 		   X_leveling_flag	     in varchar2,
426 		   X_asset_invoice_id	     in number,
427 		   X_amount_inserted	     out nocopy number,
428 		   X_last_updated_by  	         number default -1,
429 		   X_last_update_login           number default -1,
430 		   X_init_message_flag           varchar2 default 'NO',
431                    p_log_level_rec in fa_api_types.log_level_rec_type default null)
432 return boolean;
433 END FA_INS_ADJUST_PKG;