[Home] [Help]
PACKAGE BODY: APPS.FA_METHODS_PKG
Source
1 PACKAGE BODY FA_METHODS_PKG as
2 /* $Header: faximtb.pls 120.13 2011/03/11 02:40:24 saalampa ship $ */
3
4 PROCEDURE Insert_Row(X_Rowid IN OUT NOCOPY VARCHAR2,
5 X_Method_Id IN OUT NOCOPY NUMBER,
6 X_Method_Code VARCHAR2,
7 X_Life_In_Months NUMBER DEFAULT NULL,
8 X_Depreciate_Lastyear_Flag VARCHAR2,
9 X_Stl_Method_Flag VARCHAR2,
10 X_Rate_Source_Rule VARCHAR2,
11 X_Deprn_Basis_Rule VARCHAR2,
12 X_Prorate_Periods_Per_Year NUMBER DEFAULT NULL,
13 X_Name VARCHAR2 DEFAULT NULL,
14 X_Last_Update_Date DATE,
15 X_Last_Updated_By NUMBER,
16 X_Created_By NUMBER DEFAULT NULL,
17 X_Creation_Date DATE DEFAULT NULL,
18 X_Last_Update_Login NUMBER DEFAULT NULL,
19 X_Attribute1 VARCHAR2 DEFAULT NULL,
20 X_Attribute2 VARCHAR2 DEFAULT NULL,
21 X_Attribute3 VARCHAR2 DEFAULT NULL,
22 X_Attribute4 VARCHAR2 DEFAULT NULL,
23 X_Attribute5 VARCHAR2 DEFAULT NULL,
24 X_Attribute6 VARCHAR2 DEFAULT NULL,
25 X_Attribute7 VARCHAR2 DEFAULT NULL,
26 X_Attribute8 VARCHAR2 DEFAULT NULL,
27 X_Attribute9 VARCHAR2 DEFAULT NULL,
28 X_Attribute10 VARCHAR2 DEFAULT NULL,
29 X_Attribute11 VARCHAR2 DEFAULT NULL,
30 X_Attribute12 VARCHAR2 DEFAULT NULL,
31 X_Attribute13 VARCHAR2 DEFAULT NULL,
32 X_Attribute14 VARCHAR2 DEFAULT NULL,
33 X_Attribute15 VARCHAR2 DEFAULT NULL,
34 X_Attribute_Category_Code VARCHAR2 DEFAULT NULL,
35 X_Exclude_Salvage_Value_Flag VARCHAR2 DEFAULT 'NO',
36 -- alternative flat depreciation calculation. added for 11.5.2
37 X_Deprn_Basis_Formula VARCHAR2 DEFAULT NULL,
38 X_Polish_Adj_Calc_Basis_Flag VARCHAR2 DEFAULT NULL,
39 X_Guarantee_Rate_Method_Flag VARCHAR2 DEFAULT NULL,
40 X_Calling_Fn VARCHAR2,
41 -- For Depreciable Basis Formula
42 X_Deprn_Basis_Rule_Id NUMBER DEFAULT NULL,
43 x_jp_imp_calc_basis_flag VARCHAR2 DEFAULT NULL
44 , p_log_level_rec IN FA_API_TYPES.log_level_rec_type) IS
45 CURSOR C IS SELECT rowid FROM fa_methods
46 WHERE method_id = X_Method_Id;
47 CURSOR C2 IS SELECT fa_methods_s.nextval FROM sys.dual;
48
49 BEGIN
50
51 if (X_Method_Id is NULL) then
52 OPEN C2;
53 FETCH C2 INTO X_Method_Id;
54 CLOSE C2;
55 end if;
56 ad_zd_seed.prepare('fa_methods');
57 INSERT INTO fa_methods(
58 method_id,
59 method_code,
60 life_in_months,
61 depreciate_lastyear_flag,
62 stl_method_flag,
63 rate_source_rule,
64 deprn_basis_rule,
65 prorate_periods_per_year,
66 name,
67 last_update_date,
68 last_updated_by,
69 created_by,
70 creation_date,
71 last_update_login,
72 attribute1,
73 attribute2,
74 attribute3,
75 attribute4,
76 attribute5,
77 attribute6,
78 attribute7,
79 attribute8,
80 attribute9,
81 attribute10,
82 attribute11,
83 attribute12,
84 attribute13,
85 attribute14,
86 attribute15,
87 attribute_category_code,
88 exclude_salvage_value_flag,
89 deprn_basis_formula,
90 deprn_basis_rule_id,
91 polish_adj_calc_basis_flag,
92 guarantee_rate_method_flag,
93 jp_imp_calc_basis_flag
94 ) VALUES (
95 X_Method_Id,
96 X_Method_Code,
97 X_Life_In_Months,
98 X_Depreciate_Lastyear_Flag,
99 X_Stl_Method_Flag,
100 X_Rate_Source_Rule,
101 X_Deprn_Basis_Rule,
102 X_Prorate_Periods_Per_Year,
103 X_Name,
104 X_Last_Update_Date,
105 X_Last_Updated_By,
106 X_Created_By,
107 X_Creation_Date,
108 X_Last_Update_Login,
109 X_Attribute1,
110 X_Attribute2,
111 X_Attribute3,
112 X_Attribute4,
113 X_Attribute5,
114 X_Attribute6,
115 X_Attribute7,
116 X_Attribute8,
117 X_Attribute9,
118 X_Attribute10,
119 X_Attribute11,
120 X_Attribute12,
121 X_Attribute13,
122 X_Attribute14,
123 X_Attribute15,
124 X_Attribute_Category_Code,
125 X_Exclude_Salvage_Value_Flag,
126 X_Deprn_Basis_Formula,
127 X_Deprn_Basis_Rule_Id,
128 X_Polish_Adj_Calc_Basis_Flag,
129 X_Guarantee_Rate_Method_Flag,
130 x_jp_imp_calc_basis_flag
131 );
132
133 OPEN C;
134 FETCH C INTO X_Rowid;
135 if (C%NOTFOUND) then
136 CLOSE C;
137 Raise NO_DATA_FOUND;
138 end if;
139 CLOSE C;
140
141 -- Fix for Bug #3810332. Need to be more specific when updating the
142 -- basis rules to prevent deadlock.
143 if ((X_Rate_Source_Rule = 'FLAT') and
144 (X_Deprn_Basis_Rule = 'NBV') and
145 (nvl(X_Deprn_Basis_Formula, 'STRICT_FLAT') = 'STRICT_FLAT') and
146 (X_Deprn_Basis_Rule_Id is null)) then
147
148 -- For Depreciable Basis Formula logic
149 UPDATE fa_methods
150 SET deprn_basis_rule_id =
151 (SELECT deprn_basis_rule_id
152 FROM fa_deprn_basis_rules
153 WHERE RULE_NAME='TRANSACTION')
154 WHERE rate_source_rule='FLAT'
155 AND deprn_basis_rule='NBV'
156 AND deprn_basis_formula IS NULL
157 AND deprn_basis_rule_id IS NULL
158 AND method_id = X_Method_Id;
159
160 UPDATE fa_methods
161 SET deprn_basis_rule_id =
162 (SELECT deprn_basis_rule_id
163 FROM fa_deprn_basis_rules
164 WHERE RULE_NAME='FYBEGIN')
165 WHERE rate_source_rule='FLAT'
166 AND deprn_basis_rule='NBV'
167 AND deprn_basis_formula ='STRICT_FLAT'
168 AND deprn_basis_rule_id IS NULL
169 AND method_id = X_Method_Id;
170
171 end if;
172
173 exception
174 when others then
175
176 fa_srvr_msg.add_sql_error(
177 calling_fn => 'fa_methods_pkg.insert_row', p_log_level_rec => p_log_level_rec);
178
179 FA_STANDARD_PKG.RAISE_ERROR(
180 CALLED_FN => 'fa_methods_pkg.insert_row',
181 CALLING_FN => X_Calling_Fn, p_log_level_rec => p_log_level_rec);
182
183 END Insert_Row;
184
185
186 PROCEDURE Lock_Row(X_Rowid VARCHAR2,
187 X_Method_Id NUMBER,
188 X_Method_Code VARCHAR2,
189 X_Life_In_Months NUMBER DEFAULT NULL,
190 X_Depreciate_Lastyear_Flag VARCHAR2,
191 X_Stl_Method_Flag VARCHAR2,
192 X_Rate_Source_Rule VARCHAR2,
193 X_Deprn_Basis_Rule VARCHAR2,
194 X_Prorate_Periods_Per_Year NUMBER DEFAULT NULL,
195 X_Name VARCHAR2 DEFAULT NULL,
196 X_Attribute1 VARCHAR2 DEFAULT NULL,
197 X_Attribute2 VARCHAR2 DEFAULT NULL,
198 X_Attribute3 VARCHAR2 DEFAULT NULL,
199 X_Attribute4 VARCHAR2 DEFAULT NULL,
200 X_Attribute5 VARCHAR2 DEFAULT NULL,
201 X_Attribute6 VARCHAR2 DEFAULT NULL,
202 X_Attribute7 VARCHAR2 DEFAULT NULL,
203 X_Attribute8 VARCHAR2 DEFAULT NULL,
204 X_Attribute9 VARCHAR2 DEFAULT NULL,
205 X_Attribute10 VARCHAR2 DEFAULT NULL,
206 X_Attribute11 VARCHAR2 DEFAULT NULL,
207 X_Attribute12 VARCHAR2 DEFAULT NULL,
208 X_Attribute13 VARCHAR2 DEFAULT NULL,
209 X_Attribute14 VARCHAR2 DEFAULT NULL,
210 X_Attribute15 VARCHAR2 DEFAULT NULL,
211 X_Attribute_Category_Code VARCHAR2 DEFAULT NULL,
212 X_Exclude_Salvage_Value_Flag VARCHAR2 DEFAULT 'NO',
213 -- added for alternative flat depreciation calcuation. for 11.5.2
214 X_Deprn_Basis_Formula VARCHAR2 DEFAULT NULL,
215 X_Polish_Adj_Calc_Basis_Flag VARCHAR2 DEFAULT NULL,
216 X_Guarantee_Rate_Method_Flag VARCHAR2 DEFAULT NULL,
217 X_Calling_Fn VARCHAR2,
218 -- added for Depreciable Basis Formula
219 X_Deprn_Basis_Rule_Id NUMBER DEFAULT NULL,
220 x_jp_imp_calc_basis_flag VARCHAR2 DEFAULT NULL
221 , p_log_level_rec IN FA_API_TYPES.log_level_rec_type) IS
222 CURSOR C IS
223 SELECT method_id,
224 method_code,
225 life_in_months,
226 depreciate_lastyear_flag,
227 stl_method_flag,
228 rate_source_rule,
229 deprn_basis_rule,
230 prorate_periods_per_year,
231 name,
232 last_update_date,
233 last_updated_by,
234 created_by,
235 creation_date,
236 last_update_login,
237 attribute1,
238 attribute2,
239 attribute3,
240 attribute4,
241 attribute5,
242 attribute6,
243 attribute7,
244 attribute8,
245 attribute9,
246 attribute10,
247 attribute11,
248 attribute12,
249 attribute13,
250 attribute14,
251 attribute15,
252 attribute_category_code,
253 deprn_basis_formula,
254 exclude_salvage_value_flag,
255 deprn_basis_rule_id,
256 polish_adj_calc_basis_flag,
257 guarantee_rate_method_flag,
258 jp_imp_calc_basis_flag
259 FROM fa_methods
260 WHERE method_code = X_Method_Code
261 AND ((life_in_months = X_Life_In_Months) or
262 ((life_in_months is null) and (X_Life_In_Months is null)))
263 FOR UPDATE of Method_Id NOWAIT;
264 Recinfo C%ROWTYPE;
265
266 BEGIN
267
268 OPEN C;
269 FETCH C INTO Recinfo;
270 if (C%NOTFOUND) then
271 CLOSE C;
272 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
273 APP_EXCEPTION.Raise_Exception;
274 end if;
275 CLOSE C;
276 if (
277 (Recinfo.method_id = X_Method_Id)
278 AND (Recinfo.method_code = X_Method_Code)
279 AND ( (Recinfo.life_in_months = X_Life_In_Months)
280 OR ( (Recinfo.life_in_months IS NULL)
281 AND (X_Life_In_Months IS NULL)))
282 AND (Recinfo.depreciate_lastyear_flag = X_Depreciate_Lastyear_Flag)
283 AND (Recinfo.stl_method_flag = X_Stl_Method_Flag)
284 AND (Recinfo.rate_source_rule = X_Rate_Source_Rule)
285 AND (Recinfo.deprn_basis_rule = X_Deprn_Basis_Rule)
286 AND ( (Recinfo.prorate_periods_per_year =
287 X_Prorate_Periods_Per_Year)
288 OR ( (Recinfo.prorate_periods_per_year IS NULL)
289 AND (X_Prorate_Periods_Per_Year IS NULL)))
290 AND ( (Recinfo.name = X_Name)
291 OR ( (Recinfo.name IS NULL)
292 AND (X_Name IS NULL)))
293 AND ( (Recinfo.attribute1 = X_Attribute1)
294 OR ( (Recinfo.attribute1 IS NULL)
295 AND (X_Attribute1 IS NULL)))
296 AND ( (Recinfo.attribute2 = X_Attribute2)
297 OR ( (Recinfo.attribute2 IS NULL)
298 AND (X_Attribute2 IS NULL)))
299 AND ( (Recinfo.attribute3 = X_Attribute3)
300 OR ( (Recinfo.attribute3 IS NULL)
301 AND (X_Attribute3 IS NULL)))
302 AND ( (Recinfo.attribute4 = X_Attribute4)
303 OR ( (Recinfo.attribute4 IS NULL)
304 AND (X_Attribute4 IS NULL)))
305 AND ( (Recinfo.attribute5 = X_Attribute5)
306 OR ( (Recinfo.attribute5 IS NULL)
307 AND (X_Attribute5 IS NULL)))
308 AND ( (Recinfo.attribute6 = X_Attribute6)
309 OR ( (Recinfo.attribute6 IS NULL)
310 AND (X_Attribute6 IS NULL)))
311 AND ( (Recinfo.attribute7 = X_Attribute7)
312 OR ( (Recinfo.attribute7 IS NULL)
313 AND (X_Attribute7 IS NULL)))
314 AND ( (Recinfo.attribute8 = X_Attribute8)
315 OR ( (Recinfo.attribute8 IS NULL)
316 AND (X_Attribute8 IS NULL)))
317 AND ( (Recinfo.attribute9 = X_Attribute9)
318 OR ( (Recinfo.attribute9 IS NULL)
319 AND (X_Attribute9 IS NULL)))
320 AND ( (Recinfo.attribute10 = X_Attribute10)
321 OR ( (Recinfo.attribute10 IS NULL)
322 AND (X_Attribute10 IS NULL)))
323 AND ( (Recinfo.attribute11 = X_Attribute11)
324 OR ( (Recinfo.attribute11 IS NULL)
325 AND (X_Attribute11 IS NULL)))
326 AND ( (Recinfo.attribute12 = X_Attribute12)
327 OR ( (Recinfo.attribute12 IS NULL)
328 AND (X_Attribute12 IS NULL)))
329 AND ( (Recinfo.attribute13 = X_Attribute13)
330 OR ( (Recinfo.attribute13 IS NULL)
331 AND (X_Attribute13 IS NULL)))
332 AND ( (Recinfo.attribute14 = X_Attribute14)
333 OR ( (Recinfo.attribute14 IS NULL)
334 AND (X_Attribute14 IS NULL)))
335 AND ( (Recinfo.attribute15 = X_Attribute15)
336 OR ( (Recinfo.attribute15 IS NULL)
337 AND (X_Attribute15 IS NULL)))
338 AND ( (Recinfo.attribute_category_code = X_Attribute_Category_Code
339 )
340 OR ( (Recinfo.attribute_category_code IS NULL)
341 AND (X_Attribute_Category_Code IS NULL)))
342 AND ( (Recinfo.exclude_salvage_value_flag = X_Exclude_Salvage_Value_Flag)
343 OR ( (Recinfo.exclude_salvage_value_flag IS NULL)
344 AND (X_Exclude_Salvage_Value_Flag IS NULL)))
345 AND ( (Recinfo.deprn_basis_formula = X_Deprn_Basis_Formula)
346 OR ( (Recinfo.deprn_basis_formula IS NULL)
347 AND (X_Deprn_Basis_Formula is NULL)))
348 AND ( (Recinfo.deprn_basis_rule_id = X_Deprn_Basis_Rule_Id)
349 OR ( (Recinfo.deprn_basis_rule_id IS NULL)
350 AND (X_Deprn_Basis_Rule_Id is NULL)))
351 ) then
352 return;
353 else
354 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
355 APP_EXCEPTION.Raise_Exception;
356 end if;
357 END Lock_Row;
358
359 PROCEDURE Update_Row(X_Rowid VARCHAR2,
360 X_Method_Id NUMBER,
361 X_Method_Code VARCHAR2,
362 X_Life_In_Months NUMBER,
363 X_Depreciate_Lastyear_Flag VARCHAR2,
364 X_Stl_Method_Flag VARCHAR2,
365 X_Rate_Source_Rule VARCHAR2,
366 X_Deprn_Basis_Rule VARCHAR2,
367 X_Prorate_Periods_Per_Year NUMBER,
368 X_Name VARCHAR2,
369 X_Last_Update_Date DATE,
370 X_Last_Updated_By NUMBER,
371 X_Last_Update_Login NUMBER,
372 X_Attribute1 VARCHAR2,
373 X_Attribute2 VARCHAR2,
374 X_Attribute3 VARCHAR2,
375 X_Attribute4 VARCHAR2,
376 X_Attribute5 VARCHAR2,
377 X_Attribute6 VARCHAR2,
378 X_Attribute7 VARCHAR2,
379 X_Attribute8 VARCHAR2,
380 X_Attribute9 VARCHAR2,
381 X_Attribute10 VARCHAR2,
382 X_Attribute11 VARCHAR2,
383 X_Attribute12 VARCHAR2,
384 X_Attribute13 VARCHAR2,
385 X_Attribute14 VARCHAR2,
386 X_Attribute15 VARCHAR2,
387 X_Attribute_Category_Code VARCHAR2,
388 X_Exclude_Salvage_Value_Flag VARCHAR2,
389 -- added for alternative flat rate depreciation calculation. for 11.5.2
390 X_Deprn_Basis_Formula VARCHAR2,
391 X_Polish_Adj_Calc_Basis_Flag VARCHAR2,
392 X_Guarantee_Rate_Method_Flag VARCHAR2,
393 X_Calling_Fn VARCHAR2,
394 -- added for Depreciable Basis Formula
395 X_Deprn_Basis_Rule_Id NUMBER DEFAULT NULL,
396 x_jp_imp_calc_basis_flag VARCHAR2 DEFAULT NULL
397 , p_log_level_rec IN FA_API_TYPES.log_level_rec_type) IS
398
399 BEGIN
400 ad_zd_seed.prepare('fa_methods');
401 -- Split into separate statements for performance reasons.
402 if (X_Life_In_Months is not null) then
403
404 UPDATE fa_methods
405 SET
406 depreciate_lastyear_flag = X_Depreciate_Lastyear_Flag,
407 stl_method_flag = X_Stl_Method_Flag,
408 rate_source_rule = X_Rate_Source_Rule,
409 deprn_basis_rule = X_Deprn_Basis_Rule,
410 prorate_periods_per_year = X_Prorate_Periods_Per_Year,
411 name = X_Name,
412 last_update_date = X_Last_Update_Date,
413 last_updated_by = X_Last_Updated_By,
414 last_update_login = X_Last_Update_Login,
415 attribute1 = X_Attribute1,
416 attribute2 = X_Attribute2,
417 attribute3 = X_Attribute3,
418 attribute4 = X_Attribute4,
419 attribute5 = X_Attribute5,
420 attribute6 = X_Attribute6,
421 attribute7 = X_Attribute7,
422 attribute8 = X_Attribute8,
423 attribute9 = X_Attribute9,
424 attribute10 = X_Attribute10,
425 attribute11 = X_Attribute11,
426 attribute12 = X_Attribute12,
427 attribute13 = X_Attribute13,
428 attribute14 = X_Attribute14,
429 attribute15 = X_Attribute15,
430 attribute_category_code = X_Attribute_Category_Code,
431 exclude_salvage_value_flag = X_Exclude_Salvage_Value_Flag,
432 deprn_basis_formula = X_Deprn_Basis_Formula,
433 polish_adj_calc_basis_flag = X_Polish_Adj_Calc_Basis_Flag,
434 guarantee_rate_method_flag = X_Guarantee_Rate_Method_Flag,
435 deprn_basis_rule_id = X_Deprn_Basis_Rule_Id,
436 jp_imp_calc_basis_flag = x_jp_imp_calc_basis_flag
437 WHERE method_code = X_Method_Code
438 AND life_in_months = X_Life_In_Months;
439
440 if (SQL%NOTFOUND) then
441 Raise NO_DATA_FOUND;
442 end if;
443
444 -- Fix for Bug #3810332. Need to be more specific when updating the
445 -- basis rules to prevent deadlock.
446 if ((X_Rate_Source_Rule = 'FLAT') and
447 (X_Deprn_Basis_Rule = 'NBV') and
448 (nvl(X_Deprn_Basis_Formula, 'STRICT_FLAT') = 'STRICT_FLAT') and
449 (X_Deprn_Basis_Rule_Id is null)) then
450
451 -- For Depreciable Basis Formula logic
452 UPDATE fa_methods
453 SET deprn_basis_rule_id =
454 (SELECT deprn_basis_rule_id
455 FROM fa_deprn_basis_rules
456 WHERE RULE_NAME='TRANSACTION')
457 WHERE rate_source_rule='FLAT'
458 AND deprn_basis_rule='NBV'
459 AND deprn_basis_formula IS NULL
460 AND deprn_basis_rule_id IS NULL
461 AND method_code = X_Method_Code
462 AND life_in_months = X_Life_In_Months;
463
464 UPDATE fa_methods
465 SET deprn_basis_rule_id =
466 (SELECT deprn_basis_rule_id
467 FROM fa_deprn_basis_rules
468 WHERE RULE_NAME='FYBEGIN')
469 WHERE rate_source_rule='FLAT'
470 AND deprn_basis_rule='NBV'
471 AND deprn_basis_formula ='STRICT_FLAT'
472 AND deprn_basis_rule_id IS NULL
473 AND method_code = X_Method_Code
474 AND life_in_months = X_Life_In_Months;
475
476 end if;
477 else
478
479 UPDATE fa_methods
480 SET
481 depreciate_lastyear_flag = X_Depreciate_Lastyear_Flag,
482 stl_method_flag = X_Stl_Method_Flag,
483 rate_source_rule = X_Rate_Source_Rule,
484 deprn_basis_rule = X_Deprn_Basis_Rule,
485 prorate_periods_per_year = X_Prorate_Periods_Per_Year,
486 name = X_Name,
487 last_update_date = X_Last_Update_Date,
488 last_updated_by = X_Last_Updated_By,
489 last_update_login = X_Last_Update_Login,
490 attribute1 = X_Attribute1,
491 attribute2 = X_Attribute2,
492 attribute3 = X_Attribute3,
493 attribute4 = X_Attribute4,
494 attribute5 = X_Attribute5,
495 attribute6 = X_Attribute6,
496 attribute7 = X_Attribute7,
497 attribute8 = X_Attribute8,
498 attribute9 = X_Attribute9,
499 attribute10 = X_Attribute10,
500 attribute11 = X_Attribute11,
501 attribute12 = X_Attribute12,
502 attribute13 = X_Attribute13,
503 attribute14 = X_Attribute14,
504 attribute15 = X_Attribute15,
505 attribute_category_code = X_Attribute_Category_Code,
506 exclude_salvage_value_flag = X_Exclude_Salvage_Value_Flag,
507 deprn_basis_formula = X_Deprn_Basis_Formula,
508 polish_adj_calc_basis_flag = X_Polish_Adj_Calc_Basis_Flag,
509 guarantee_rate_method_flag = X_Guarantee_Rate_Method_Flag,
510 deprn_basis_rule_id = X_Deprn_Basis_Rule_Id,
511 jp_imp_calc_basis_flag = x_jp_imp_calc_basis_flag
512 WHERE method_code = X_Method_Code
513 AND life_in_months is null;
514
515 if (SQL%NOTFOUND) then
516 Raise NO_DATA_FOUND;
517 end if;
518
519 -- Fix for Bug #3810332. Need to be more specific when updating the
520 -- basis rules to prevent deadlock.
521 if ((X_Rate_Source_Rule = 'FLAT') and
522 (X_Deprn_Basis_Rule = 'NBV') and
523 (nvl(X_Deprn_Basis_Formula, 'STRICT_FLAT') = 'STRICT_FLAT') and
524 (X_Deprn_Basis_Rule_Id is null)) then
525
526 -- For Depreciable Basis Formula logic
527 UPDATE fa_methods
528 SET deprn_basis_rule_id =
529 (SELECT deprn_basis_rule_id
530 FROM fa_deprn_basis_rules
531 WHERE RULE_NAME='TRANSACTION')
532 WHERE rate_source_rule='FLAT'
533 AND deprn_basis_rule='NBV'
534 AND deprn_basis_formula IS NULL
535 AND deprn_basis_rule_id IS NULL
536 AND method_code = X_Method_Code
537 AND life_in_months is null;
538
539 UPDATE fa_methods
540 SET deprn_basis_rule_id =
541 (SELECT deprn_basis_rule_id
542 FROM fa_deprn_basis_rules
543 WHERE RULE_NAME='FYBEGIN')
544 WHERE rate_source_rule='FLAT'
545 AND deprn_basis_rule='NBV'
546 AND deprn_basis_formula ='STRICT_FLAT'
547 AND deprn_basis_rule_id IS NULL
548 AND method_code = X_Method_Code
549 AND life_in_months is null;
550
551 end if;
552 end if;
553
554 exception
555 when others then
556
557 fa_srvr_msg.add_sql_error(
558 calling_fn => 'fa_methods_pkg.update_row', p_log_level_rec => p_log_level_rec);
559
560 FA_STANDARD_PKG.RAISE_ERROR(
561 CALLED_FN => 'fa_methods_pkg.update_row',
562 CALLING_FN => X_Calling_Fn, p_log_level_rec => p_log_level_rec);
563
564 END Update_Row;
565
566 PROCEDURE Delete_Row(X_Rowid VARCHAR2,
567 X_Calling_Fn VARCHAR2, p_log_level_rec IN FA_API_TYPES.log_level_rec_type) IS
568 BEGIN
569 ad_zd_seed.prepare('fa_methods');
570 DELETE FROM fa_methods
571 WHERE rowid = X_Rowid;
572
573 if (SQL%NOTFOUND) then
574 Raise NO_DATA_FOUND;
575 end if;
576 exception
577 when others then
578
579 fa_srvr_msg.add_sql_error(
580 calling_fn => 'fa_methods_pkg.delete_row', p_log_level_rec => p_log_level_rec);
581
582 FA_STANDARD_PKG.RAISE_ERROR(
583 CALLED_FN => 'fa_methods_pkg.delete_row',
584 CALLING_FN => X_Calling_Fn, p_log_level_rec => p_log_level_rec);
585
586 end DELETE_ROW;
587
588 procedure LOAD_ROW (
589 X_METHOD_ID in NUMBER,
590 X_OWNER in VARCHAR2,
591 X_METHOD_CODE in VARCHAR2,
592 X_LIFE_IN_MONTHS in NUMBER,
593 X_DEPRECIATE_LASTYEAR_FLAG in VARCHAR2,
594 X_STL_METHOD_FLAG in VARCHAR2,
595 X_RATE_SOURCE_RULE in VARCHAR2,
596 X_DEPRN_BASIS_RULE in VARCHAR2,
597 X_PRORATE_PERIODS_PER_YEAR in NUMBER,
598 X_NAME in VARCHAR2,
599 X_ATTRIBUTE1 in VARCHAR2,
600 X_ATTRIBUTE2 in VARCHAR2,
601 X_ATTRIBUTE3 in VARCHAR2,
602 X_ATTRIBUTE4 in VARCHAR2,
603 X_ATTRIBUTE5 in VARCHAR2,
604 X_ATTRIBUTE6 in VARCHAR2,
605 X_ATTRIBUTE7 in VARCHAR2,
606 X_ATTRIBUTE8 in VARCHAR2,
607 X_ATTRIBUTE9 in VARCHAR2,
608 X_ATTRIBUTE10 in VARCHAR2,
609 X_ATTRIBUTE11 in VARCHAR2,
610 X_ATTRIBUTE12 in VARCHAR2,
611 X_ATTRIBUTE13 in VARCHAR2,
612 X_ATTRIBUTE14 in VARCHAR2,
613 X_ATTRIBUTE15 in VARCHAR2,
614 X_ATTRIBUTE_CATEGORY_CODE in VARCHAR2,
615 X_EXCLUDE_SALVAGE_VALUE_FLAG in VARCHAR2,
616 -- added for alternative flat depreciatio calculation. for 11.5.2
617 X_DEPRN_BASIS_FORMULA in VARCHAR2,
618 X_POLISH_ADJ_CALC_BASIS_FLAG in VARCHAR2,
619 X_GUARANTEE_RATE_METHOD_FLAG in VARCHAR2,
620 -- added for Depreciable Basis Formula
621 X_DEPRN_BASIS_RULE_ID in NUMBER DEFAULT NULL,
622 X_JP_IMP_CALC_BASIS_FLAG IN VARCHAR2 DEFAULT NULL
623 , p_log_level_rec IN FA_API_TYPES.log_level_rec_type) is
624
625 h_record_exists number(15);
626 h_method_id number(15);
627
628 user_id number;
629 row_id varchar2(64);
630
631 begin
632
633 h_method_id := X_Method_Id;
634
635 if (X_Owner = 'SEED') then
636 user_id := 1;
637 else
638 user_id := 0;
639 end if;
640
641 if (X_Life_In_Months is not null) then
642
643 select count(*)
644 into h_record_exists
645 from fa_methods
646 where method_code = X_Method_Code
647 and life_in_months = X_Life_In_Months;
648
649 else
650
651 select count(*)
652 into h_record_exists
653 from fa_methods
654 where method_code = X_Method_Code
655 and life_in_months is null;
656
657 end if;
658
659 if (h_record_exists > 0 ) then
660 fa_methods_pkg.update_row (
661 X_Rowid => row_id,
662 X_Method_ID => h_method_id,
663 X_Method_Code => X_Method_Code,
664 X_Life_In_Months => X_Life_In_Months,
665 X_Depreciate_Lastyear_Flag => X_Depreciate_Lastyear_Flag,
666 X_Stl_Method_Flag => X_Stl_Method_Flag,
667 X_Rate_Source_Rule => X_Rate_Source_Rule,
668 X_Deprn_Basis_Rule => X_Deprn_Basis_Rule,
669 X_Prorate_Periods_Per_Year => X_Prorate_Periods_Per_Year,
670 X_Name => X_Name,
671 X_Last_Update_Date => sysdate,
672 X_Last_Updated_By => user_id,
673 X_Last_Update_Login => 0,
674 X_Attribute1 => X_Attribute1,
675 X_Attribute2 => X_Attribute2,
676 X_Attribute3 => X_Attribute3,
677 X_Attribute4 => X_Attribute4,
678 X_Attribute5 => X_Attribute5,
679 X_Attribute6 => X_Attribute6,
680 X_Attribute7 => X_Attribute7,
681 X_Attribute8 => X_Attribute8,
682 X_Attribute9 => X_Attribute9,
683 X_Attribute10 => X_Attribute10,
684 X_Attribute11 => X_Attribute11,
685 X_Attribute12 => X_Attribute12,
686 X_Attribute13 => X_Attribute13,
687 X_Attribute14 => X_Attribute14,
688 X_Attribute15 => X_Attribute15,
689 X_Attribute_Category_Code => X_Attribute_Category_Code,
690 X_Exclude_Salvage_Value_Flag => X_Exclude_Salvage_Value_Flag,
691 X_Deprn_Basis_Formula => X_Deprn_Basis_Formula,
692 X_Polish_Adj_Calc_Basis_Flag => X_Polish_Adj_Calc_Basis_Flag,
693 X_Guarantee_Rate_Method_Flag => X_Guarantee_Rate_Method_Flag,
694 X_Calling_Fn => 'fa_methods_pkg.load_row',
695 X_Deprn_Basis_Rule_Id => X_Deprn_Basis_Rule_Id,
696 x_jp_imp_calc_basis_flag => x_jp_imp_calc_basis_flag
697 , p_log_level_rec => p_log_level_rec);
698 else
699
700 h_method_id := null;
701
702 fa_methods_pkg.insert_row (
703 X_Rowid => row_id,
704 X_Method_ID => h_method_id,
705 X_Method_Code => X_Method_Code,
706 X_Life_In_Months => X_Life_In_Months,
707 X_Depreciate_Lastyear_Flag => X_Depreciate_Lastyear_Flag,
708 X_Stl_Method_Flag => X_Stl_Method_Flag,
709 X_Rate_Source_Rule => X_Rate_Source_Rule,
710 X_Deprn_Basis_Rule => X_Deprn_Basis_Rule,
711 X_Prorate_Periods_Per_Year => X_Prorate_Periods_Per_Year,
712 X_Name => X_Name,
713 X_Last_Update_Date => sysdate,
714 X_Last_Updated_By => user_id,
715 X_Created_By => user_id,
716 X_Creation_Date => sysdate,
717 X_Last_Update_Login => 0,
718 X_Attribute1 => X_Attribute1,
719 X_Attribute2 => X_Attribute2,
720 X_Attribute3 => X_Attribute3,
721 X_Attribute4 => X_Attribute4,
722 X_Attribute5 => X_Attribute5,
723 X_Attribute6 => X_Attribute6,
724 X_Attribute7 => X_Attribute7,
725 X_Attribute8 => X_Attribute8,
726 X_Attribute9 => X_Attribute9,
727 X_Attribute10 => X_Attribute10,
728 X_Attribute11 => X_Attribute11,
729 X_Attribute12 => X_Attribute12,
730 X_Attribute13 => X_Attribute13,
731 X_Attribute14 => X_Attribute14,
732 X_Attribute15 => X_Attribute15,
733 X_Attribute_Category_Code => X_Attribute_Category_Code,
734 X_Exclude_Salvage_Value_Flag => X_Exclude_Salvage_Value_Flag,
735 X_Deprn_Basis_Formula => X_Deprn_Basis_Formula,
736 X_Polish_Adj_Calc_Basis_Flag => X_Polish_Adj_Calc_Basis_Flag,
737 X_Guarantee_Rate_Method_Flag => X_Guarantee_Rate_Method_Flag,
738 X_Calling_Fn => 'fa_methods_pkg.load_row',
739 X_Deprn_Basis_Rule_Id => X_Deprn_Basis_Rule_Id,
740 x_jp_imp_calc_basis_flag => x_jp_imp_calc_basis_flag
741 , p_log_level_rec => p_log_level_rec);
742 end if;
743
744 exception
745 when others then
746
747 fa_srvr_msg.add_sql_error(
748 calling_fn => 'fa_methods_pkg.load_row', p_log_level_rec => p_log_level_rec);
749
750 FA_STANDARD_PKG.RAISE_ERROR(
751 CALLED_FN => 'fa_methods_pkg.load_row',
752 CALLING_FN => 'upload fa_methods:' || SQLERRM, p_log_level_rec => p_log_level_rec);
753
754 end LOAD_ROW;
755 /*Bug 8355119 overloading function for release specific signatures*/
756 procedure LOAD_ROW (
757 X_CUSTOM_MODE in VARCHAR2,
758 X_METHOD_ID in NUMBER,
759 X_DB_LAST_UPDATED_BY NUMBER,
760 X_DB_LAST_UPDATE_DATE DATE,
761 X_OWNER in VARCHAR2,
762 X_LAST_UPDATE_DATE in DATE,
763 X_METHOD_CODE in VARCHAR2,
764 X_LIFE_IN_MONTHS in NUMBER,
765 X_DEPRECIATE_LASTYEAR_FLAG in VARCHAR2,
766 X_STL_METHOD_FLAG in VARCHAR2,
767 X_RATE_SOURCE_RULE in VARCHAR2,
768 X_DEPRN_BASIS_RULE in VARCHAR2,
769 X_PRORATE_PERIODS_PER_YEAR in NUMBER,
770 X_NAME in VARCHAR2,
771 X_ATTRIBUTE1 in VARCHAR2,
772 X_ATTRIBUTE2 in VARCHAR2,
773 X_ATTRIBUTE3 in VARCHAR2,
774 X_ATTRIBUTE4 in VARCHAR2,
775 X_ATTRIBUTE5 in VARCHAR2,
776 X_ATTRIBUTE6 in VARCHAR2,
777 X_ATTRIBUTE7 in VARCHAR2,
778 X_ATTRIBUTE8 in VARCHAR2,
779 X_ATTRIBUTE9 in VARCHAR2,
780 X_ATTRIBUTE10 in VARCHAR2,
781 X_ATTRIBUTE11 in VARCHAR2,
782 X_ATTRIBUTE12 in VARCHAR2,
783 X_ATTRIBUTE13 in VARCHAR2,
784 X_ATTRIBUTE14 in VARCHAR2,
785 X_ATTRIBUTE15 in VARCHAR2,
786 X_ATTRIBUTE_CATEGORY_CODE in VARCHAR2,
787 X_EXCLUDE_SALVAGE_VALUE_FLAG in VARCHAR2,
788 -- added for alternative flat depreciatio calculation. for 11.5.2
789 X_DEPRN_BASIS_FORMULA in VARCHAR2,
790 X_POLISH_ADJ_CALC_BASIS_FLAG in VARCHAR2,
791 X_GUARANTEE_RATE_METHOD_FLAG in VARCHAR2,
792 -- added for Depreciable Basis Formula
793 X_DEPRN_BASIS_RULE_ID in NUMBER DEFAULT NULL,
794 X_JP_IMP_CALC_BASIS_FLAG IN VARCHAR2 DEFAULT NULL,
795 p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) is
796
797 h_record_exists number(15);
798 h_method_id number(15);
799
800 user_id number;
801 row_id varchar2(64);
802
803 begin
804
805 user_id := fnd_load_util.owner_id (X_Owner);
806
807 if (X_Method_Id is not null) then
808
809 if (fnd_load_util.upload_test(user_id, x_last_update_date,
810 X_db_last_updated_by, X_db_last_update_date,
811 X_CUSTOM_MODE)) then
812
813 fa_methods_pkg.update_row (
814 X_Rowid => row_id,
815 X_Method_ID => h_method_id,
816 X_Method_Code => X_Method_Code,
817 X_Life_In_Months => X_Life_In_Months,
818 X_Depreciate_Lastyear_Flag => X_Depreciate_Lastyear_Flag,
819 X_Stl_Method_Flag => X_Stl_Method_Flag,
820 X_Rate_Source_Rule => X_Rate_Source_Rule,
821 X_Deprn_Basis_Rule => X_Deprn_Basis_Rule,
822 X_Prorate_Periods_Per_Year => X_Prorate_Periods_Per_Year,
823 X_Name => X_Name,
824 X_Last_Update_Date => sysdate,
825 X_Last_Updated_By => user_id,
826 X_Last_Update_Login => 0,
827 X_Attribute1 => X_Attribute1,
828 X_Attribute2 => X_Attribute2,
829 X_Attribute3 => X_Attribute3,
830 X_Attribute4 => X_Attribute4,
831 X_Attribute5 => X_Attribute5,
832 X_Attribute6 => X_Attribute6,
833 X_Attribute7 => X_Attribute7,
834 X_Attribute8 => X_Attribute8,
835 X_Attribute9 => X_Attribute9,
836 X_Attribute10 => X_Attribute10,
837 X_Attribute11 => X_Attribute11,
838 X_Attribute12 => X_Attribute12,
839 X_Attribute13 => X_Attribute13,
840 X_Attribute14 => X_Attribute14,
841 X_Attribute15 => X_Attribute15,
842 X_Attribute_Category_Code => X_Attribute_Category_Code,
843 X_Exclude_Salvage_Value_Flag => X_Exclude_Salvage_Value_Flag,
844 X_Deprn_Basis_Formula => X_Deprn_Basis_Formula,
845 X_Polish_Adj_Calc_Basis_Flag => X_Polish_Adj_Calc_Basis_Flag,
846 X_Guarantee_Rate_Method_Flag => X_Guarantee_Rate_Method_Flag,
847 X_Calling_Fn => 'fa_methods_pkg.load_row',
848 X_Deprn_Basis_Rule_Id => X_Deprn_Basis_Rule_Id,
849 x_jp_imp_calc_basis_flag => x_jp_imp_calc_basis_flag
850 ,p_log_level_rec => p_log_level_rec);
851 end if;
852 else
853
854 h_method_id := null;
855
856 fa_methods_pkg.insert_row (
857 X_Rowid => row_id,
858 X_Method_ID => h_method_id,
859 X_Method_Code => X_Method_Code,
860 X_Life_In_Months => X_Life_In_Months,
861 X_Depreciate_Lastyear_Flag => X_Depreciate_Lastyear_Flag,
862 X_Stl_Method_Flag => X_Stl_Method_Flag,
863 X_Rate_Source_Rule => X_Rate_Source_Rule,
864 X_Deprn_Basis_Rule => X_Deprn_Basis_Rule,
865 X_Prorate_Periods_Per_Year => X_Prorate_Periods_Per_Year,
866 X_Name => X_Name,
867 X_Last_Update_Date => sysdate,
868 X_Last_Updated_By => user_id,
869 X_Created_By => user_id,
870 X_Creation_Date => sysdate,
871 X_Last_Update_Login => 0,
872 X_Attribute1 => X_Attribute1,
873 X_Attribute2 => X_Attribute2,
874 X_Attribute3 => X_Attribute3,
875 X_Attribute4 => X_Attribute4,
876 X_Attribute5 => X_Attribute5,
877 X_Attribute6 => X_Attribute6,
878 X_Attribute7 => X_Attribute7,
879 X_Attribute8 => X_Attribute8,
880 X_Attribute9 => X_Attribute9,
881 X_Attribute10 => X_Attribute10,
882 X_Attribute11 => X_Attribute11,
883 X_Attribute12 => X_Attribute12,
884 X_Attribute13 => X_Attribute13,
885 X_Attribute14 => X_Attribute14,
886 X_Attribute15 => X_Attribute15,
887 X_Attribute_Category_Code => X_Attribute_Category_Code,
888 X_Exclude_Salvage_Value_Flag => X_Exclude_Salvage_Value_Flag,
889 X_Deprn_Basis_Formula => X_Deprn_Basis_Formula,
890 X_Polish_Adj_Calc_Basis_Flag => X_Polish_Adj_Calc_Basis_Flag,
891 X_Guarantee_Rate_Method_Flag => X_Guarantee_Rate_Method_Flag,
892 X_Calling_Fn => 'fa_methods_pkg.load_row',
893 X_Deprn_Basis_Rule_Id => X_Deprn_Basis_Rule_Id,
894 x_jp_imp_calc_basis_flag => x_jp_imp_calc_basis_flag
895 ,p_log_level_rec => p_log_level_rec);
896 end if;
897
898 exception
899 when others then
900
901 fa_srvr_msg.add_sql_error(
902 calling_fn => 'fa_methods_pkg.load_row'
903 ,p_log_level_rec => p_log_level_rec);
904
905 FA_STANDARD_PKG.RAISE_ERROR(
906 CALLED_FN => 'fa_methods_pkg.load_row',
907 CALLING_FN => 'upload fa_methods:' || SQLERRM
908 ,p_log_level_rec => p_log_level_rec);
909
910 end LOAD_ROW;
911
912 /*Bugfix 6449856: Added x_method_code and x_life_in_months
913 * parameters */
914 procedure TRANSLATE_ROW (
915 X_METHOD_ID in NUMBER,
916 X_METHOD_CODE in VARCHAR2,
917 X_LIFE_IN_MONTHS in NUMBER,
918 X_OWNER in VARCHAR2,
919 X_NAME in VARCHAR2
920 , p_log_level_rec IN FA_API_TYPES.log_level_rec_type) is
921
922 user_id number;
923
924 begin
925
926 if (X_Owner = 'SEED') then
927 user_id := 1;
928 else
929 user_id := 0;
930 end if;
931
932 /*Bugfix 6449856: Use method_code and life_in_months to update
933 * the appropriate row instead of method_id. This is because
934 * for new methods, method_id will be different from what is being
935 * passed from ldt file. fyi, LOAD_ROW procedure passes method_id
936 * as null to INSERT_ROW. To translate the new row, we need to make use
937 * of method_code and life_in_months.
938 * */
939
940 if (X_Life_In_Months is not null) then
941 update FA_METHODS set
942 NAME = nvl(X_Name, Name),
943 LAST_UPDATE_DATE = sysdate,
944 LAST_UPDATED_BY = user_id,
945 LAST_UPDATE_LOGIN = 0
946 --where METHOD_ID = X_Method_ID
947 where method_code = X_Method_Code
948 and life_in_months = X_Life_In_Months
949 and userenv('LANG') =
950 (select language_code
951 from FND_LANGUAGES
952 where installed_flag = 'B');
953 else
954 update FA_METHODS set
955 NAME = nvl(X_Name, Name),
956 LAST_UPDATE_DATE = sysdate,
957 LAST_UPDATED_BY = user_id,
958 LAST_UPDATE_LOGIN = 0
959 --where METHOD_ID = X_Method_ID
960 where method_code = X_Method_Code
961 and life_in_months is null
962 and userenv('LANG') =
963 (select language_code
964 from FND_LANGUAGES
965 where installed_flag = 'B');
966 end if;
967
968 exception
969 when others then
970
971 fa_srvr_msg.add_sql_error(
972 calling_fn => 'fa_methods_pkg.translate_row', p_log_level_rec => p_log_level_rec);
973
974 FA_STANDARD_PKG.RAISE_ERROR(
975 CALLED_FN => 'fa_methods_pkg.translate_row',
976 CALLING_FN => 'upload fa_methods', p_log_level_rec => p_log_level_rec);
977
978 end TRANSLATE_ROW;
979 /*Bug 8355119 overloading function for release specific signatures*/
980 procedure TRANSLATE_ROW (
981 X_CUSTOM_MODE in VARCHAR2,
982 X_METHOD_ID in NUMBER,
983 X_METHOD_CODE in VARCHAR2,
984 X_LIFE_IN_MONTHS in NUMBER,
985 X_DB_LAST_UPDATED_BY NUMBER,
986 X_DB_LAST_UPDATE_DATE DATE,
987 X_OWNER in VARCHAR2,
988 X_LAST_UPDATE_DATE DATE,
989 X_NAME in VARCHAR2,
990 p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null) is
991
992 user_id number;
993
994 begin
995
996 user_id := fnd_load_util.owner_id (X_Owner);
997
998 if (fnd_load_util.upload_test(user_id, x_last_update_date,
999 x_db_last_updated_by, x_db_last_update_date,
1000 X_CUSTOM_MODE)) then
1001 /*Bugfix 6685881: Use method_code and life_in_months to update
1002 * the appropriate row instead of method_id. This is because
1003 * for new methods, method_id will be different from what is being
1004 * passed from ldt file. fyi, LOAD_ROW procedure passes method_id
1005 * as null to INSERT_ROW. To translate the new row, we need to make use
1006 * of method_code and life_in_months.
1007 * */
1008
1009 if (X_Life_In_Months is not null) then
1010
1011 update FA_METHODS
1012 set NAME = nvl(X_Name, Name),
1013 LAST_UPDATE_DATE = sysdate,
1014 LAST_UPDATED_BY = user_id
1015 --where METHOD_ID = X_Method_ID
1016 where method_code = X_Method_Code
1017 and life_in_months = X_Life_In_Months
1018 and userenv('LANG') =
1019 (select language_code
1020 from FND_LANGUAGES
1021 where installed_flag = 'B');
1022 else
1023
1024 update FA_METHODS set
1025 NAME = nvl(X_Name, Name),
1026 LAST_UPDATE_DATE = sysdate,
1027 LAST_UPDATED_BY = user_id,
1028 LAST_UPDATE_LOGIN = 0
1029 --where METHOD_ID = X_Method_ID
1030 where method_code = X_Method_Code
1031 and life_in_months is null
1032 and userenv('LANG') =
1033 (select language_code
1034 from FND_LANGUAGES
1035 where installed_flag = 'B');
1036 end if;
1037
1038 end if;
1039
1040 exception
1041 when others then
1042
1043 fa_srvr_msg.add_sql_error(
1044 calling_fn => 'fa_methods_pkg.translate_row'
1045 ,p_log_level_rec => p_log_level_rec);
1046
1047 FA_STANDARD_PKG.RAISE_ERROR(
1048 CALLED_FN => 'fa_methods_pkg.translate_row',
1049 CALLING_FN => 'upload fa_methods'
1050 ,p_log_level_rec => p_log_level_rec);
1051
1052 end TRANSLATE_ROW;
1053 /*bug 8355119 adding R12 specific funtion LOAD_SEED_ROW*/
1054 procedure LOAD_SEED_ROW (
1055 x_upload_mode IN VARCHAR2,
1056 x_custom_mode IN VARCHAR2,
1057 x_owner IN VARCHAR2,
1058 x_last_update_date IN DATE,
1059 x_method_code IN VARCHAR2,
1060 x_life_in_months IN NUMBER,
1061 x_depreciate_lastyear_flag IN VARCHAR2,
1062 x_stl_method_flag IN VARCHAR2,
1063 x_rate_source_rule IN VARCHAR2,
1064 x_deprn_basis_rule IN VARCHAR2,
1065 x_prorate_periods_per_year IN NUMBER,
1066 x_name IN VARCHAR2,
1067 x_attribute1 IN VARCHAR2,
1068 x_attribute2 IN VARCHAR2,
1069 x_attribute3 IN VARCHAR2,
1070 x_attribute4 IN VARCHAR2,
1071 x_attribute5 IN VARCHAR2,
1072 x_attribute6 IN VARCHAR2,
1073 x_attribute7 IN VARCHAR2,
1074 x_attribute8 IN VARCHAR2,
1075 x_attribute9 IN VARCHAR2,
1076 x_attribute10 IN VARCHAR2,
1077 x_attribute11 IN VARCHAR2,
1078 x_attribute12 IN VARCHAR2,
1079 x_attribute13 IN VARCHAR2,
1080 x_attribute14 IN VARCHAR2,
1081 x_attribute15 IN VARCHAR2,
1082 x_attribute_category_code IN VARCHAR2,
1083 x_exclude_salvage_value_flag IN VARCHAR2,
1084 x_deprn_basis_formula IN VARCHAR2,
1085 X_Polish_Adj_Calc_Basis_Flag IN VARCHAR2,
1086 X_Guarantee_Rate_Method_Flag IN VARCHAR2,
1087 x_deprn_basis_rule_id IN NUMBER,
1088 x_jp_imp_calc_basis_flag IN VARCHAR2) IS
1089
1090
1091 h_method_id number(15);
1092 h_last_update_date date;
1093 h_last_updated_by number;
1094
1095 BEGIN
1096
1097 if not fa_cache_pkg.fazccmt (
1098 X_method => x_method_code,
1099 X_life => x_life_in_months) then
1100
1101 h_method_id := null;
1102
1103 else
1104
1105 h_method_id := fa_cache_pkg.fazccmt_record.method_id;
1106 h_last_update_date := fa_cache_pkg.fazccmt_record.last_update_date;
1107 h_last_updated_by := fa_cache_pkg.fazccmt_record.last_updated_by;
1108
1109 end if;
1110
1111 if (x_upload_mode = 'NLS') then
1112 fa_methods_pkg.TRANSLATE_ROW (
1113 x_custom_mode => x_custom_mode,
1114 x_method_id => h_method_id,
1115 x_method_code => x_method_code,
1116 x_life_in_months => x_life_in_months,
1117 x_db_last_update_date => h_last_update_date,
1118 x_db_last_updated_by => h_last_updated_by,
1119 x_owner => x_owner,
1120 x_last_update_date => x_last_update_date,
1121 x_name => x_name);
1122 else
1123 fa_methods_pkg.LOAD_ROW (
1124 x_custom_mode => x_custom_mode,
1125 x_method_id => h_method_id,
1126 x_db_last_update_date => h_last_update_date,
1127 x_db_last_updated_by => h_last_updated_by,
1128 x_owner => x_owner,
1129 x_last_update_date => x_last_update_date,
1130 x_method_code => x_method_code,
1131 x_life_in_months => x_life_in_months,
1132 x_depreciate_lastyear_flag => x_depreciate_lastyear_flag,
1133 x_stl_method_flag => x_stl_method_flag,
1134 x_rate_source_rule => x_rate_source_rule,
1135 x_deprn_basis_rule => x_deprn_basis_rule,
1136 x_prorate_periods_per_year => x_prorate_periods_per_year,
1137 x_name => x_name,
1138 x_attribute1 => x_attribute1,
1139 x_attribute2 => x_attribute2,
1140 x_attribute3 => x_attribute3,
1141 x_attribute4 => x_attribute4,
1142 x_attribute5 => x_attribute5,
1143 x_attribute6 => x_attribute6,
1144 x_attribute7 => x_attribute7,
1145 x_attribute8 => x_attribute8,
1146 x_attribute9 => x_attribute9,
1147 x_attribute10 => x_attribute10,
1148 x_attribute11 => x_attribute11,
1149 x_attribute12 => x_attribute12,
1150 x_attribute13 => x_attribute13,
1151 x_attribute14 => x_attribute14,
1152 x_attribute15 => x_attribute14,
1153 x_attribute_category_code => x_attribute_category_code,
1154 x_exclude_salvage_value_flag => x_exclude_salvage_value_flag,
1155 x_deprn_basis_formula => x_deprn_basis_formula,
1156 X_Polish_Adj_Calc_Basis_Flag => X_Polish_Adj_Calc_Basis_Flag,
1157 X_Guarantee_Rate_Method_Flag => X_Guarantee_Rate_Method_Flag,
1158 x_deprn_basis_rule_id => x_deprn_basis_rule_id,
1159 x_jp_imp_calc_basis_flag => x_jp_imp_calc_basis_flag);
1160
1161 end if;
1162
1163 END LOAD_SEED_ROW;
1164 END FA_METHODS_PKG;