[Home] [Help]
PACKAGE: APPS.FA_MASS_REC_UTILS_PKG
Source
1 PACKAGE FA_MASS_REC_UTILS_PKG AUTHID CURRENT_USER AS
2 /* $Header: FAXMRUTS.pls 120.3 2009/03/27 04:14:21 bridgway ship $ */
3
4 -- Mass reclass record from fa_mass_reclass table.
5 TYPE mass_reclass_rec IS RECORD (
6 mass_reclass_id NUMBER(15),
7 book_type_code VARCHAR2(15), -- corporate book selected by user
8 trans_date_entered DATE,
9 conc_request_id NUMBER(15),
10 status VARCHAR2(10),
11 asset_type VARCHAR2(11),
12 location_id NUMBER(15),
13 employee_id NUMBER(15),
14 asset_key_id NUMBER(15),
15 from_cost NUMBER,
16 to_cost NUMBER,
17 from_asset_number VARCHAR2(15),
18 to_asset_number VARCHAR2(15),
19 from_dpis DATE,
20 to_dpis DATE,
21 from_category_id NUMBER(15),
22 to_category_id NUMBER(15),
23 segment1_low VARCHAR2(25),
24 segment2_low VARCHAR2(25),
25 segment3_low VARCHAR2(25),
26 segment4_low VARCHAR2(25),
27 segment5_low VARCHAR2(25),
28 segment6_low VARCHAR2(25),
29 segment7_low VARCHAR2(25),
30 segment8_low VARCHAR2(25),
31 segment9_low VARCHAR2(25),
32 segment10_low VARCHAR2(25),
33 segment11_low VARCHAR2(25),
34 segment12_low VARCHAR2(25),
35 segment13_low VARCHAR2(25),
36 segment14_low VARCHAR2(25),
37 segment15_low VARCHAR2(25),
38 segment16_low VARCHAR2(25),
39 segment17_low VARCHAR2(25),
40 segment18_low VARCHAR2(25),
41 segment19_low VARCHAR2(25),
42 segment20_low VARCHAR2(25),
43 segment21_low VARCHAR2(25),
44 segment22_low VARCHAR2(25),
45 segment23_low VARCHAR2(25),
46 segment24_low VARCHAR2(25),
47 segment25_low VARCHAR2(25),
48 segment26_low VARCHAR2(25),
49 segment27_low VARCHAR2(25),
50 segment28_low VARCHAR2(25),
51 segment29_low VARCHAR2(25),
52 segment30_low VARCHAR2(25),
53 segment1_high VARCHAR2(25),
54 segment2_high VARCHAR2(25),
55 segment3_high VARCHAR2(25),
56 segment4_high VARCHAR2(25),
57 segment5_high VARCHAR2(25),
58 segment6_high VARCHAR2(25),
59 segment7_high VARCHAR2(25),
60 segment8_high VARCHAR2(25),
61 segment9_high VARCHAR2(25),
62 segment10_high VARCHAR2(25),
63 segment11_high VARCHAR2(25),
64 segment12_high VARCHAR2(25),
65 segment13_high VARCHAR2(25),
66 segment14_high VARCHAR2(25),
67 segment15_high VARCHAR2(25),
68 segment16_high VARCHAR2(25),
69 segment17_high VARCHAR2(25),
70 segment18_high VARCHAR2(25),
71 segment19_high VARCHAR2(25),
72 segment20_high VARCHAR2(25),
73 segment21_high VARCHAR2(25),
74 segment22_high VARCHAR2(25),
75 segment23_high VARCHAR2(25),
76 segment24_high VARCHAR2(25),
77 segment25_high VARCHAR2(25),
78 segment26_high VARCHAR2(25),
79 segment27_high VARCHAR2(25),
80 segment28_high VARCHAR2(25),
81 segment29_high VARCHAR2(25),
82 segment30_high VARCHAR2(25),
83 fully_rsvd_flag VARCHAR2(3),
84 copy_cat_desc_flag VARCHAR2(3),
85 redefault_flag VARCHAR2(3),
86 amortize_flag VARCHAR2(3),
87 created_by NUMBER(15),
88 creation_date DATE,
89 last_updated_by NUMBER(15),
90 last_update_login NUMBER(15),
91 last_update_date DATE
92 );
93
94 -- Asset record for the asset to be reclassified.
95 TYPE asset_rec IS RECORD (
96 asset_id NUMBER(15),
97 asset_number VARCHAR2(15),
98 description VARCHAR2(80),
99 book_type_code VARCHAR2(15), -- corporate/tax book for asset
100 -- The following fields may be used to load either the old or new
101 -- depreciation rules for the asset.
102 category_id NUMBER(15), -- current category in database
103 category VARCHAR2(210), -- in concatenated string
104 convention VARCHAR2(10), -- prorate convention
105 ceiling VARCHAR2(30),
106 method VARCHAR2(12),
107 life_in_months NUMBER(4),
108 life VARCHAR2(6), -- New life year.mo
109 basic_rate NUMBER,
110 basic_rate_pct NUMBER, -- in percentage(rounded)
111 adjusted_rate NUMBER,
112 adjusted_rate_pct NUMBER, -- in percentage(rounded)
113 bonus_rule VARCHAR2(30),
114 capacity NUMBER,
115 unit_of_measure VARCHAR2(25),
116 depreciate_flag VARCHAR2(3),
117 allowed_deprn_limit NUMBER,
118 deprn_limit_pct NUMBER, -- in percentage(rounded)
119 deprn_limit_amt NUMBER,
120 percent_salvage_val NUMBER,
121 salvage_val_pct NUMBER, -- in percentage(rounded)
122 cost_acct_ccid NUMBER(15) := NULL,
123 cost_acct VARCHAR2(780) := NULL, -- in concatenated string
124 deprn_rsv_acct_ccid NUMBER(15) := NULL,
125 deprn_rsv_acct VARCHAR2(780) := NULL -- in concatenated string
126 );
127
128 -- Table of asset records.
129 TYPE asset_table IS TABLE OF asset_rec
130 INDEX BY BINARY_INTEGER;
131
132 -- Conversion table: A table that caches certain depreciation rules data in
133 -- converted formats for the records in the table,
134 -- FA_LOAD_TBL_PKG.asset_deprn_info_tbl.
135 TYPE conversion_rec IS RECORD (
136 book_type_code VARCHAR2(15) := NULL,
137 start_dpis DATE := NULL,
138 end_dpis DATE := NULL,
139 life VARCHAR2(6), -- New life year.mo
140 basic_rate_pct NUMBER, -- in percentage
141 adjusted_rate_pct NUMBER, -- in percentage
142 deprn_limit_pct NUMBER, -- in percentage
143 salvage_val_pct NUMBER -- in percentage
144 );
145
146 TYPE conversion_table IS TABLE OF conversion_rec
147 INDEX BY BINARY_INTEGER;
148
149 -- Global conversion table.
150 conv_tbl conversion_table;
151
152
153 /*=====================================================================================+
154 |
155 | Name: Convert_Formats
156 |
157 | Description: Procedure to convert life, basic_rate, adjusted_rate,
158 | deprn_limit_pct, salvage_val_pct in proper formats.
159 | If the IN parameter value is NULL, the corresponding OUT NOCOPY parameter
160 | value is NULL
161 |
162 | Parameters: X_Life_In_Months -- Life in months.
163 | X_Basic_Rate -- Basic rate(max value: 1)
164 | X_Adjusted_Rate -- Adjusted rate(max value: 1)
165 | X_Allowed_Deprn_Limit -- Allowed depreciation limit(max value: 1)
166 | X_Percent_Salvage_Val -- Percent salvage value(max value: 1)
167 | X_Life -- OUT parameter(in year.mo format)
168 | X_Basic_Rate_Pct -- OUT parameter(max value: 100.00)
169 | X_Adjusted_Rate_Pct -- OUT parameter(max value: 100.00)
170 | X_Deprn_Limit_Pct -- OUT parameter(max value: 100.00)
171 | X_Salvage_Val_Pct -- OUT parameter(max value: 100.00)
172 |
173 | Returns:
174 |
175 | Notes:
176 |
177 +======================================================================================*/
178
179 PROCEDURE Convert_Formats(
180 X_Life_In_Months IN NUMBER := NULL,
181 X_Basic_Rate IN NUMBER := NULL,
182 X_Adjusted_Rate IN NUMBER := NULL,
183 X_Allowed_Deprn_Limit IN NUMBER := NULL,
184 X_Percent_Salvage_Val IN NUMBER := NULL,
185 X_Life OUT NOCOPY VARCHAR2,
186 X_Basic_Rate_Pct OUT NOCOPY NUMBER,
187 X_Adjusted_Rate_Pct OUT NOCOPY NUMBER,
188 X_Deprn_Limit_Pct OUT NOCOPY NUMBER,
189 X_Salvage_Val_Pct OUT NOCOPY NUMBER
190 , p_log_level_rec IN FA_API_TYPES.log_level_rec_type);
191
192
193 /*=====================================================================================+
194 |
195 | Name: Load_Conversion_Table
196 |
197 | Description: Procedure to load(cache) the global conversion table. This
198 | procedure first deletes all the existing records in the table
199 | before loading new data. It then inserts a record with converted
200 | formats for each record in FA_LOAD_TBL_PKG.deprn_table. The index
201 | position of the corresponding record in conv_tbl matches that of
202 | deprn_table record.
203 |
204 | Parameters:
205 |
206 | Returns:
207 |
208 | Notes: 1. FA_LOAD_TBL_PKG.deprn_table must be properly loaded first.
209 | 2. This procedure implicitly re-initializes conv_tbl before
210 | loading new records.
211 |
212 +======================================================================================*/
213
214 PROCEDURE Load_Conversion_Table(p_log_level_rec IN
215 FA_API_TYPES.log_level_rec_type);
216
217
218 /*=====================================================================================+
219 |
220 | Name: Insert_Itf
221 |
222 | Description: Proecedure to insert an asset record into the interface table,
223 | fa_mass_reclass_itf, for report exchange.
224 |
225 | Parameters: X_Report_Type -- PREVIEW or REVIEW
226 | X_Request_Id -- Concurrent request id.
227 | X_Mass_Reclass_Id -- Mass reclass id.
228 | X_Asset_Rec -- Asset record with all the information.
229 | X_New_Category -- New category in a concatenated string.
230 | This parameter is used only for preview report.
231 | X_Last_Update_Date .. X_Last_Update_Login
232 | -- Standard who columns
233 |
234 | Returns:
235 |
236 | Notes: For preview report, X_Asset_Rec should store the old(current)
237 | category information in category fields.
238 |
239 +=====================================================================================*/
240
241 PROCEDURE Insert_Itf(
242 X_Report_Type IN VARCHAR2,
243 X_Request_Id IN NUMBER,
244 X_Mass_Reclass_Id IN NUMBER,
245 X_Asset_Rec IN ASSET_REC,
246 X_New_Category IN VARCHAR2 := NULL,
247 X_Last_Update_Date IN DATE,
248 X_Last_Updated_By IN NUMBER,
249 X_Created_By IN NUMBER,
250 X_Creation_Date IN DATE,
251 X_Last_Update_Login IN NUMBER
252 , p_log_level_rec IN FA_API_TYPES.log_level_rec_type);
253
254
255 /*=====================================================================================+
256 |
257 | Name: Get_Selection_Criteria
258 |
259 | Description: Proecedure to retrieve mass reclass asset selection criteria
260 | based on a mass reclass id.
261 |
262 | Parameters: X_Mass_Reclass_ID -- Mass reclass id.
263 | X_Book_Type_Code -- Book.
264 | X_Asset_Type -- Asset type.
265 | X_Fully_Rsvd -- YES or NO.
266 | X_From_Cost -- From cost rounded to precision.
267 | X_To_Cost -- To cost rounded to precision.
268 | X_From_Asset -- From asset number.
269 | X_To_Asset -- To asset number.
270 | X_From_Dpis -- From date placed in service.
271 | X_To_Dpis -- To date placed in service.
272 | X_Location -- Location in concatenated string format.
273 | X_Employee_Name -- Employee name.
274 | X_Employee_Number -- Employee number.
275 | X_Old_Category -- Old category in concatenated string format.
276 | X_New_Category -- New category in concatenated string format.
277 | X_Asset_Key -- Asset key in concatenated string format.
278 | X_From_Exp_Acct -- From expense account in concatenated
279 | string format.
280 | X_To_Exp_Acct -- To expense accoutn in concatenated string
281 | format.
282 |
283 | Returns:
284 |
285 | Notes: This function is used by Preview and Review reports(report 2.5.)
286 |
287 +=====================================================================================*/
288
289 PROCEDURE Get_Selection_Criteria(
290 X_Mass_Reclass_ID IN NUMBER,
291 X_Book_Type_Code OUT NOCOPY VARCHAR2,
292 X_Asset_Type OUT NOCOPY VARCHAR2,
293 X_Fully_Rsvd OUT NOCOPY VARCHAR2,
294 X_From_Cost OUT NOCOPY NUMBER,
295 X_To_Cost OUT NOCOPY NUMBER,
296 X_From_Asset OUT NOCOPY VARCHAR2,
297 X_To_Asset OUT NOCOPY VARCHAR2,
298 X_From_Dpis OUT NOCOPY DATE,
299 X_To_Dpis OUT NOCOPY DATE,
300 X_Location OUT NOCOPY VARCHAR2,
301 X_Employee_Name OUT NOCOPY VARCHAR2,
305 X_Asset_Key OUT NOCOPY VARCHAR2,
302 X_Employee_Number OUT NOCOPY VARCHAR2,
303 X_Old_Category OUT NOCOPY VARCHAR2,
304 X_New_Category OUT NOCOPY VARCHAR2,
306 X_From_Exp_Acct OUT NOCOPY VARCHAR2,
307 X_To_Exp_Acct OUT NOCOPY VARCHAR2
308 , p_log_level_rec IN FA_API_TYPES.log_level_rec_type);
309
310
311 /*=====================================================================================+
312 |
313 | Name: Compare_Cat_Major_Segs
314 |
315 | Description: Proecedure to compare major segment values of two categories.
316 |
317 | Parameters: X_Category_Id1 -- First category id for comparison
318 | X_Category_Id2 -- Second category id for comparison
319 | X_Same_Values -- YES, if balancing segment values are the same.
320 | NO, if they are different.
321 | X_Return_Status -- TRUE or FALSE. Completion success or error.
322 |
323 | Returns:
324 |
325 | Notes: Used in Mass Reclass form.
326 |
327 +=====================================================================================*/
328
329 PROCEDURE Compare_Cat_Major_Segs(
330 X_Category_Id1 IN NUMBER,
331 X_Category_Id2 IN NUMBER,
332 X_Same_Values OUT NOCOPY VARCHAR2,
333 X_Return_Status OUT NOCOPY BOOLEAN, p_log_level_rec IN FA_API_TYPES.log_level_rec_type);
334
335
336 END FA_MASS_REC_UTILS_PKG;