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