DBA Data[Home] [Help]

PACKAGE BODY: APPS.FA_FLAT_RATES_PKG

Source


1 PACKAGE BODY FA_FLAT_RATES_PKG as
2 /* $Header: faxiflrb.pls 120.10.12020000.2 2012/07/19 12:33:18 dvjoshi ship $ */
3 
4 procedure INSERT_ROW (
5    X_ROWID in out nocopy VARCHAR2,
6    X_METHOD_ID in NUMBER,
7    X_BASIC_RATE in NUMBER,
8    X_ADJUSTED_RATE in NUMBER,
9    X_ADJUSTING_RATE in NUMBER,
10    X_ATTRIBUTE1 in VARCHAR2,
11    X_ATTRIBUTE2 in VARCHAR2,
12    X_ATTRIBUTE3 in VARCHAR2,
13    X_ATTRIBUTE4 in VARCHAR2,
14    X_ATTRIBUTE5 in VARCHAR2,
15    X_ATTRIBUTE6 in VARCHAR2,
16    X_ATTRIBUTE7 in VARCHAR2,
17    X_ATTRIBUTE8 in VARCHAR2,
18    X_ATTRIBUTE9 in VARCHAR2,
19    X_ATTRIBUTE10 in VARCHAR2,
20    X_ATTRIBUTE11 in VARCHAR2,
21    X_ATTRIBUTE12 in VARCHAR2,
22    X_ATTRIBUTE13 in VARCHAR2,
23    X_ATTRIBUTE14 in VARCHAR2,
24    X_ATTRIBUTE15 in VARCHAR2,
25    X_ATTRIBUTE_CATEGORY_CODE in VARCHAR2,
26    X_CREATION_DATE in DATE,
27    X_CREATED_BY in NUMBER,
28    X_LAST_UPDATE_DATE in DATE,
29    X_LAST_UPDATED_BY in NUMBER,
30    X_LAST_UPDATE_LOGIN in NUMBER
31 , p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type) is
32 
33   CURSOR C is SELECT rowid FROM fa_flat_rates
34               where  method_id = X_Method_Id
35               and    basic_rate = X_Basic_Rate
36               and    adjusted_rate = X_Adjusted_Rate;
37 
38 begin
39 
40    INSERT INTO fa_flat_rates (
41 	method_id,
42 	basic_rate,
43 	adjusted_rate,
44 	adjusting_rate,
45 	attribute1,
46 	attribute2,
47 	attribute3,
48 	attribute4,
49 	attribute5,
50 	attribute6,
51 	attribute7,
52 	attribute8,
53 	attribute9,
54 	attribute10,
55 	attribute11,
56 	attribute12,
57 	attribute13,
58 	attribute14,
59 	attribute15,
60 	attribute_category_code,
61 	creation_date,
62 	created_by,
63 	last_update_date,
64 	last_updated_by,
65 	last_update_login
66     ) VALUES (
67 	X_Method_ID,
68         X_Basic_Rate,
69         X_Adjusted_Rate,
70         X_Adjusting_Rate,
71         X_Attribute1,
72         X_Attribute2,
73         X_Attribute3,
74         X_Attribute4,
75         X_Attribute5,
76         X_Attribute6,
77         X_Attribute7,
78         X_Attribute8,
79         X_Attribute9,
80         X_Attribute10,
81         X_Attribute11,
82         X_Attribute12,
83         X_Attribute13,
84         X_Attribute14,
85         X_Attribute15,
86         X_Attribute_Category_Code,
87         X_Creation_Date,
88         X_Created_By,
89         X_Last_Update_Date,
90         X_Last_Updated_By,
91         X_Last_Update_Login
92 );
93 
94 	OPEN C;
95 	FETCH C INTO X_Rowid;
96 	if (C%NOTFOUND) then
97 	   CLOSE C;
98 	   Raise NO_DATA_FOUND;
99 	end if;
100 	CLOSE C;
101 
102 exception
103    when others then
104         fa_srvr_msg.add_sql_error(
105 	calling_fn => 'fa_flat_rates_pkg.insert_row', p_log_level_rec => p_log_level_rec);
106    raise;
107 
108 end INSERT_ROW;
109 
110 procedure LOCK_ROW (
111    X_METHOD_ID in NUMBER,
112    X_BASIC_RATE in NUMBER,
113    X_ADJUSTED_RATE in NUMBER,
114    X_ADJUSTING_RATE in NUMBER,
115    X_ATTRIBUTE1 in VARCHAR2,
116    X_ATTRIBUTE2 in VARCHAR2,
117    X_ATTRIBUTE3 in VARCHAR2,
118    X_ATTRIBUTE4 in VARCHAR2,
119    X_ATTRIBUTE5 in VARCHAR2,
120    X_ATTRIBUTE6 in VARCHAR2,
121    X_ATTRIBUTE7 in VARCHAR2,
122    X_ATTRIBUTE8 in VARCHAR2,
123    X_ATTRIBUTE9 in VARCHAR2,
124    X_ATTRIBUTE10 in VARCHAR2,
125    X_ATTRIBUTE11 in VARCHAR2,
126    X_ATTRIBUTE12 in VARCHAR2,
127    X_ATTRIBUTE13 in VARCHAR2,
128    X_ATTRIBUTE14 in VARCHAR2,
129    X_ATTRIBUTE15 in VARCHAR2,
130    X_ATTRIBUTE_CATEGORY_CODE in VARCHAR2
131 , p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type) is
132   CURSOR C is
133       	SELECT method_id,
134                basic_rate,
135                adjusted_rate,
136                adjusting_rate,
137                attribute1,
138                attribute2,
139                attribute3,
140                attribute4,
141                attribute5,
142                attribute6,
143                attribute7,
144                attribute8,
145                attribute9,
146                attribute10,
147                attribute11,
148                attribute12,
149                attribute13,
150                attribute14,
151                attribute15,
152                attribute_category_code
153          FROM  fa_flat_rates
154          where  method_id = X_Method_Id
155          and    basic_rate = X_Basic_Rate
156          and    adjusted_rate = X_Adjusted_Rate
157 	 FOR UPDATE of method_id, basic_rate, adjusted_rate NOWAIT;
158    Recinfo C%ROWTYPE;
159 
160 begin
161 
162   OPEN C;
163   FETCH C INTO Recinfo;
164   if (C%NOTFOUND) then
165 	CLOSE C;
166 	FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
167 	APP_EXCEPTION.Raise_Exception;
168   end if;
169   CLOSE C;
170   if (
171 		(Recinfo.Method_ID = X_Method_ID)
172 	AND	(Recinfo.Basic_Rate = X_Basic_Rate)
173 	AND	(Recinfo.Adjusting_Rate = X_Adjusting_Rate)
174 	AND	(Recinfo.Adjusted_Rate = X_Adjusted_Rate)
175 	AND	((Recinfo.Attribute1 = X_Attribute1)
176 	    OR  ((Recinfo.Attribute1 IS NULL)
177 	    AND (X_Attribute1 IS NULL)))
178         AND     ((Recinfo.Attribute2 = X_Attribute2)
179             OR  ((Recinfo.Attribute2 IS NULL)
180             AND (X_Attribute2 IS NULL)))
181         AND     ((Recinfo.Attribute3 = X_Attribute3)
182             OR  ((Recinfo.Attribute3 IS NULL)
183             AND (X_Attribute3 IS NULL)))
184         AND     ((Recinfo.Attribute4 = X_Attribute4)
185             OR  ((Recinfo.Attribute4 IS NULL)
186             AND (X_Attribute4 IS NULL)))
187         AND     ((Recinfo.Attribute5 = X_Attribute5)
188             OR  ((Recinfo.Attribute5 IS NULL)
189             AND (X_Attribute5 IS NULL)))
190         AND     ((Recinfo.Attribute6 = X_Attribute6)
191             OR  ((Recinfo.Attribute6 IS NULL)
192             AND (X_Attribute6 IS NULL)))
193         AND     ((Recinfo.Attribute7 = X_Attribute7)
194             OR  ((Recinfo.Attribute7 IS NULL)
195             AND (X_Attribute7 IS NULL)))
196         AND     ((Recinfo.Attribute8 = X_Attribute8)
197             OR  ((Recinfo.Attribute8 IS NULL)
198             AND (X_Attribute8 IS NULL)))
199         AND     ((Recinfo.Attribute9 = X_Attribute9)
200             OR  ((Recinfo.Attribute9 IS NULL)
201             AND (X_Attribute9 IS NULL)))
202         AND     ((Recinfo.Attribute10 = X_Attribute10)
203             OR  ((Recinfo.Attribute10 IS NULL)
204             AND (X_Attribute10 IS NULL)))
205         AND     ((Recinfo.Attribute11 = X_Attribute11)
206             OR  ((Recinfo.Attribute11 IS NULL)
207             AND (X_Attribute11 IS NULL)))
208         AND     ((Recinfo.Attribute12 = X_Attribute12)
209             OR  ((Recinfo.Attribute12 IS NULL)
210             AND (X_Attribute12 IS NULL)))
211         AND     ((Recinfo.Attribute13 = X_Attribute13)
212             OR  ((Recinfo.Attribute13 IS NULL)
213             AND (X_Attribute13 IS NULL)))
214         AND     ((Recinfo.Attribute14 = X_Attribute14)
215             OR  ((Recinfo.Attribute14 IS NULL)
216             AND (X_Attribute14 IS NULL)))
217         AND     ((Recinfo.Attribute15 = X_Attribute15)
218             OR  ((Recinfo.Attribute15 IS NULL)
219             AND (X_Attribute15 IS NULL)))
220 	)   then
221 	    return;
222   else
223 	FND_MESSAGE.set_Name('FND', 'FORM_RECORD_CHANGED');
224 	APP_EXCEPTION.Raise_Exception;
225   end if;
226 
227 end LOCK_ROW;
228 
229 procedure UPDATE_ROW (
230    X_METHOD_ID in NUMBER,
231    X_BASIC_RATE in NUMBER,
232    X_ADJUSTED_RATE in NUMBER,
233    X_ADJUSTING_RATE in NUMBER,
234    X_ATTRIBUTE1 in VARCHAR2,
235    X_ATTRIBUTE2 in VARCHAR2,
236    X_ATTRIBUTE3 in VARCHAR2,
237    X_ATTRIBUTE4 in VARCHAR2,
238    X_ATTRIBUTE5 in VARCHAR2,
239    X_ATTRIBUTE6 in VARCHAR2,
240    X_ATTRIBUTE7 in VARCHAR2,
241    X_ATTRIBUTE8 in VARCHAR2,
242    X_ATTRIBUTE9 in VARCHAR2,
243    X_ATTRIBUTE10 in VARCHAR2,
244    X_ATTRIBUTE11 in VARCHAR2,
245    X_ATTRIBUTE12 in VARCHAR2,
246    X_ATTRIBUTE13 in VARCHAR2,
247    X_ATTRIBUTE14 in VARCHAR2,
248    X_ATTRIBUTE15 in VARCHAR2,
249    X_ATTRIBUTE_CATEGORY_CODE in VARCHAR2,
250    X_LAST_UPDATE_DATE in DATE,
251    X_LAST_UPDATED_BY in NUMBER,
252    X_LAST_UPDATE_LOGIN in NUMBER
253 , p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type) is
254 
255 begin
256 
257    UPDATE fa_flat_rates
258    SET  method_id		= X_Method_ID,
259 	basic_rate		= X_Basic_Rate,
260 	adjusted_rate		= X_Adjusted_Rate,
261 	adjusting_rate		= X_Adjusting_Rate,
262 	attribute1		= X_Attribute1,
263 	attribute2              = X_Attribute2,
264         attribute3              = X_Attribute3,
265         attribute4              = X_Attribute4,
266         attribute5              = X_Attribute5,
267         attribute6              = X_Attribute6,
268         attribute7              = X_Attribute7,
269         attribute8              = X_Attribute8,
270         attribute9              = X_Attribute9,
271         attribute10             = X_Attribute10,
272         attribute11             = X_Attribute11,
273         attribute12             = X_Attribute12,
274         attribute13             = X_Attribute13,
275         attribute14             = X_Attribute14,
276         attribute15             = X_Attribute15
277    where  method_id = X_Method_Id
278    and    basic_rate = X_Basic_Rate
279    and    adjusted_rate = X_Adjusted_Rate;
280 
281    if (SQL%NOTFOUND) then
282            Raise NO_DATA_FOUND;
283         end if;
284 
285 exception
286    when others then
287         fa_srvr_msg.add_sql_error(
288         calling_fn => 'fa_flat_rates_pkg.update_row',  p_log_level_rec => p_log_level_rec);
289    raise;
290 
291 end UPDATE_ROW;
292 
293 procedure DELETE_ROW (
294    X_METHOD_ID in NUMBER,
295    X_BASIC_RATE in NUMBER,
296    X_ADJUSTED_RATE in NUMBER
297 , p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type) is
298 
299 begin
300 
301    DELETE FROM fa_flat_rates
302    where  method_id = X_Method_Id
303    and    basic_rate = X_Basic_Rate
304    and    adjusted_rate = X_Adjusted_Rate;
305 
306    if (SQL%NOTFOUND) then
307            Raise NO_DATA_FOUND;
308         end if;
309 
310 exception
311    when others then
312         fa_srvr_msg.add_sql_error(
313         calling_fn => 'fa_flat_rates_pkg.delete_row', p_log_level_rec => p_log_level_rec);
314    raise;
315 
316 end DELETE_ROW;
317 
318 procedure LOAD_ROW (
319    X_METHOD_ID in NUMBER,
320    X_OWNER in VARCHAR2,
321    X_BASIC_RATE in NUMBER,
322    X_ADJUSTING_RATE in NUMBER,
323    X_ADJUSTED_RATE in NUMBER,
324    X_ATTRIBUTE1 in VARCHAR2,
325    X_ATTRIBUTE2 in VARCHAR2,
326    X_ATTRIBUTE3 in VARCHAR2,
327    X_ATTRIBUTE4 in VARCHAR2,
328    X_ATTRIBUTE5 in VARCHAR2,
329    X_ATTRIBUTE6 in VARCHAR2,
330    X_ATTRIBUTE7 in VARCHAR2,
331    X_ATTRIBUTE8 in VARCHAR2,
332    X_ATTRIBUTE9 in VARCHAR2,
333    X_ATTRIBUTE10 in VARCHAR2,
334    X_ATTRIBUTE11 in VARCHAR2,
335    X_ATTRIBUTE12 in VARCHAR2,
336    X_ATTRIBUTE13 in VARCHAR2,
337    X_ATTRIBUTE14 in VARCHAR2,
338    X_ATTRIBUTE15 in VARCHAR2,
339    X_ATTRIBUTE_CATEGORY_CODE in VARCHAR2
340 , p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type default null) is
341 
342    h_record_exists	number(15);
343 
344    user_id		number;
345    row_id		varchar2(64);
346 
347 begin
348 
349    if (X_Owner = 'SEED') then
350       user_id := 1;
351    else
352       user_id := 0;
353    end if;
354 
355    select count(*)
356    into   h_record_exists
357    from   fa_flat_rates fr
358    where  fr.method_id = X_Method_Id
359    and    fr.basic_rate = X_Basic_Rate
360    and    fr.adjusted_rate = X_Adjusted_Rate;
361 
362 if (h_record_exists > 0) then
363  fa_flat_rates_pkg.update_row (
364    X_Method_Id			=> X_Method_Id,
365    X_Basic_Rate			=> X_Basic_Rate,
366    X_Adjusted_Rate		=> X_Adjusted_Rate,
367    X_Adjusting_Rate		=> X_Adjusting_Rate,
368    X_Attribute1			=> X_Attribute1,
369    X_Attribute2                 => X_Attribute2,
370    X_Attribute3                 => X_Attribute3,
371    X_Attribute4                 => X_Attribute4,
372    X_Attribute5                 => X_Attribute5,
373    X_Attribute6                 => X_Attribute6,
374    X_Attribute7                 => X_Attribute7,
375    X_Attribute8                 => X_Attribute8,
376    X_Attribute9                 => X_Attribute9,
377    X_Attribute10                => X_Attribute10,
378    X_Attribute11                => X_Attribute11,
379    X_Attribute12                => X_Attribute12,
380    X_Attribute13                => X_Attribute13,
381    X_Attribute14                => X_Attribute14,
382    X_Attribute15                => X_Attribute15,
383    X_Attribute_Category_Code	=> X_Attribute_Category_Code,
384    X_Last_Update_Date		=> sysdate,
385    X_Last_Updated_By		=> user_id,
386    X_Last_Update_Login		=> 0
387  , p_log_level_rec => p_log_level_rec);
388 else
389  fa_flat_rates_pkg.insert_row (
390    X_Rowid			=> row_id,
391    X_Method_Id                  => X_Method_Id,
392    X_Basic_Rate                 => X_Basic_Rate,
393    X_Adjusted_Rate              => X_Adjusted_Rate,
394    X_Adjusting_Rate             => X_Adjusting_Rate,
395    X_Attribute1                 => X_Attribute1,
396    X_Attribute2                 => X_Attribute2,
397    X_Attribute3                 => X_Attribute3,
398    X_Attribute4                 => X_Attribute4,
399    X_Attribute5                 => X_Attribute5,
400    X_Attribute6                 => X_Attribute6,
401    X_Attribute7                 => X_Attribute7,
402    X_Attribute8                 => X_Attribute8,
403    X_Attribute9                 => X_Attribute9,
404    X_Attribute10                => X_Attribute10,
405    X_Attribute11                => X_Attribute11,
406    X_Attribute12                => X_Attribute12,
407    X_Attribute13                => X_Attribute13,
408    X_Attribute14                => X_Attribute14,
409    X_Attribute15                => X_Attribute15,
410    X_Attribute_Category_Code    => X_Attribute_Category_Code,
411    X_Creation_Date		=> sysdate,
412    X_Created_By			=> user_id,
413    X_Last_Update_Date           => sysdate,
414    X_Last_Updated_By            => user_id,
415    X_Last_Update_Login          => 0
416  , p_log_level_rec => p_log_level_rec);
417 end if;
418 
419 exception
420   when others then
421     FA_STANDARD_PKG.RAISE_ERROR(
422 		CALLED_FN => 'fa_flat_rates_pkg.load_row',
423 		CALLING_FN => 'upload fa_flat_rates', p_log_level_rec => p_log_level_rec);
424 
425 end LOAD_ROW;
426 /*Bug 8355119 overloading function for release specific signatures*/
427 procedure LOAD_ROW (
428    X_CUSTOM_MODE in VARCHAR2,
429    X_METHOD_ID in NUMBER,
430    X_DB_LAST_UPDATED_BY NUMBER,
431    X_DB_LAST_UPDATE_DATE DATE,
432    X_OWNER in VARCHAR2,
433    X_LAST_UPDATE_DATE in DATE,
434    X_BASIC_RATE in NUMBER,
435    X_ADJUSTING_RATE in NUMBER,
436    X_ADJUSTED_RATE in NUMBER,
437    X_ATTRIBUTE1 in VARCHAR2,
438    X_ATTRIBUTE2 in VARCHAR2,
439    X_ATTRIBUTE3 in VARCHAR2,
440    X_ATTRIBUTE4 in VARCHAR2,
441    X_ATTRIBUTE5 in VARCHAR2,
442    X_ATTRIBUTE6 in VARCHAR2,
443    X_ATTRIBUTE7 in VARCHAR2,
444    X_ATTRIBUTE8 in VARCHAR2,
445    X_ATTRIBUTE9 in VARCHAR2,
446    X_ATTRIBUTE10 in VARCHAR2,
447    X_ATTRIBUTE11 in VARCHAR2,
448    X_ATTRIBUTE12 in VARCHAR2,
449    X_ATTRIBUTE13 in VARCHAR2,
450    X_ATTRIBUTE14 in VARCHAR2,
451    X_ATTRIBUTE15 in VARCHAR2,
452    X_ATTRIBUTE_CATEGORY_CODE in VARCHAR2,
453    p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type default null) is
454 
455    h_record_exists	number(15);
456 
457    user_id		number;
458    row_id		varchar2(64);
459 
460 begin
461 
462    user_id := fnd_load_util.owner_id (X_Owner);
463 
464    select count(*)
465    into   h_record_exists
466    from   fa_flat_rates fr
467    where  fr.method_id = X_Method_Id
468    and    fr.basic_rate = X_Basic_Rate
469    and    fr.adjusted_rate = X_Adjusted_Rate;
470 
471    if (h_record_exists > 0) then
472       if (fnd_load_util.upload_test(user_id, x_last_update_date,
473                                     x_db_last_updated_by,x_db_last_update_date,
474                                     X_CUSTOM_MODE )) then
475 
476          fa_flat_rates_pkg.update_row (
477             X_Method_Id	                 => X_Method_Id,
478             X_Basic_Rate                 => X_Basic_Rate,
479             X_Adjusted_Rate              => X_Adjusted_Rate,
480             X_Adjusting_Rate             => X_Adjusting_Rate,
481             X_Attribute1                 => X_Attribute1,
482             X_Attribute2                 => X_Attribute2,
483             X_Attribute3                 => X_Attribute3,
484             X_Attribute4                 => X_Attribute4,
485             X_Attribute5                 => X_Attribute5,
486             X_Attribute6                 => X_Attribute6,
487             X_Attribute7                 => X_Attribute7,
488             X_Attribute8                 => X_Attribute8,
489             X_Attribute9                 => X_Attribute9,
490             X_Attribute10                => X_Attribute10,
491             X_Attribute11                => X_Attribute11,
492             X_Attribute12                => X_Attribute12,
493             X_Attribute13                => X_Attribute13,
494             X_Attribute14                => X_Attribute14,
495             X_Attribute15                => X_Attribute15,
496             X_Attribute_Category_Code    => X_Attribute_Category_Code,
497             X_Last_Update_Date	         => sysdate,
498             X_Last_Updated_By	         => user_id,
499             X_Last_Update_Login	         => 0
500             ,p_log_level_rec => p_log_level_rec);
501       end if;
502 
503    else
504 
505       fa_flat_rates_pkg.insert_row (
506          X_Rowid		      => row_id,
507          X_Method_Id                  => X_Method_Id,
508          X_Basic_Rate                 => X_Basic_Rate,
509          X_Adjusted_Rate              => X_Adjusted_Rate,
510          X_Adjusting_Rate             => X_Adjusting_Rate,
511          X_Attribute1                 => X_Attribute1,
512          X_Attribute2                 => X_Attribute2,
513          X_Attribute3                 => X_Attribute3,
514          X_Attribute4                 => X_Attribute4,
515          X_Attribute5                 => X_Attribute5,
516          X_Attribute6                 => X_Attribute6,
517          X_Attribute7                 => X_Attribute7,
518          X_Attribute8                 => X_Attribute8,
519          X_Attribute9                 => X_Attribute9,
520          X_Attribute10                => X_Attribute10,
521          X_Attribute11                => X_Attribute11,
522          X_Attribute12                => X_Attribute12,
523          X_Attribute13                => X_Attribute13,
524          X_Attribute14                => X_Attribute14,
525          X_Attribute15                => X_Attribute15,
526          X_Attribute_Category_Code    => X_Attribute_Category_Code,
527          X_Creation_Date	      => sysdate,
528          X_Created_By		      => user_id,
529          X_Last_Update_Date           => sysdate,
530          X_Last_Updated_By            => user_id,
531          X_Last_Update_Login          => 0
532          ,p_log_level_rec => p_log_level_rec);
533    end if;
534 
535 exception
536   when others then
537     FA_STANDARD_PKG.RAISE_ERROR(
538 		CALLED_FN => 'fa_flat_rates_pkg.load_row',
539 		CALLING_FN => 'upload fa_flat_rates'
540 		,p_log_level_rec => p_log_level_rec);
541 
542 end LOAD_ROW;
543 
544 /*bug 8355119 adding R12 specific funtion LOAD_SEED_ROW*/
545 procedure LOAD_SEED_ROW (
546                x_upload_mode             IN VARCHAR2,
547                x_custom_mode             IN VARCHAR2,
548                x_method_code             IN VARCHAR2,
549                x_life_in_months          IN NUMBER,
550                x_owner                   IN VARCHAR2,
551                x_last_update_date        IN DATE,
552                x_basic_rate              IN NUMBER,
553                x_adjusting_rate          IN NUMBER,
554                x_adjusted_rate           IN NUMBER,
555                x_attribute1              IN VARCHAR2,
556                x_attribute2              IN VARCHAR2,
557                x_attribute3              IN VARCHAR2,
558                x_attribute4              IN VARCHAR2,
559                x_attribute5              IN VARCHAR2,
560                x_attribute6              IN VARCHAR2,
561                x_attribute7              IN VARCHAR2,
562                x_attribute8              IN VARCHAR2,
563                x_attribute9              IN VARCHAR2,
564                x_attribute10             IN VARCHAR2,
565                x_attribute11             IN VARCHAR2,
566                x_attribute12             IN VARCHAR2,
567                x_attribute13             IN VARCHAR2,
568                x_attribute14             IN VARCHAR2,
569                x_attribute15             IN VARCHAR2,
570                x_attribute_category_code IN VARCHAR2
571                ,p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type default null) IS
572 
573    methods_err           exception;
574    h_method_id           number(15);
575    h_last_update_date    date;
576    h_last_updated_by     number;
577 
578    h_depr_last_year_flag boolean;
579    h_rate_source_rule    varchar2(10);
580    h_deprn_basis_rule    varchar2(4);
581    h_excl_sal_val_flag   boolean;
582 
583 BEGIN
584 
585    if (x_upload_mode = 'NLS') then
586       null;
587    else
588 
589       if not fa_cache_pkg.fazccmt (
590          X_method                => x_method_code,
591          X_life                  => x_life_in_months
592          ,p_log_level_rec => p_log_level_rec) then
593          raise methods_err;
594       end if;
595 
596       h_method_id        := fa_cache_pkg.fazccmt_record.method_id;
597       h_last_update_date := fa_cache_pkg.fazccmt_record.last_update_date;
598       h_last_updated_by := fa_cache_pkg.fazccmt_record.last_updated_by;
599       h_rate_source_rule := fa_cache_pkg.fazccmt_record.rate_source_rule;
600       h_deprn_basis_rule := fa_cache_pkg.fazccmt_record.deprn_basis_rule;
601 
602       if fa_cache_pkg.fazccmt_record.exclude_salvage_value_flag = 'YES' then
603          h_excl_sal_val_flag := TRUE;
604       else
605          h_excl_sal_val_flag := FALSE;
606       end if;
607 
608       if fa_cache_pkg.fazccmt_record.depreciate_lastyear_flag = 'YES' then
609          h_depr_last_year_flag := TRUE;
610       else
611          h_depr_last_year_flag := FALSE;
612       end if;
613 
614       fa_flat_rates_pkg.LOAD_ROW (
615                x_custom_mode             => x_custom_mode,
616                x_method_id               => h_method_id,
617                x_db_last_update_date     => h_last_update_date,
618                x_db_last_updated_by      => h_last_updated_by,
619                x_owner                   => x_owner,
620                x_last_update_date        => x_last_update_date,
621                x_basic_rate              => x_basic_rate,
622                x_adjusting_rate          => x_adjusting_rate,
623                x_adjusted_rate           => x_adjusted_rate,
624                x_attribute1              => x_attribute1,
625                x_attribute2              => x_attribute2,
626                x_attribute3              => x_attribute3,
627                x_attribute4              => x_attribute4,
628                x_attribute5              => x_attribute5,
629                x_attribute6              => x_attribute6,
630                x_attribute7              => x_attribute7,
631                x_attribute8              => x_attribute8,
632                x_attribute9              => x_attribute9,
633                x_attribute10             => x_attribute10,
634                x_attribute11             => x_attribute11,
635                x_attribute12             => x_attribute12,
636                x_attribute13             => x_attribute13,
637                x_attribute14             => x_attribute14,
638                x_attribute15             => x_attribute15,
639                x_attribute_category_code => x_attribute_category_code
640                ,p_log_level_rec => p_log_level_rec);
641 
642    end if;
643 
644 EXCEPTION
645    WHEN methods_err THEN
646       fa_srvr_msg.add_sql_error(
647          calling_fn => 'updating flat_rates'
648          ,p_log_level_rec => p_log_level_rec);
649 
650       fa_standard_pkg.raise_error(
651          called_fn => 'farat.lct',
652          calling_fn => 'fa_flat_rates_pkg.load_seed_row'
653          ,p_log_level_rec => p_log_level_rec);
654 
655 END LOAD_SEED_ROW;
656 
657 END FA_FLAT_RATES_PKG;