DBA Data[Home] [Help]

PACKAGE: APPS.FA_MASS_REC_UTILS_PKG

Source


1 PACKAGE FA_MASS_REC_UTILS_PKG AS
2 /* $Header: FAXMRUTS.pls 120.2 2005/06/24 02:13:15 lson 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 default null
191 	);
192 
193 
194 /*=====================================================================================+
195 |
196 |   Name:          Load_Conversion_Table
197 |
198 |   Description:   Procedure to load(cache) the global conversion table.  This
199 |		   procedure first deletes all the existing records in the table
200 |		   before loading new data.  It then inserts a record with converted
201 |		   formats for each record in FA_LOAD_TBL_PKG.deprn_table.  The index
202 |		   position of the corresponding record in conv_tbl matches that of
203 |		   deprn_table record.
204 |
205 |   Parameters:
206 |
207 |   Returns:
208 |
209 |   Notes:	   1. FA_LOAD_TBL_PKG.deprn_table must be properly loaded first.
210 |		   2. This procedure implicitly re-initializes conv_tbl before
211 |		      loading new records.
212 |
213 +======================================================================================*/
214 
215 PROCEDURE Load_Conversion_Table(p_log_level_rec IN  FA_API_TYPES.log_level_rec_type default null);
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 default null
253 	);
254 
255 
256 /*=====================================================================================+
257 |
258 |   Name:          Get_Selection_Criteria
259 |
260 |   Description:   Proecedure to retrieve mass reclass asset selection criteria
261 |		   based on a mass reclass id.
262 |
263 |   Parameters:    X_Mass_Reclass_ID -- Mass reclass id.
264 |		   X_Book_Type_Code -- Book.
265 |		   X_Asset_Type -- Asset type.
266 |		   X_Fully_Rsvd -- YES or NO.
267 |		   X_From_Cost -- From cost rounded to precision.
268 |		   X_To_Cost -- To cost rounded to precision.
269 |		   X_From_Asset -- From asset number.
270 |		   X_To_Asset -- To asset number.
271 |		   X_From_Dpis -- From date placed in service.
272 |		   X_To_Dpis -- To date placed in service.
273 |		   X_Location -- Location in concatenated string format.
274 |		   X_Employee_Name -- Employee name.
275 |		   X_Employee_Number -- Employee number.
276 |		   X_Old_Category -- Old category in concatenated string format.
277 |		   X_New_Category -- New category in concatenated string format.
278 |		   X_Asset_Key -- Asset key in concatenated string format.
279 |		   X_From_Exp_Acct -- From expense account in concatenated
280 |			string format.
281 |		   X_To_Exp_Acct -- To expense accoutn in concatenated string
282 |			format.
283 |
284 |   Returns:
285 |
286 |   Notes:	   This function is used by Preview and Review reports(report 2.5.)
287 |
288 +=====================================================================================*/
289 
290 PROCEDURE Get_Selection_Criteria(
291 	X_Mass_Reclass_ID	IN	NUMBER,
292 	X_Book_Type_Code OUT NOCOPY VARCHAR2,
293 	X_Asset_Type	 OUT NOCOPY VARCHAR2,
294 	X_Fully_Rsvd	 OUT NOCOPY VARCHAR2,
295 	X_From_Cost	 OUT NOCOPY NUMBER,
296 	X_To_Cost	 OUT NOCOPY NUMBER,
297 	X_From_Asset	 OUT NOCOPY VARCHAR2,
298 	X_To_Asset	 OUT NOCOPY VARCHAR2,
299 	X_From_Dpis	 OUT NOCOPY DATE,
300 	X_To_Dpis	 OUT NOCOPY DATE,
301 	X_Location	 OUT NOCOPY VARCHAR2,
302 	X_Employee_Name	 OUT NOCOPY VARCHAR2,
303 	X_Employee_Number OUT NOCOPY VARCHAR2,
304 	X_Old_Category	 OUT NOCOPY VARCHAR2,
305 	X_New_Category	 OUT NOCOPY VARCHAR2,
306 	X_Asset_Key	 OUT NOCOPY VARCHAR2,
307 	X_From_Exp_Acct	 OUT NOCOPY VARCHAR2,
308 	X_To_Exp_Acct	 OUT NOCOPY VARCHAR2,
309 	p_log_level_rec      IN     FA_API_TYPES.log_level_rec_type default null
310 	);
311 
312 
313 /*=====================================================================================+
314 |
315 |   Name:          Compare_Cat_Major_Segs
316 |
317 |   Description:   Proecedure to compare major segment values of two categories.
318 |
319 |   Parameters:    X_Category_Id1 -- First category id for comparison
320 |		   X_Category_Id2 -- Second category id for comparison
321 |		   X_Same_Values -- YES, if balancing segment values are the same.
322 |				    NO, if they are different.
323 |		   X_Return_Status -- TRUE or FALSE.  Completion success or error.
324 |
325 |   Returns:
326 |
327 |   Notes: 	   Used in Mass Reclass form.
328 |
329 +=====================================================================================*/
330 
331 PROCEDURE Compare_Cat_Major_Segs(
332 	X_Category_Id1		IN	NUMBER,
333 	X_Category_Id2		IN	NUMBER,
334 	X_Same_Values	 OUT NOCOPY VARCHAR2,
335 	X_Return_Status	 OUT NOCOPY BOOLEAN,
336 	p_log_level_rec         IN     FA_API_TYPES.log_level_rec_type default null);
337 
338 
339 END FA_MASS_REC_UTILS_PKG;