1 PACKAGE gl_funds_available_pkg AS
2 /* $Header: glifunds.pls 120.5 2006/05/24 11:49:51 kthatava ship $ */
3 --
4 -- Package
5 -- gl_funds_available_pkg
6 -- Purpose
7 -- To group all the routines for gl_funds_available_pkg.
8 -- This package is mainly used for funds available inquiry form.
9
10
11 --
12 -- Procedure
13 -- is_po_installed
14 -- Purpose
15 -- To find out whether po is installed or not.
16 -- History
17 -- 30-AUG-94 E. Rumanang Created.
18 -- Arguments
19 -- N.A.
20 FUNCTION is_po_installed RETURN BOOLEAN;
21
22 --
23 -- Procedure
24 -- current_budget_info
25 -- Purpose
26 -- Returns budget info about the current budget and whether po is
27 -- installed, and ids and names of PO encumbrance types
28 -- History
29 -- 07-MAR-95 K. Nigam Created.
30 -- Arguments
31 -- x_ledger_id NUMBER, ledger_id
32 -- x_budget_version_id IN OUT NOCOPY NUMBER,
33 -- x_budget_name IN OUT NOCOPY VARCHAR2,
34 -- x_bj_required_flag IN OUT NOCOPY VARCHAR2 budget journals required flag
35 -- x_budget_type IN OUT NOCOPY VARCHAR2,
36 -- x_budget_status IN OUT NOCOPY VARCHAR2,
37 -- x_latest_opened_year IN OUT NOCOPY NUMBER,
38 -- x_first_valid_period IN OUT NOCOPY VARCHAR2,
39 -- x_last_valid_period IN OUT NOCOPY VARCHAR2,
40 -- x_is_po_installed IN OUT NOCOPY BOOLEAN, is PO fully installed
41 -- x_req_id IN OUT NOCOPY NUMBER,
42 -- x_po_id IN OUT NOCOPY NUMBER,
43 -- x_req_name IN OUT NOCOPY VARCHAR2,
44 -- x_po_name IN OUT NOCOPY VARCHAR2,
45 -- x_oth_name IN OUT NOCOPY VARCHAR2);
46
47 PROCEDURE current_budget_info (
48 x_ledger_id NUMBER,
49 x_budget_version_id IN OUT NOCOPY NUMBER,
50 x_budget_name IN OUT NOCOPY VARCHAR2,
51 x_bj_required_flag IN OUT NOCOPY VARCHAR2,
52 x_budget_type IN OUT NOCOPY VARCHAR2,
53 x_budget_status IN OUT NOCOPY VARCHAR2,
54 x_latest_opened_year IN OUT NOCOPY NUMBER,
55 x_first_valid_period IN OUT NOCOPY VARCHAR2,
56 x_last_valid_period IN OUT NOCOPY VARCHAR2,
57 x_is_po_installed IN OUT NOCOPY BOOLEAN,
58 x_req_id IN OUT NOCOPY NUMBER,
59 x_po_id IN OUT NOCOPY NUMBER,
60 x_req_name IN OUT NOCOPY VARCHAR2,
61 x_po_name IN OUT NOCOPY VARCHAR2,
62 x_oth_name IN OUT NOCOPY VARCHAR2);
63
64
65
66
67 --
68 -- Procedure
69 -- calc_funds
70 -- Purpose
71 -- To calculate the funds available amount for
72 -- all balance types
73 -- History
74 -- 07-MAR-95 K. Nigam Created.
75 -- Arguments
76 -- x_amount_type Amount_type
77 -- x_code_combination_id Code combination id of the account
78 -- x_account_type Account type
79 -- x_template_id Template ID
80 -- x_ledger_id ID of the ledger
81 -- x_currency_code Functional currency code
82 -- x_po_install_flag Flag whether PO is installed or not
83 -- x_accounted_period_type Period type
84 -- x_period_set_name Period set name
85 -- x_period_name Period name
86 -- x_period_num Period number
87 -- x_quarter_num Quarter number
88 -- x_period_year Period year
89 -- x_closing_status Closing status
90 -- x_budget_version_id Budget ID
91 -- x_encumbrance_type_id Encumbrance yype ID
92 -- x_req_encumbrance_id Requisition encumbrance ID
93 -- x_po_encumbrance_id Purchasing encumbrance ID
94 -- x_budget Budget amount
95 -- x_encumbrance Encumbrance amount
96 -- x_actual Actual amount
97 -- x_funds_available Funds available amount
98 -- x_req_encumbrance_amount Requisition amount
99 -- x_po_encumbrance_amount Purchasing amount
100 -- x_other_encumbrance_amount Other amount
101
102 PROCEDURE calc_funds(
103 x_amount_type VARCHAR2,
104 x_code_combination_id NUMBER,
105 x_account_type VARCHAR2,
106 x_template_id NUMBER,
107 x_ledger_id NUMBER,
108 x_currency_code VARCHAR2,
109 x_po_install_flag VARCHAR2,
110 x_accounted_period_type VARCHAR2,
111 x_period_set_name VARCHAR2,
112 x_period_name VARCHAR2,
113 x_period_num NUMBER,
114 x_quarter_num NUMBER,
115 x_period_year NUMBER,
116 x_closing_status VARCHAR2,
117 x_budget_version_id NUMBER,
118 x_encumbrance_type_id NUMBER,
119 x_req_encumbrance_id NUMBER,
120 x_po_encumbrance_id NUMBER,
121 x_budget IN OUT NOCOPY NUMBER,
122 x_encumbrance IN OUT NOCOPY NUMBER,
123 x_actual IN OUT NOCOPY NUMBER,
124 x_funds_available IN OUT NOCOPY NUMBER,
125 x_req_encumbrance_amount IN OUT NOCOPY NUMBER,
126 x_po_encumbrance_amount IN OUT NOCOPY NUMBER,
127 x_other_encumbrance_amount IN OUT NOCOPY NUMBER );
128
129
130 --
131 -- Procedure
132 -- calc_funds_period
133 -- Purpose
134 -- To calculate the funds available for each period
135 -- History
136 -- 23-May-06 Krishna Created.
137 -- Arguments
138 -- x_code_combination_id Code combination id of the account
139 -- x_account_type Account type
140 -- x_template_id Template ID
141 -- x_ledger_id ID of the ledger
142 -- x_currency_code Functional currency code
143 -- x_po_install_flag Flag whether PO is installed or not
144 -- x_accounted_period_type Period type
145 -- x_period_set_name Period set name
146 -- x_period_name Period name
147 -- x_period_num Period number
148 -- x_quarter_num Quarter number
149 -- x_period_year Period year
150 -- x_closing_status Closing status
151 -- x_budget_version_id Budget ID
152 -- x_encumbrance_type_id Encumbrance yype ID
153 -- x_req_encumbrance_id Requisition encumbrance ID
154 -- x_po_encumbrance_id Purchasing encumbrance ID
155 -- x_budget Budget amount
156 -- x_encumbrance Encumbrance amount
157 -- x_actual Actual amount
158 -- x_funds_available Funds available amount
159 -- x_req_encumbrance_amount Requisition amount
160 -- x_po_encumbrance_amount Purchasing amount
161 -- x_other_encumbrance_amount Other amount
162
163
164 PROCEDURE calc_funds_period(
165 x_code_combination_id NUMBER,
166 x_account_type VARCHAR2,
167 x_template_id NUMBER,
168 x_ledger_id NUMBER,
169 x_currency_code VARCHAR2,
170 x_po_install_flag VARCHAR2,
171 x_accounted_period_type VARCHAR2,
172 x_period_set_name VARCHAR2,
173 x_period_name VARCHAR2,
174 x_period_num NUMBER,
175 x_quarter_num NUMBER,
176 x_period_year NUMBER,
177 x_closing_status VARCHAR2,
178 x_budget_version_id NUMBER,
179 x_encumbrance_type_id NUMBER,
180 x_req_encumbrance_id NUMBER,
181 x_po_encumbrance_id NUMBER,
182 x_budget IN OUT NOCOPY NUMBER,
183 x_encumbrance IN OUT NOCOPY NUMBER,
184 x_actual IN OUT NOCOPY NUMBER,
185 x_funds_available IN OUT NOCOPY NUMBER,
186 x_req_encumbrance_amount IN OUT NOCOPY NUMBER,
187 x_po_encumbrance_amount IN OUT NOCOPY NUMBER,
188 x_other_encumbrance_amount IN OUT NOCOPY NUMBER );
189
190
191 --
192 -- Procedure
193 -- calc_funds
194 -- Purpose
195 -- To serve as wrapper for the above cal_cunds procedure
196 --
197 -- History
198 -- 22-Jan-2006 N.Venkatesh Created.
199 -- Arguments
200 -- p_ccid Code combination id of the account
201 -- p_template_id Template ID
202 -- p_ledger_id Ledger ID
203 -- p_period_name Period Name
204 -- p_currency_code Currency code
205
206 FUNCTION calc_funds(
207 p_ccid IN VARCHAR2,
208 p_template_id IN NUMBER,
209 p_ledger_id IN NUMBER,
210 p_period_name IN VARCHAR2,
211 p_currency_code IN VARCHAR2) RETURN NUMBER;
212 END gl_funds_available_pkg;