[Home] [Help]
PACKAGE BODY: APPS.JE_IT_TAX_EX_UPGRADE
Source
1 PACKAGE BODY je_it_tax_ex_upgrade AS
2 /* $Header: jeitupgb.pls 120.0 2006/05/19 17:43:46 snama noship $ */
3
4 PROCEDURE upgrade_main (errbuf OUT NOCOPY varchar2,
5 retcode OUT NOCOPY number,
6 p_set_of_books_id IN number,
7 p_legal_entity_id IN number) IS
8
9 l_message VARCHAR2(1000);
10 l_row_count NUMBER := 0;
11
12 BEGIN
13
14 fnd_file.put_line(fnd_file.log, 'Input parameters:');
15 fnd_file.put_line(fnd_file.log, 'Set of Books ID: '||p_set_of_books_id );
16 fnd_file.put_line(fnd_file.log, 'Legal Entity ID: '||p_legal_entity_id);
17
18 retcode := 0;
19 errbuf := NULL;
20
21
22 -- Update Legal Entity for je_it_year_ex_limit and je_it_exempt_letters tables.
23 IF (p_legal_entity_id IS NOT NULL) THEN
24
25 UPDATE je_it_year_ex_limit
26 SET legal_entity_id = p_legal_entity_id
27 WHERE set_of_books_id = p_set_of_books_id
28 AND legal_entity_id IS NULL;
29
30 l_message := 'Updated '||SQL%ROWCOUNT||' rows in table je_it_year_ex_limit with
31 legal entity id: '||p_legal_entity_id||
32 ' for set of books id: '||p_set_of_books_id;
33 fnd_file.put_line(fnd_file.log,l_message);
34
35 UPDATE je_it_exempt_letters
36 SET legal_entity_id = p_legal_entity_id
37 WHERE set_of_books_id = p_set_of_books_id
38 AND legal_entity_id IS NULL;
39
40 l_message := 'Updated '||SQL%ROWCOUNT||' rows in table je_it_exempt_letters with
41 legal entity id: '||p_legal_entity_id||
42 ' for set of books id: '||p_set_of_books_id;
43 fnd_file.put_line(fnd_file.log,l_message);
44
45 ELSE
46
47 l_message := 'Legal Entity ID is not provided. Please provide Legal Entity ID for this upgrade.';
48 fnd_file.put_line(fnd_file.log,l_message);
49
50 ROLLBACK;
51 retcode := 2;
52 errbuf := l_message;
53 END IF;
54
55 IF retcode = 0 THEN
56 l_message := 'Upgrade completed successfully.';
57 fnd_file.put_line(fnd_file.log,l_message);
58 COMMIT;
59 END IF;
60
61 EXCEPTION WHEN OTHERS THEN
62 ROLLBACK;
63 l_message := sqlcode||': '||sqlerrm;
64 retcode := 2;
65 errbuf := l_message;
66 fnd_file.put_line(fnd_file.log, l_message);
67
68 END upgrade_main;
69
70 END je_it_tax_ex_upgrade;
71