1 PACKAGE gl_bc_packets_pkg AS
2 /* $Header: glibcpas.pls 120.6 2005/07/29 16:58:05 djogg ship $ */
3 --
4 -- Package
5 -- gl_bc_packets_pkg
6 -- Purpose
7 -- To contain validation and insertion routines for gl_bc_packets
8 -- History
9 -- 12-31-93 D. J. Ogg Created
10
11 --
12 -- Procedure
13 -- get_unique_id
14 -- Purpose
15 -- Gets a unique packet id
16 -- History
17 -- 12-30-93 D. J. Ogg Created
18 -- Arguments
19 -- none
20 -- Example
21 -- pid := gl_bc_packets_pkg.get_unique_id;
22 -- Notes
23 --
24 FUNCTION get_unique_id RETURN NUMBER;
25
26 --
27 -- Procedure
28 -- insert_je_packet
29 -- Purpose
30 -- Selects data from gl_je_lines, and inserts the complete packet
31 -- into gl_bc_packets
32 -- History
33 -- 01-11-94 D. J. Ogg Created
34 -- Arguments
35 -- batch_id ID of batch to be funds checked/reserved
36 -- mode_code R - Reserve Funds, C - Check Funds
37 -- user_id ID of the current user
38 -- x_session_id Session ID
39 -- x_serial_id Serial_Id
40 -- Returns
41 -- The ID of the newly inserted packet
42 -- Example
43 -- pkt_id := gl_bc_packets_pkg.insert_je_packet(1001, 'R', 1002, 5, 10);
44 -- Notes
45 --
46 FUNCTION insert_je_packet(batch_id NUMBER,
47 lgr_id NUMBER,
48 mode_code VARCHAR2,
49 user_id NUMBER,
50 x_session_id NUMBER,
51 x_serial_id NUMBER) RETURN NUMBER;
52
53 --
54 -- Procedure
55 -- exists_packet
56 -- Purpose
57 -- Checks to see if rows exist in gl_bc_packets with the given
58 -- packet id. Returns TRUE if they do, or FALSE otherwise.
59 -- History
60 -- 03-24-94 D. J. Ogg Created
61 -- Arguments
62 -- xpacket_id packet id to check for
63 -- Example
64 -- IF (gl_bc_packets_pkg.exists_packet(1001))
65 -- Notes
66 --
67 FUNCTION exists_packet(xpacket_id NUMBER) RETURN BOOLEAN;
68
69 --
70 -- Procedure
71 -- get_ledger_id
72 -- Purpose
73 -- Gets the ledger_id of the rows for this packet
74 -- History
75 -- 03-23-04 D. J. Ogg Created
76 -- Arguments
77 -- xpacket_id packet id to check for
78 -- Example
79 -- IF (gl_bc_packets_pkg.get_ledger_id(1001) = 1)
80 -- Notes
81 --
82 FUNCTION get_ledger_id(xpacket_id NUMBER) RETURN NUMBER;
83
84 --
85 -- Procedure
86 -- Insert_Budget_Transfer_Row
87 -- Purpose
88 -- Inserts two new rows in gl_bc_packets for the budget transfer
89 -- History
90 -- 04-01-94 D. J. Ogg Created
91 -- Arguments
92 -- X_From_Rowid The place to store the Row ID of the
93 -- from row
94 -- X_To_Rowid The place to store the Row ID of the
95 -- to row
96 -- X_Status_Code The status of the new rows
97 -- X_Packet_Id The packet ID of the new rows
98 -- X_Ledger_Id The ledger ID of the new rows
99 -- X_Je_Source_Name The source of the new rows (Transfer)
100 -- X_Je_Category_Name The category of the new rows (Budget)
101 -- X_Budget_Version_Id The budget containing the transfered amts
102 -- X_Je_Batch_Name The batch name of the new rows
103 -- X_Currency_Code The currency of the transfered amts
104 -- X_From_Code_Combination_Id The code combination of the from row
105 -- X_To_Code_Combination_Id The code combination of the to row
106 -- X_Combination_Number The ID indicating the group of transfers
107 -- containing the new rows
108 -- X_Period_Name The period of the transfer
109 -- X_Period_Year The period year of the transfer
110 -- X_Period_Num The period number of the transfer
111 -- X_Quarter_Num The quarter number of the transfer
112 -- X_From_Entered_Dr The Debit amount transfered from the from
113 -- X_From_Entered_Cr The Credit amount transfered from the from
114 -- X_To_Entered_Dr The Debit amount transfered to the to
115 -- X_To_Entered_Cr The Credit amount transfered to the to
116 -- X_Last_Update_Date The date on which the new rows were
117 -- created
118 -- X_Last_Updated_By The user id of the person who created the
119 -- new rows
120 -- X_Session_Id Session Id
121 -- X_Serial_Id Serial Id
122 --
123 PROCEDURE Insert_Budget_Transfer_Row(
124 X_From_Rowid IN OUT NOCOPY VARCHAR2,
125 X_To_Rowid IN OUT NOCOPY VARCHAR2,
126 X_Status_Code VARCHAR2,
127 X_Packet_Id NUMBER,
128 X_Ledger_Id NUMBER,
129 X_Je_Source_Name VARCHAR2,
130 X_Je_Category_Name VARCHAR2,
131 X_Budget_Version_Id NUMBER,
132 X_Je_Batch_Name VARCHAR2,
133 X_Currency_Code VARCHAR2,
134 X_From_Code_Combination_Id NUMBER,
135 X_To_Code_Combination_Id NUMBER,
136 X_Combination_Number NUMBER,
137 X_Period_Name VARCHAR2,
138 X_Period_Year NUMBER,
139 X_Period_Num NUMBER,
140 X_Quarter_Num NUMBER,
141 X_From_Entered_Dr NUMBER,
142 X_From_Entered_Cr NUMBER,
143 X_To_Entered_Dr NUMBER,
144 X_To_Entered_Cr NUMBER,
145 X_Last_Update_Date DATE,
146 X_Last_Updated_By NUMBER,
147 X_Session_Id NUMBER,
148 X_Serial_Id NUMBER);
149
150 --
151 -- Procedure
152 -- Update_Budget_Transfer_Row
153 -- Purpose
154 -- Updates the two rows in gl_bc_packets for the budget transfer
155 -- History
156 -- 04-01-94 D. J. Ogg Created
157 -- Arguments
158 -- X_From_Rowid The Row ID of the from row
159 -- X_To_Rowid The Row ID of the to row
160 -- X_Status_Code The status of the rows
161 -- X_Packet_Id The packet ID of the rows
162 -- X_Ledger_Id The ledger ID of the rows
163 -- X_Je_Source_Name The source of the rows (Transfer)
164 -- X_Je_Category_Name The category of the rows (Budget)
165 -- X_Budget_Version_Id The budget containing the transfered amts
166 -- X_Je_Batch_Name The batch name of the rows
167 -- X_Currency_Code The currency of the transfered amts
168 -- X_From_Code_Combination_Id The code combination of the from row
169 -- X_To_Code_Combination_Id The code combination of the to row
170 -- X_Combination_Number The ID indicating the group of transfers
171 -- containing the rows
172 -- X_Period_Name The period of the transfer
173 -- X_Period_Year The period year of the transfer
174 -- X_Period_Num The period number of the transfer
175 -- X_Quarter_Num The quarter number of the transfer
176 -- X_From_Entered_Dr The Debit amount transfered from the from
177 -- X_From_Entered_Cr The Credit amount transfered from the from
178 -- X_To_Entered_Dr The Debit amount transfered to the to
179 -- X_To_Entered_Cr The Credit amount transfered to the to
180 -- X_Last_Update_Date The date on which the rows were
181 -- last changed
182 -- X_Last_Updated_By The user id of the person who last
183 -- changed the rows
184 --
185 PROCEDURE Update_Budget_Transfer_Row(
186 X_From_Rowid VARCHAR2,
187 X_To_Rowid VARCHAR2,
188 X_Status_Code VARCHAR2,
189 X_Packet_Id NUMBER,
190 X_Ledger_Id NUMBER,
191 X_Je_Source_Name VARCHAR2,
192 X_Je_Category_Name VARCHAR2,
193 X_Budget_Version_Id NUMBER,
194 X_Je_Batch_Name VARCHAR2,
195 X_Currency_Code VARCHAR2,
196 X_From_Code_Combination_Id NUMBER,
197 X_To_Code_Combination_Id NUMBER,
198 X_Combination_Number NUMBER,
199 X_Period_Name VARCHAR2,
200 X_Period_Year NUMBER,
201 X_Period_Num NUMBER,
202 X_Quarter_Num NUMBER,
203 X_From_Entered_Dr NUMBER,
204 X_From_Entered_Cr NUMBER,
205 X_To_Entered_Dr NUMBER,
206 X_To_Entered_Cr NUMBER,
207 X_Last_Update_Date DATE,
208 X_Last_Updated_By NUMBER);
209
210 --
211 -- Procedure
212 -- Lock_Budget_Transfer_Row
213 -- Purpose
214 -- Locks the two rows in gl_bc_packets for the budget transfer
215 -- History
216 -- 04-01-94 D. J. Ogg Created
217 -- Arguments
218 -- X_From_Rowid The Row ID of the from row
219 -- X_To_Rowid The Row ID of the to row
220 -- X_Status_Code The status of the two rows
221 -- X_Packet_Id The packet ID of the rows
222 -- X_Ledger_Id The ledger ID of the rows
223 -- X_Je_Source_Name The source of the rows (Transfer)
224 -- X_Je_Category_Name The category of the rows (Budget)
225 -- X_Budget_Version_Id The budget containing the transfered amts
226 -- X_Je_Batch_Name The batch name of the rows
227 -- X_Currency_Code The currency of the transfered amts
228 -- X_From_Code_Combination_Id The code combination of the from row
229 -- X_To_Code_Combination_Id The code combination of the to row
230 -- X_Combination_Number The ID indicating the group of transfers
231 -- containing the rows
232 -- X_Period_Name The period of the transfer
233 -- X_Period_Year The period year of the transfer
234 -- X_Period_Num The period number of the transfer
235 -- X_Quarter_Num The quarter number of the transfer
236 -- X_From_Entered_Dr The Debit amount transfered from the from
237 -- X_From_Entered_Cr The Credit amount transfered from the from
238 -- X_To_Entered_Dr The Debit amount transfered to the to
239 -- X_To_Entered_Cr The Credit amount transfered to the to
240 --
241 PROCEDURE Lock_Budget_Transfer_Row(
242 X_From_Rowid VARCHAR2,
243 X_To_Rowid VARCHAR2,
244 X_Status_Code VARCHAR2,
245 X_Packet_Id NUMBER,
246 X_Ledger_Id NUMBER,
247 X_Je_Source_Name VARCHAR2,
248 X_Je_Category_Name VARCHAR2,
249 X_Budget_Version_Id NUMBER,
250 X_Je_Batch_Name VARCHAR2,
251 X_Currency_Code VARCHAR2,
252 X_From_Code_Combination_Id NUMBER,
253 X_To_Code_Combination_Id NUMBER,
254 X_Combination_Number NUMBER,
255 X_Period_Name VARCHAR2,
256 X_Period_Year NUMBER,
257 X_Period_Num NUMBER,
258 X_Quarter_Num NUMBER,
259 X_From_Entered_Dr NUMBER,
260 X_From_Entered_Cr NUMBER,
261 X_To_Entered_Dr NUMBER,
262 X_To_Entered_Cr NUMBER);
263
264 --
265 -- Procedure
266 -- Delete_Budget_Transfer_Row
267 -- Purpose
268 -- Deletes the two rows in gl_bc_packets for the budget transfer
269 -- History
270 -- 04-01-94 D. J. Ogg Created
271 -- Arguments
272 -- X_From_Rowid The Row ID of the from row
273 -- X_To_Rowid The Row ID of the to row
274 --
275 PROCEDURE Delete_Budget_Transfer_Row(
276 X_From_Rowid VARCHAR2,
277 X_To_Rowid VARCHAR2);
278
279 --
280 -- Procedure
281 -- Delete_Packet
282 -- Purpose
283 -- Deletes the packet with the given packet_id. If a value
284 -- is provided for reference1, only deletes the rows with
285 -- this value
286 -- History
287 -- 06-02-94 D. J. Ogg Created
288 -- Arguments
289 -- Packet_Id ID of the packet to be deleted
290 -- Reference1 Reference of the rows to be deleted
291 --
292 PROCEDURE Delete_Packet(Packet_Id NUMBER,
293 Reference1 NUMBER DEFAULT NULL);
294
295 --
299 -- Inserts a new packet that is the same as the old packet
296 -- Procedure
297 -- copy_packet
298 -- Purpose
300 -- History
301 -- 06-02-94 D. J. Ogg Created
302 -- Arguments
303 -- packet_id ID of the packet_id to be duplicated
304 -- mode_code R - Reserve Funds, C - Check Funds
305 -- user_id ID of the current user
306 -- x_session_id Session Id
307 -- x_serial_id Serial Id
308 -- Returns
309 -- The ID of the newly inserted packet
310 -- Example
311 -- pkt_id := gl_bc_packets_pkg.copy_packet(1001, 'R', 1002);
312 -- Notes
313 --
314 FUNCTION copy_packet(packet_id NUMBER,
315 mode_code VARCHAR2,
316 user_id NUMBER,
317 x_session_id NUMBER,
318 x_serial_id NUMBER) RETURN NUMBER;
319
320 --
321 -- Procedure
322 -- view_bc_results_setup
323 -- Purpose
324 -- Does the necessary setup for view_bc_results
325 -- History
326 -- 22-JUL-2005 D J Ogg Created
327 -- Arguments
328 -- packet_id ID of the packet_id to be viewed
329 -- ledger_id Ledger Id used in the packet
330 -- Returns
331 -- The new sequence id to be passed to the function execution
332 -- Example
333 -- seq_id := gl_bc_packets_pkg.view_bc_results_setup(1001, 1);
334 -- Notes
335 --
336 FUNCTION view_bc_results_setup(packet_id NUMBER,
337 ledger_id NUMBER) RETURN NUMBER;
338 END gl_bc_packets_pkg;