DBA Data[Home] [Help]

PACKAGE BODY: APPS.FA_TAX_RSV_ADJ_PUB

Source


1 PACKAGE BODY FA_TAX_RSV_ADJ_PUB as
2 /* $Header: FAPTRSVB.pls 120.10 2009/04/15 14:18:33 bridgway ship $   */
3 
4 --*********************** Global constants ******************************--
5 
6 G_PKG_NAME      CONSTANT   varchar2(30) := 'FA_TAX_RSV_ADJ_PUB';
7 G_API_NAME      CONSTANT   varchar2(30) := 'Tax Reserve Adjustment API';
8 G_API_VERSION   CONSTANT   number       := 1.0;
9 
10 --*********************** Private functions ******************************--
11 
12 -- private declaration for books (mrc) wrapper
13 
14 g_log_level_rec            fa_api_types.log_level_rec_type;
15 g_cip_cost    number  := 0;
16 g_cost        number  := 0;
17 
18 FUNCTION do_all_books
19    (px_trans_rec            IN OUT NOCOPY FA_API_TYPES.trans_rec_type,
20     px_asset_hdr_rec        IN OUT NOCOPY FA_API_TYPES.asset_hdr_rec_type,
21     p_asset_desc_rec        IN     FA_API_TYPES.asset_desc_rec_type,
22     p_asset_type_rec        IN     FA_API_TYPES.asset_type_rec_type,
23     p_asset_cat_rec         IN     FA_API_TYPES.asset_cat_rec_type,
24     p_asset_tax_rsv_adj_rec IN     FA_API_TYPES.asset_tax_rsv_adj_rec_type,
25     p_calling_fn            IN     VARCHAR2
26    ,p_log_level_rec           IN     FA_API_TYPES.log_level_rec_type default null) RETURN BOOLEAN;
27 
28 
29 FUNCTION is_amortized
30 	(p_asset_id	    IN  fa_books.asset_id%type,
31 	 p_book		    IN  fa_book_controls.book_type_code%type,
32 	 p_period_counter   IN  number,
33 	 x_is_amortized	    OUT NOCOPY boolean
34 	,p_log_level_rec           IN     FA_API_TYPES.log_level_rec_type default null) RETURN BOOLEAN;
35 
36 
37 --*********************** Public procedures *****************************--
38 
39 PROCEDURE do_tax_rsv_adj
40    (p_api_version              IN     NUMBER,
41     p_init_msg_list            IN     VARCHAR2 := FND_API.G_FALSE,
42     p_commit                   IN     VARCHAR2 := FND_API.G_FALSE,
43     p_validation_level         IN     NUMBER   := FND_API.G_VALID_LEVEL_FULL,
44     p_calling_fn               IN     VARCHAR2,
45     x_return_status               OUT NOCOPY VARCHAR2,
46     x_msg_count                   OUT NOCOPY NUMBER,
47     x_msg_data                    OUT NOCOPY VARCHAR2,
48 
49     px_trans_rec               IN OUT NOCOPY FA_API_TYPES.trans_rec_type,
50     px_asset_hdr_rec           IN OUT NOCOPY FA_API_TYPES.asset_hdr_rec_type,
51     p_asset_tax_rsv_adj_rec    IN     FA_API_TYPES.asset_tax_rsv_adj_rec_type)
52 IS
53 
54    l_asset_type_rec         FA_API_TYPES.asset_type_rec_type;
55    l_asset_desc_rec         FA_API_TYPES.asset_desc_rec_type;
56    l_asset_cat_rec          FA_API_TYPES.asset_cat_rec_type;
57    l_asset_tax_rsv_adj_rec  FA_API_TYPES.asset_tax_rsv_adj_rec_type;
58 
59    x_is_amortized           Boolean;
60    l_fully_rsv              Boolean;
61 
62    l_reporting_flag         varchar2(1);
63    l_count                   number;
64 
65    l_calling_fn             VARCHAR2(35) := 'fa_tax_rsv_adj_pub.do_tax_rsv_adj';
66    tax_rsv_adj_err          EXCEPTION;
67 
68 
69 -- fin_info   fa_std_types.fin_info_struct;
70 
71 BEGIN
72 
73    SAVEPOINT do_tax_rsv_adj;
74    if (not g_log_level_rec.initialized) then
75       if (NOT fa_util_pub.get_log_level_rec (
76                 x_log_level_rec =>  g_log_level_rec
77       )) then
78          raise tax_rsv_adj_err;
79       end if;
80    end if;
81 
82    -- Initialize message list if p_init_msg_list is set to TRUE.
83 
84 --   if (fnd_api.to_boolean(p_init_msg_list)) then
85 
86        -- initialize error message stack.
87        fa_srvr_msg.init_server_message;
88 
89        -- initialize debug message stack.
90        fa_debug_pkg.initialize;
91 --   end if;
92 
93    -- Check version of the API
94    -- Standard call to check for API call compatibility.
95 
96    if NOT fnd_api.compatible_api_call (
97           G_API_VERSION,
98           p_api_version,
99           G_API_NAME,
100           G_PKG_NAME) then
101       x_return_status := FND_API.G_RET_STS_ERROR;
102       raise tax_rsv_adj_err;
103    end if;
104 
105    -- call the cache for the primary transaction book
106 
107    if NOT fa_cache_pkg.fazcbc(X_book => px_asset_hdr_rec.book_type_code,
108                               p_log_level_rec => g_log_level_rec) then
109     	raise tax_rsv_adj_err;
110    end if;
111 
112    px_asset_hdr_rec.set_of_books_id := fa_cache_pkg.fazcbc_record.set_of_books_id;
113 
114    -- verify the asset exist in the book already
115 
116    if not FA_ASSET_VAL_PVT.validate_asset_book
117          (p_transaction_type_code      => 'ADJUSTMENT',
118           p_book_type_code             => px_asset_hdr_rec.book_type_code,
119           p_asset_id                   => px_asset_hdr_rec.asset_id,
120           p_calling_fn                 => l_calling_fn,
121           p_log_level_rec              => g_log_level_rec) then
122       raise tax_rsv_adj_err;
123    end if;
124 
125    -- Account for transaction submitted from a responsibility
126    -- that is not tied to a SOB_ID by getting the value from
127    -- the book struct
128 
129    -- Get the book type code P,R or N
130 
131    if not fa_cache_pkg.fazcsob
132          (X_set_of_books_id   => px_asset_hdr_rec.set_of_books_id,
133           X_mrc_sob_type_code => l_reporting_flag,
134           p_log_level_rec     => g_log_level_rec) then
135       raise tax_rsv_adj_err;
136    end if;
137 
138    --  Error out if the program is submitted from the Reporting Responsibility
139    --  No transaction permitted directly on reporting books.
140 
141    if l_reporting_flag = 'R' then
142       fa_srvr_msg.add_message(calling_fn => l_calling_fn,name => 'MRC_OSP_INVALID_BOOK_TYPE',
143                               p_log_level_rec => g_log_level_rec);
144       raise tax_rsv_adj_err;
145    end if;
146 
147    -- end initial MRC validation
148 
149 
150    -- load cache fazcbc.
151 
152    if not fa_cache_pkg.fazcbc(X_book => px_asset_hdr_rec.book_type_code,
153                               p_log_level_rec => g_log_level_rec) then
154       raise tax_rsv_adj_err;
155    end if;
156    if fa_cache_pkg.fazcbc_record.allow_deprn_adjustments = 'NO' then
157       -- Bug 5472772 Added fa_srvr_msg call
158       fa_srvr_msg.add_message
159           (calling_fn => l_calling_fn,
160            name       => 'FA_ADJ_RSV_ADJ_NOT_ALLOWED'
161            ,p_log_level_rec => g_log_level_rec);
162       raise tax_rsv_adj_err;
163    end if;
164 
165    --  pop the structs for the non-fin information needed for trx
166 
167    if not FA_UTIL_PVT.get_asset_type_rec
168           (p_asset_hdr_rec         => px_asset_hdr_rec,
169            px_asset_type_rec       => l_asset_type_rec,
170            p_date_effective        => null,
171            p_log_level_rec         => g_log_level_rec) then
172       raise tax_rsv_adj_err;
173    end if;
174 
175    if not FA_UTIL_PVT.get_asset_desc_rec
176           (p_asset_hdr_rec         => px_asset_hdr_rec,
177            px_asset_desc_rec       => l_asset_desc_rec,
178            p_log_level_rec         => g_log_level_rec) then
179       raise tax_rsv_adj_err;
180    end if;
181 
182    if not FA_UTIL_PVT.get_asset_cat_rec
183          (p_asset_hdr_rec         => px_asset_hdr_rec,
184           px_asset_cat_rec        => l_asset_cat_rec,
185           p_date_effective        => null,
186           p_log_level_rec         => g_log_level_rec) then
187       raise tax_rsv_adj_err;
188    end if;
189 
190    -- end of pop structs
191 
192    -- Allow if Tax Book
193 
194    if not fa_cache_pkg.fazcbc_record.book_class = 'TAX' then
195       -- Bug 5472772 Added fa_srvr_msg call
196       fa_srvr_msg.add_message
197           (calling_fn => l_calling_fn,
198            name       => 'FA_ADJ_TAX_BOOK'
199            ,p_log_level_rec => g_log_level_rec);
200       raise tax_rsv_adj_err;
201    end if;
202 
203    -- Check if Group Asset if 'Yes' raise error.
204 
205    if l_asset_type_rec.asset_type = 'GROUP' then
206       -- Bug 5472772 Added fa_srvr_msg call
207       fa_srvr_msg.add_message
208           (calling_fn => l_calling_fn,
209            name       => 'FA_PROD_ASSET_NOT_CAPITALIZED'
210            ,p_log_level_rec => g_log_level_rec);
211       raise tax_rsv_adj_err;
212    end if;
213 
214 
215    -- CIP assets should not have reserve adjustments
216 
217    if l_asset_type_rec.asset_type = 'CIP' then
218       -- Bug 5472772 Added fa_srvr_msg call
219       fa_srvr_msg.add_message
220           (calling_fn => l_calling_fn,
221            name       => 'FA_TAX_ASSET_IS_CIP'
222            ,p_log_level_rec => g_log_level_rec);
223       raise tax_rsv_adj_err;
224    end if;
225 
226    -- Check for Tax book, Allow Deprn Adjustment is allowed.
227 
228    if fa_cache_pkg.fazcbc_record.allow_deprn_adjustments = 'NO' then
229       -- Bug 5472772 Added fa_srvr_msg call
230       fa_srvr_msg.add_message
231           (calling_fn => l_calling_fn,
232            name       => 'FA_ADJ_RSV_ADJ_NOT_ALLOWED'
233            ,p_log_level_rec => g_log_level_rec);
234       raise tax_rsv_adj_err;
235    end if;
236 
237    l_asset_tax_rsv_adj_rec := p_asset_tax_rsv_adj_rec;
238 
239 
240    -- Find the first period adjusted
241    SELECT MAX(DP.PERIOD_COUNTER),
242           MIN(DP.PERIOD_COUNTER)
243    INTO   l_asset_tax_rsv_adj_rec.max_period_ctr_adjusted,
244           l_asset_tax_rsv_adj_rec.min_period_ctr_adjusted
245    FROM   FA_DEPRN_PERIODS DP
246    WHERE  DP.BOOK_TYPE_CODE = px_asset_hdr_rec.book_type_code
247    AND    DP.FISCAL_YEAR = l_asset_tax_rsv_adj_rec.fiscal_year;
248 
249 
250    /*  Check if amortized transaction was done between the
251     *  period adjusted and the current open period, if so
252     *  return error */
253 
254    If not is_amortized( px_asset_hdr_rec.asset_id
255                    ,px_asset_hdr_rec.book_type_code
256                    ,l_asset_tax_rsv_adj_rec.max_period_ctr_adjusted
257                    ,x_is_amortized
258                    ,p_log_level_rec => g_log_level_rec) then
259       -- Bug 5472772 Added fa_srvr_msg call
260       fa_srvr_msg.add_message
261           (calling_fn => l_calling_fn,
262            name       => 'FA_ADJ_RSV_ADJ_NOT_ALLOWED'
263            ,p_log_level_rec => g_log_level_rec);
264       raise tax_rsv_adj_err;
265    end if;
266 
267 
268 
269    -- check if impairment has been in the current fiscal year. if so error
270    SELECT count(*)
271    into   l_count
272    from   fa_transaction_headers th,
273           fa_deprn_periods dp,
274           fa_book_controls bc
275    where  th.asset_id = px_asset_hdr_rec.asset_id
276    and    th.book_type_code = px_asset_hdr_rec.book_type_code
277    and    th.transaction_key = 'IM'
278    and    th.date_effective > dp.period_open_date
279    and    dp.book_type_code = th.book_type_code
280    and    dp.period_num = 1
281    and    bc.book_type_code = th.book_type_code
282    and    bc.current_fiscal_year = dp.fiscal_year
283    and    bc.book_type_code = dp.book_type_code;
284 
285    if l_count <> 0 then
286       fa_srvr_msg.add_message
287           (calling_fn => l_calling_fn,
288            name       => 'FA_SHARED_OTHER_TRX_FOLLOW'
289            ,p_log_level_rec => g_log_level_rec);
290       raise tax_rsv_adj_err;
291    end if;
292 
293 
294    -- also check if this is the period of addition - use absolute mode for adjustments
295    -- we will only clear cost outside period of addition
296    if not FA_ASSET_VAL_PVT.validate_period_of_addition
297          (p_asset_id            => px_asset_hdr_rec.asset_id,
298           p_book                => px_asset_hdr_rec.book_type_code,
299           p_mode                => 'ABSOLUTE',
300           px_period_of_addition => px_asset_hdr_rec.period_of_addition,
301           p_log_level_rec       => g_log_level_rec) then
302       raise tax_rsv_adj_err;
303    end if;
304 
305    px_trans_rec.transaction_type_code := 'TAX';
306 
307    -- Call do_all_books;
308    -- call the mrc wrapper for the transaction book
309 
310    if not do_all_books
311          (px_trans_rec                => px_trans_rec,
312           px_asset_hdr_rec            => px_asset_hdr_rec ,
313           p_asset_desc_rec            => l_asset_desc_rec ,
314           p_asset_type_rec            => l_asset_type_rec ,
315           p_asset_cat_rec             => l_asset_cat_rec ,
316           p_asset_tax_rsv_adj_rec     => l_asset_tax_rsv_adj_rec,
317           p_calling_fn                => l_calling_fn,
318           p_log_level_rec             => g_log_level_rec)then
319       raise tax_rsv_adj_err;
320    end if;
321 
322 
323    -- commit if p_commit is TRUE.
324    if (fnd_api.to_boolean (p_commit)) then
325         COMMIT WORK;
326    end if;
327 
328    -- Bug 5472772
329    -- Standard call to get message count and if count is 1 get message info.
330    fnd_msg_pub.count_and_get (
331       p_count   => x_msg_count,
332       p_data    => x_msg_data
333    );
334 
335    x_return_status := FND_API.G_RET_STS_SUCCESS;
336 
337 EXCEPTION
338 
339    when tax_rsv_adj_err then
340 
341       ROLLBACK TO do_tax_rsv_adj;
342 
343       fa_srvr_msg.add_message(calling_fn => l_calling_fn,
344                               p_log_level_rec => g_log_level_rec);
345 
346       -- Bug 5472772
347       -- Standard call to get message count and if count is 1 get message info.
348       FND_MSG_PUB.count_and_get (
349          p_count => x_msg_count,
350          p_data  => x_msg_data
351       );
352 
353       x_return_status :=  FND_API.G_RET_STS_ERROR;
354 
355    when others then
356       ROLLBACK TO do_tax_rsv_adj;
357 
358       fa_srvr_msg.add_sql_error(
359               calling_fn => l_calling_fn,
360               p_log_level_rec => g_log_level_rec);
361 
362       -- Bug 5472772
363       -- Standard call to get message count and if count is 1 get message info.
364       FND_MSG_PUB.count_and_get (
365          p_count => x_msg_count,
366          p_data  => x_msg_data
367       );
368 
369       x_return_status :=  FND_API.G_RET_STS_ERROR;
370 
371 
372 END do_tax_rsv_adj;
373 
374 FUNCTION is_amortized
375    ( p_asset_id		IN         fa_books.asset_id%type
376     ,p_book		IN         fa_book_controls.book_type_code%type
377     ,p_period_counter   IN         number
378     ,x_is_amortized	OUT NOCOPY boolean
379     ,p_log_level_rec    IN         FA_API_TYPES.log_level_rec_type default null) RETURN BOOLEAN is
380 
381    Cursor c_amort is
382    SELECT 1
383    FROM  FA_TRANSACTION_HEADERS TH, FA_DEPRN_PERIODS DP
384    WHERE TH.ASSET_ID = p_asset_id
385    AND   TH.BOOK_TYPE_CODE = p_book
386    AND   TH.TRANSACTION_SUBTYPE = 'AMORTIZED'
387    AND   DP.PERIOD_COUNTER = p_period_counter
388    AND   DP.BOOK_TYPE_CODE = p_book
389    AND   DP.PERIOD_CLOSE_DATE < TH.DATE_EFFECTIVE;
390 
391 
392    l_temp number := 0;
393 
394 BEGIN
395  open c_amort;
396  fetch c_amort into l_temp;
397  close c_amort;
398 if l_temp = 1 then
399 	X_is_amortized := TRUE;
400 else
401 	X_is_amortized := FALSE;
402 end if;
403 return (TRUE);
404 
405 EXCEPTION
406    when no_data_found then
407         X_is_amortized := FALSE;
408 	  return (TRUE);
409 
410    when others then
411    	  fa_srvr_msg.add_sql_error (calling_fn => 'fa_txrsv_pkg.fautca',
412    	     	                     p_log_level_rec => p_log_level_rec);
413 	  return (FALSE);
414 
415 END is_amortized;
416 
417 -----------------------------------------------------------------------------
418 
419 -- Books (MRC) Wrapper - called from public API above
420 --
421 -- For non mrc books, this just calls the private API with provided params
422 -- For MRC, it processes the primary and then loops through each reporting
423 -- book calling the private api for each.
424 
425 FUNCTION do_all_books
426    (px_trans_rec            IN OUT NOCOPY FA_API_TYPES.trans_rec_type,
427     px_asset_hdr_rec        IN OUT NOCOPY FA_API_TYPES.asset_hdr_rec_type,
428     p_asset_desc_rec        IN     FA_API_TYPES.asset_desc_rec_type,
429     p_asset_type_rec        IN     FA_API_TYPES.asset_type_rec_type,
430     p_asset_cat_rec         IN     FA_API_TYPES.asset_cat_rec_type,
431     p_asset_tax_rsv_adj_rec IN     FA_API_TYPES.asset_tax_rsv_adj_rec_type,
432     p_calling_fn            IN     VARCHAR2,
433     p_log_level_rec           IN     FA_API_TYPES.log_level_rec_type default null) RETURN BOOLEAN IS
434 
435    l_asset_hdr_rec_mrc      FA_API_TYPES.asset_hdr_rec_type;
436    l_asset_fin_rec          FA_API_TYPES.asset_fin_rec_type;
437    l_period_rec             FA_API_TYPES.period_rec_type;
438 
439    l_transaction_date       date;
440    l_fully_rsv              boolean;
441    l_sob_tbl                FA_CACHE_PKG.fazcrsob_sob_tbl_type;
442 
443    l_reporting_flag         varchar2(1);
444    l_exchange_rate          number;
445    l_avg_rate               number;
446 
447    l_calling_fn             varchar2(35) := 'fa_tax_rsv_adj_pub.do_all_books';
448    tax_rsv_adj_err          EXCEPTION;
449 
450 BEGIN
451 
452 /* Bug 4597471 -- only for 'RUN' mode */
453     if (p_asset_tax_rsv_adj_rec.run_mode = 'RUN') then
454        if not FA_TRX_APPROVAL_PKG.faxcat
455              (X_book              => px_asset_hdr_rec.book_type_code,
456               X_asset_id          => px_asset_hdr_rec.asset_id,
457               X_trx_type          => px_trans_rec.transaction_type_code,
458               X_trx_date          => px_trans_rec.transaction_date_entered,
459               X_init_message_flag => 'NO',
460               p_log_level_rec     => p_log_level_rec) then
461           raise tax_rsv_adj_err;
462        end if;
463     end if;
464 
465 
466    -- load the period struct for current period info
467 
468    if not FA_UTIL_PVT.get_period_rec
469           (p_book           => px_asset_hdr_rec.book_type_code,
470            p_effective_date => NULL,
471            x_period_rec     => l_period_rec,
472            p_log_level_rec  => p_log_level_rec) then
473       raise tax_rsv_adj_err;
474    end if;
475 
476    -- load the struct asset_fin_rec.
477 
478    if not FA_UTIL_PVT.get_asset_fin_rec
479          (p_asset_hdr_rec         => px_asset_hdr_rec,
480           px_asset_fin_rec        => l_asset_fin_rec,
481           p_transaction_header_id => NULL,
482           p_mrc_sob_type_code     => l_reporting_flag,
483           p_log_level_rec         => p_log_level_rec) then
484       raise tax_rsv_adj_err;
485    end if;
486 
487    -- verify asset is not fully retired
488    if fa_asset_val_pvt.validate_fully_retired
489           (p_asset_id          => px_asset_hdr_rec.asset_id,
490            p_book              => px_asset_hdr_rec.book_type_code,
491            p_log_level_rec     => p_log_level_rec) then
492       fa_srvr_msg.add_message
493           (name      => 'FA_REC_RETIRED',
494            calling_fn => l_calling_fn,
495            p_log_level_rec => p_log_level_rec);
496       raise tax_rsv_adj_err;
497    end if;
498 
499    -- call the sob cache to get the table of sob_ids
500 
501         if not FA_CACHE_PKG.fazcrsob
502              (x_book_type_code => px_asset_hdr_rec.book_type_code,
503               x_sob_tbl        => l_sob_tbl,
504               p_log_level_rec  => p_log_level_rec) then
505            raise tax_rsv_adj_err;
506         end if;
507 
508         -- MVK : Other validation is for the POLISH .
509 
510 
511         -- set up the local asset_header and sob_id for mrc.
512 
513         l_asset_hdr_rec_mrc := px_asset_hdr_rec;
514 
515      /* Bug 4597471 -- only for RUN mode we need to call the reporting books
516         for preview mode we need only the primary (else part) */
517 
518      if ( p_asset_tax_rsv_adj_rec.run_mode = 'RUN') then
519 
520         -- loop through each book starting with the primary and
521         -- call the private API for each
522 
523         FOR l_sob_index in 0..l_sob_tbl.count LOOP
524            if (l_sob_index = 0) then
525              l_reporting_flag := 'P';
526              l_transaction_date := greatest(l_period_rec.calendar_period_open_date,
527                                           least(sysdate,l_period_rec.calendar_period_close_date));
528              px_trans_rec.transaction_date_entered :=
529                 to_date(to_char(l_transaction_date, 'DD/MM/YYYY'),'DD/MM/YYYY');
530 
531              l_exchange_rate := 1;
532              l_avg_rate      := 1;
533 
534           else
535             l_reporting_flag := 'R';
536             l_asset_hdr_rec_mrc.set_of_books_id := l_sob_tbl(l_sob_index);
537           end if;
538 
539 	 -- Call the private api ... FA_TAX_RSV_ADJ_PVT.do_tax_rsv_adj;
540 
541           /* Bug 4597471 -- changed the signature of FA_TAX_RSV_ADJ_PVT.do_tax_rsv_adj to include the the reporting flag */
542 
543           if not FA_TAX_RSV_ADJ_PVT.do_tax_rsv_adj
544              (px_trans_rec            => px_trans_rec,
545               px_asset_hdr_rec        => l_asset_hdr_rec_mrc,
546               p_asset_desc_rec        => p_asset_desc_rec,
547               p_asset_type_rec        => p_asset_type_rec,
548               p_asset_cat_rec         => p_asset_cat_rec,
549               px_asset_fin_rec        => l_asset_fin_rec,
550               p_asset_tax_rsv_adj_rec => p_asset_tax_rsv_adj_rec,
551               p_mrc_sob_type_code     => l_reporting_flag,
552               p_calling_fn            => l_calling_fn,
553               p_log_level_rec         => p_log_level_rec) then
554                   raise tax_rsv_adj_err;
555            end if;
556 
557         End Loop;
558      else
559           /* Bug 4597471 -- only Primary book in the case of PREVIEW mode */
560 
561           l_reporting_flag := 'P';
562           l_transaction_date := greatest(l_period_rec.calendar_period_open_date,
563                                           least(sysdate,l_period_rec.calendar_period_close_date));
564           px_trans_rec.transaction_date_entered :=
565                 to_date(to_char(l_transaction_date, 'DD/MM/YYYY'),'DD/MM/YYYY');
566 
567           if not FA_TAX_RSV_ADJ_PVT.do_tax_rsv_adj
568              (px_trans_rec            => px_trans_rec,
569               px_asset_hdr_rec        => l_asset_hdr_rec_mrc,
570               p_asset_desc_rec        => p_asset_desc_rec,
571               p_asset_type_rec        => p_asset_type_rec,
572               p_asset_cat_rec         => p_asset_cat_rec,
573               px_asset_fin_rec        => l_asset_fin_rec,
574               p_asset_tax_rsv_adj_rec => p_asset_tax_rsv_adj_rec,
575               p_mrc_sob_type_code     => l_reporting_flag,
576               p_calling_fn            => l_calling_fn,
577               p_log_level_rec         => p_log_level_rec) then
578                   raise tax_rsv_adj_err;
579            end if;
580      end if; --- RUN mode checking
581 
582 return (TRUE);
583 EXCEPTION
584 
585    WHEN TAX_RSV_ADJ_ERR THEN
586       fa_srvr_msg.add_message(calling_fn => l_calling_fn,
587                               p_log_level_rec => p_log_level_rec);
588       return FALSE;
589 
590    WHEN OTHERS THEN
591       fa_srvr_msg.add_sql_error(calling_fn => l_calling_fn,
592                                 p_log_level_rec => p_log_level_rec);
593       return FALSE;
594 
595 End do_all_books;
596 
597 -----------------------------------------------------------------------------
598 
599 END FA_TAX_RSV_ADJ_PUB;