DBA Data[Home] [Help]

PACKAGE: APPS.PA_BUDGET_FUND_PKG

Source


1 PACKAGE PA_BUDGET_FUND_PKG AUTHID CURRENT_USER as
2 -- $Header: PABBFNDS.pls 120.5.12020000.2 2012/07/19 09:25:18 admarath ship $
3 
4 
5 
6 --
7 -- Procedure            : check_or_reserve_funds
8 -- Purpose              : procedure called from budgets forms.
9 --                        This process will verify if funds check is required
10 --                        or not. Accordingly the procedure will call gl and/or
11 --                        cbc funds check procedure for each account summary line
12 --                        for input budget version id.
13 
14 --Parameters            :
15 --                        p_calling_code :  CHECK_FUNDS/CHECK_BASELINE/RESERVE_BASELINE
16 --                        x_dual_bdgt_cntrl_flag : Y --> Yes, N --> No
17 
18 PROCEDURE check_or_reserve_funds ( p_project_id             IN   NUMBER,
19                                    p_budget_version_id      IN   NUMBER,
20                                    p_calling_mode           IN   VARCHAR2,
21                                    x_dual_bdgt_cntrl_flag   OUT  NOCOPY VARCHAR2,
22                                    x_cc_budget_version_id   OUT  NOCOPY NUMBER,
23                                    x_return_status          OUT  NOCOPY VARCHAR2,
24                                    x_msg_count              OUT  NOCOPY NUMBER,
25                                    x_msg_data               OUT  NOCOPY VARCHAR2 );
26 
27 --
28 -- Procedure            : get_budget_ctrl_options
29 -- Purpose              : To get Budget Control Options for given project id and
30 --                        calling mode.
31 --Parameters            :
32 --                        p_calling_code :  STANDARD/COMMITMENT/BUDGET
33 --                        x_fck_req_flag --> Y (Yes), N (No), Null (Error)
34 --                        x_bdgt_intg_flag --> G (GL) , C (CC) , N (None) , Null (Error)
35 
36 PROCEDURE get_budget_ctrl_options ( p_project_id          IN   NUMBER,
37                                  p_budget_type_code       IN   VARCHAR2,
38                                  p_calling_mode           IN   VARCHAR2,
39                                  x_fck_req_flag           OUT  NOCOPY VARCHAR2,
40                                  x_bdgt_intg_flag         OUT  NOCOPY VARCHAR2,
41                                  x_bdgt_ver_id            OUT  NOCOPY NUMBER,
42                                  x_encum_type_id          OUT  NOCOPY NUMBER,
43                                  x_balance_type           OUT  NOCOPY VARCHAR2,
44                                  x_return_status          OUT  NOCOPY VARCHAR2,
45                                  x_msg_count              OUT  NOCOPY NUMBER,
46                                  x_msg_data               OUT  NOCOPY VARCHAR2 );
47 
48 
49 --
50 -- Procedure            : upd_bdgt_acct_bal
51 -- Purpose              : Update the account level balances for given account, period
52 --                        and budget version id.
53 --Parameters            :
54 --                       p_amount
55 --                            +ve amount : means amount is send for liquidation.
56 --                            -ve amount : means amount is send for reservation.
57 --                        process : Update the available balance field with :
58 --                                  available_balance - p_amount.
59 --
60 
61 PROCEDURE upd_bdgt_acct_bal (    p_gl_period_name         IN   VARCHAR2,
62                                  p_budget_version_id      IN  NUMBER,
63                                  p_ccid                   IN  NUMBER,
64                                  p_amount                 IN  NUMBER,
65                                  x_return_status          OUT  NOCOPY VARCHAR2,
66                                  x_msg_count              OUT  NOCOPY NUMBER,
67                                  x_msg_data               OUT  NOCOPY VARCHAR2 );
68 
69 
70 --
71 -- Procedure            : upd_bdgt_acct_bal_no_fck
72 -- Purpose              : Update the amount available column in pa_budget_acct_lines
73 --                        table during budget baselining process. This is called when
74 --                        funds check is not required during baselining process.
75 --                        The projects funds check process deternimes this by comparing
76 --                        current budget's budget lines with the previous budget's budget
77 --                        lines. In this case only amounts have changed.
78 --                        Apply the following formula :
79 --                          CA = ( CB - PB ) + PA
80 --
81 --                          CA : Current Available Amount
82 --                          CB : Current Budget Amount
83 --                          PB : Previous Budget Amount
84 --                          PA : Previous Available Amount
85 --Parameters            :
86 --                       p_amount
87 --                            +ve amount : means amount is send for liquidation.
88 --                            -ve amount : means amount is send for reservation.
89 --                        process : Update the available balance field with :
90 --                                  available_balance - p_amount.
91 --
92 
93 PROCEDURE upd_bdgt_acct_bal_no_fck (  p_budget_version_id      IN  NUMBER,
94                                  x_return_status          OUT  NOCOPY VARCHAR2,
95                                  x_msg_count              OUT  NOCOPY NUMBER,
96                                  x_msg_data               OUT  NOCOPY VARCHAR2 );
97 
98 --
99 -- Function		: Is_bdgt_intg_enabled
100 -- Purpose		: This functions returns a true/false for a given project_id
101 --			  and mode
102 -- Parameters		: P_mode	S-> Standard , C -> Commitment
103 --			  p_budget_version_id
104 
105 FUNCTION Is_bdgt_intg_enabled (p_project_id             IN  NUMBER,
106 			       p_mode			IN  VARCHAR2)
107 RETURN BOOLEAN 	;
108 
109 --
110 -- Procedure            : copy_budgetary_controls
111 -- Purpose              : This procedure is called from the copy project api.
112 --                        This api will copy budgetary controls from one
113 --                        project to another project.
114 -- Parameters           :
115 
116 PROCEDURE copy_budgetary_controls (p_from_project_id      IN   NUMBER,
117                                    p_to_project_id        IN   NUMBER,
118                                    x_return_status             OUT  NOCOPY VARCHAR2,
119                                    x_msg_count                 OUT  NOCOPY NUMBER,
120                                    x_msg_data                  OUT  NOCOPY VARCHAR2 );
121 
122 --
123 -- Procedure            : release_bc_lock
124 -- Purpose              :
125 
126 -- Parameters           :
127 
128 PROCEDURE release_bc_lock (p_project_id      IN   NUMBER ,
129                             x_return_status          OUT  NOCOPY VARCHAR2,
130                             x_msg_count              OUT  NOCOPY NUMBER,
131                             x_msg_data               OUT  NOCOPY VARCHAR2 );
132 
133 --
134 -- Function		: Is_pa_bc_enabled
135 -- Purpose		: This functions returns true if the profile option
136 --			  PA_BC_ENABLED is set as 'Y' otherwise flase.
137 -- Parameters		: None.
138 --
139 
140 FUNCTION Is_pa_bc_enabled  RETURN BOOLEAN 	;
141 
142 --
143 -- Function             : Is_Budget_Locked
144 -- Purpose              : This functions returns true if the Budget is locked
145 --                        otherwise false.
146 -- Parameters           : Lock_Name
147 --
148 
149 FUNCTION Is_Budget_Locked ( P_Lock_Name  IN VARCHAR2) RETURN BOOLEAN ;
150 
151 -- -------------------------------------------------------------------------------+
152 -- PROCEDURE Create_events_and_fundscheck
153 -- Purpose: This procedure create accounting events and calls BC Funds check
154 --          API for budget baseline/re-baseline/year-end processing/check funds
155 --          for budget
156 -- Parameters and values:
157 -- p_calling_module       - 'Year_End_Rollover' (Year End)/'Cost_Budget'/
158 --                          'Cmt_Budget'/'Revenue_Budget'/'Dual_Budget'(Budgets)
159 -- p_mode                 - 'Reserve_Baseline'/'Check_Baseline'/'Force'(Year-end)
160 -- p_external_budget_code - 'GL'/'CC'/'Dual'
161 -- p_budget_version_id    -  GL Budget version id
162 -- p_cc_budget_version_id -  CC Budget version id
163 -- p_Result_code          - 'S' for success amd 'E' for failure (OUT parameter)
164 --
165 -- Called from : check_or_reserve_funds
166 --               pa_year_end_rollover_pkg.year_end_rollover
167 -- -------------------------------------------------------------------------------+
168 	PROCEDURE create_events_and_fundscheck
169 	(P_calling_module       IN Varchar2,
170          P_mode                 IN Varchar2,
171          P_External_Budget_Code IN Varchar2,
172          P_budget_version_id    IN Number,
173          P_cc_budget_version_id IN Number,
174          P_result_code         OUT NOCOPY Varchar2);
175 
176 -- ----------------------------------------------------------------------------------+
177 -- Following new global variables are being defined for SLA-BC Integration
178 -- These global variables will be accessed in pa_xla_interface_pkg and
179 -- pa_funds_control_pkg
180 -- GLOBAL Variables are:
181 -- --------------------
182  g_budget_amount_code         VARCHAR2(1);  -- 'C' for Cost and 'R' for Revenue
183  g_processing_mode            VARCHAR2(15); -- YEAR_END or BASELINE or CHECK_FUNDS
184  g_balance_type               VARCHAR2(1);  -- E/B
185  g_external_link              VARCHAR2(4);  -- GL/DUAL
186  g_cost_rebaseline_flag       VARCHAR2(1);  -- Y/N
187  g_cc_rebaseline_flag         VARCHAR2(1);  -- Y/N
188  g_cost_current_bvid          pa_budget_versions.budget_version_id%TYPE;
189 --                              (Current baselined/draft version)
190  g_cost_prev_bvid             pa_budget_versions.budget_version_id%TYPE;
191 --                              (Last baselined budget version to reverse)
192  g_cc_current_bvid            pa_budget_versions.budget_version_id%TYPE;
193 --                              (Current baselined/draft version)
194  g_cc_prev_bvid               pa_budget_versions.budget_version_id%TYPE;
195 --                              (Last baselined budget version to reverse)
196 --
197 -- -----------------------------------------------------------------------------------+
198 
199    FUNCTION Get_previous_bvid(p_project_id              IN NUMBER,
200                               p_budget_type_code        IN VARCHAR2,
201                               p_curr_budget_status_code IN VARCHAR2)
202    return NUMBER;
203 
204 -- -----------------------------------------------------------------------------------+
205 -- Function Unburdened_cdl_exists .. returns BOOLEAN
206 -- This function checks if there are any unburdened CDLs that exists for a budget
207 -- If there exists, it returns TRUE ..else for all case ..it returns FALSE
208 -- Accessed from PAXBUEBU - Budget form ..
209 -- -----------------------------------------------------------------------------------+
210    FUNCTION Unburdened_cdl_exists(X_project_id IN Number)
211    RETURN BOOLEAN;
212 
213 
214 END PA_BUDGET_FUND_PKG;