DBA Data[Home] [Help]

PACKAGE BODY: APPS.PA_NL_INSTALLED

Source


1 PACKAGE BODY pa_nl_installed AS
2 /* $Header: PAXNLINB.pls 120.2 2006/04/10 16:22:47 dlanka noship $ */
3 
4 FUNCTION is_nl_installed RETURN VARCHAR2
5 IS
6 BEGIN
7 
8 /* Commented for Bug 3441696..
9  * We no more use the global variable but a function provided by Services Team
10  *
11   IF g_nl_installed = 'X'
12   THEN
13      BEGIN
14        SELECT DECODE(status,'I','Y','N')
15        INTO   g_nl_installed
16        FROM   fnd_product_installations
17        WHERE  application_id = 8727 ;
18       EXCEPTION
19        WHEN NO_DATA_FOUND
20        THEN
21           g_nl_installed := 'N' ;
22      END ;
23   END IF ;
24    RETURN g_nl_installed ;
25 End of comments for 3441696 **/
26 
27 -- BUG:4924721 Replace cs_csi_utility_grp package with cse_utility_grp
28 --
29 IF CSE_UTILITY_GRP.IS_EIB_ACTIVE THEN
30    RETURN 'Y';
31 ELSE
32    RETURN 'N';
33 END IF;
34 
35 
36 END is_nl_installed ;
37 
38 PROCEDURE reverse_eib_ei(
39     x_exp_item_id          IN  number,
40     x_expenditure_id       IN  number,
41     x_transfer_status_code IN  varchar2,
42     x_status               OUT nocopy number)
43   IS
44     l_status             number := 0;
45     l_backout_id         number;
46   BEGIN
47 
48     pa_adjustments.BackoutItem(
49       X_exp_item_id    => x_exp_item_id,
50       X_expenditure_id => x_expenditure_id,
51       X_adj_activity   => 'REVERSAL',
52       X_module         => 'ENTERPRISE INSTALL BASE',
53       X_user           => fnd_global.user_id,
54       X_login          => fnd_global.login_id,
55       X_status         => l_status);
56 
57     IF l_status <> 0 THEN
58       RAISE fnd_api.g_exc_error;
59     END IF;
60 
61     SELECT expenditure_item_id
62     INTO   l_backout_id
63     FROM   pa_expenditure_items_all
64     WHERE  expenditure_id               = x_expenditure_id
65     AND    adjusted_expenditure_item_id = x_exp_item_id;
66 
67     pa_costing.CreateReverseCdl(
68       x_exp_item_id    => x_exp_item_id,
69       x_backout_id     => l_backout_id,
70       x_user           => fnd_global.user_id,
71       x_status         => l_status);
72 
73     IF l_status <> 0 THEN
74       RAISE fnd_api.g_exc_error;
75     END IF;
76 
77     -- this is required because the cdl created by the routine has the value as 'P'
78     -- and is preventing this line to be transferred to FA
79 
80     UPDATE pa_cost_distribution_lines_all
81     SET    transfer_status_code = 'V'
82     WHERE  expenditure_item_id  = l_backout_id;
83 
84     x_status := l_status;
85 
86   EXCEPTION
87     WHEN fnd_api.g_exc_error THEN
88        x_status := l_status;
89     WHEN others THEN
90        x_status := sqlcode;
91   END reverse_eib_ei;
92 
93 END pa_nl_installed;