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