1 PACKAGE IGI_ITR_ACCT_GENERATOR_PKG AS
2 -- $Header: igiitrrs.pls 120.3.12000000.1 2007/09/12 10:32:35 mbremkum ship $
3 --
4
5 --
6 -- Package
7 -- IGI_ITR_ACCT_GENERATOR_PKG
8 -- Purpose
9 -- Functions for self service ITR account generator workflow
10 -- History
11 -- 01-NOV-2000 S Brewer Created
12 --
13 -- Public variables
14 diagn_msg_flag BOOLEAN := TRUE; -- Determines if diagnostic messages are displayed
15
16 --
17 -- Function
18 -- Start_Acct_Generator_Workflow
19 -- Purpose
20 -- Start account generator workflow.
21 -- History
22 -- 01-NOV-2000 S Brewer Created
23 -- Arguments
24 -- p_coa_id ID of chart of accounts being used (parameter)
25 -- p_sob_id ID of set of books being used (parameter)
26 -- p_acct_type Specifies which type of account is needed
27 -- Creation account or Receiving account
28 -- (C or R) (parameter)
29 -- p_charge_center_id ID of the charge center
30 -- p_preparer_id User ID of the preparer
31 -- p_charge_service_id Charge service id chosen by user for receiving
32 -- and creation accounts
33 -- p_cost_center_value value of cost center if chosen by user when
34 -- entering service line
35 -- p_additional_seg_value value of additional segment, if chosen by user
36 -- when entering service line
37 -- x_return_ccid ccid returned by account code generator
38 -- x_concat_segs concatenated segments returned by account
39 -- code generator
40 --
41 -- Example
42 -- IGI_ITR_ACCT_GENERATOR_PKG.Start_Acct_Generator_Workflow(42789,12,'C',1045,1356,145,'100','ITR',x_return_ccid, x_concat_segs);
43 --
44 -- Notes
45 -- Called from ITR enter charges form
46 --
47 FUNCTION start_acct_generator_workflow ( p_coa_id IN NUMBER,
48 p_sob_id IN NUMBER,
49 p_acct_type IN VARCHAR2,
50 p_charge_center_id IN NUMBER,
51 p_preparer_id IN NUMBER,
52 p_charge_service_id IN NUMBER,
53 p_cost_center_value IN VARCHAR2,
54 p_additional_seg_value IN VARCHAR2,
55 x_return_ccid IN OUT NOCOPY NUMBER,
56 x_concat_segs IN OUT NOCOPY VARCHAR2)
57 return boolean;
58
59
60
61 --
62 -- Procedure
63 -- account_type
64 -- Purpose
65 -- Retrieve the account type for which the code combination is required
66 -- i.e. creating charge center's account or receiving charge center's
67 -- account
68 -- This is important because creation account and receiving account
69 -- combinations are generated using different rules.
70 -- History
71 -- 03-NOV-2000 S Brewer Created
72 -- Arguments
73 -- itemtype Workflow item type (ITR Account Generator)
74 -- itemkey fnd flex workflow item key
75 -- actid ID of activity, provided by workflow engine
76 -- (not used in this procedure)
77 -- funcmode Function mode (RUN or CANCEL)
78 -- Example
79 -- N/A (not user-callable)
80 --
81 -- Notes
82 -- This procedure is called from the Oracle Workflow engine
83 -- It retrieves the account type for which the code combination
84 -- is required, which is then used to determine which process the
85 -- workflow should call next
86 --
87
88 PROCEDURE account_type (itemtype IN VARCHAR2,
89 itemkey IN VARCHAR2,
90 actid IN NUMBER,
91 funcmode IN VARCHAR2,
92 result OUT NOCOPY VARCHAR2 );
93
94
95
96 --
97 -- Procedure
98 -- Fetch_creation_account
99 -- Purpose
100 -- Retrieve the creation account defined for the service
101 -- to be used as a default account
102 -- History
103 -- 03-NOV-2000 S Brewer Created.
104 -- Arguments
105 -- itemtype Workflow item type (ITR account generator)
106 -- itemkey fnd flex workflow item key
107 -- actid ID of activity, provided by workflow engine
108 -- (not used in this procedure)
109 -- funcmode Function mode (RUN or CANCEL)
110 -- result Result code
111 -- Example
112 -- N/A (not user-callable)
113 --
114 -- Notes
115 -- This procedure is called from the Oracle Workflow engine
116 -- It retrieves the receipt account set up for the originating charge
117 -- center. This account is used as a default account when building
118 -- the account for the header level of a cross charge
119 --
120 PROCEDURE fetch_creation_account (itemtype IN VARCHAR2,
121 itemkey IN VARCHAR2,
122 actid IN NUMBER,
123 funcmode IN VARCHAR2,
124 result OUT NOCOPY VARCHAR2 );
125
126
127 --
128 -- Procedure
129 -- Find_No_Of_Segs
130 -- Purpose
131 -- Retrieve the number of segments used for the chart of accounts
132 -- History
133 -- 02-FEB-2001 S Brewer Created.
134 -- Arguments
135 -- itemtype Workflow item type (ITR account generator)
136 -- itemkey fnd flex workflow item key
137 -- actid ID of activity, provided by workflow engine
138 -- (not used in this procedure)
139 -- funcmode Function mode (RUN or CANCEL)
140 -- result Result code
141 -- Example
142 -- N/A (not user-callable)
143 --
144 -- Notes
145 -- This procedure is called from the Oracle Workflow engine
146 -- It retrieves the number of segments defined for the chart of
147 -- accounts for use in determining the number of times to execute
148 -- the loop in the workflow.
149 --
150
151 PROCEDURE find_no_of_segs (itemtype IN VARCHAR2,
152 itemkey IN VARCHAR2,
153 actid IN NUMBER,
154 funcmode IN VARCHAR2,
155 result OUT NOCOPY VARCHAR2 );
156
157
158 --
159 -- Procedure
160 -- Increase_Counter
161 -- Purpose
162 -- Increase the workflow attribute counter by one
163 -- History
164 -- 02-FEB-2001 S Brewer Created.
165 -- Arguments
166 -- itemtype Workflow item type (ITR account generator)
167 -- itemkey fnd flex workflow item key
168 -- actid ID of activity, provided by workflow engine
169 -- (not used in this procedure)
170 -- funcmode Function mode (RUN or CANCEL)
171 -- result Result code
172 -- Example
173 -- N/A (not user-callable)
174 --
175 -- Notes
176 -- This procedure is called from the Oracle Workflow engine
177 -- It increases the workflow attribute 'COUNTER' by one and
178 -- the next segment number
179 --
180
181 PROCEDURE increase_counter (itemtype IN VARCHAR2,
182 itemkey IN VARCHAR2,
183 actid IN NUMBER,
184 funcmode IN VARCHAR2,
185 result OUT NOCOPY VARCHAR2 );
186
187 --
188 -- Procedure
189 -- Fetch_Segmenti_Value
190 -- Purpose
191 -- Fetches the value for the segmenti
192 -- History
193 -- 02-FEB-2001 S Brewer Created.
194 -- Arguments
195 -- itemtype Workflow item type (ITR account generator)
196 -- itemkey fnd flex workflow item key
197 -- actid ID of activity, provided by workflow engine
198 -- (not used in this procedure)
199 -- funcmode Function mode (RUN or CANCEL)
200 -- result Result code
201 -- Example
202 -- N/A (not user-callable)
203 --
204 -- Notes
205 -- This procedure is called from the Oracle Workflow engine
206 -- It fetches the value entered during originator setup for the
207 -- segmenti (i being the value of the counter during the looping
208 -- process)
209 --
210
211 PROCEDURE fetch_segmenti_value (itemtype IN VARCHAR2,
212 itemkey IN VARCHAR2,
213 actid IN NUMBER,
214 funcmode IN VARCHAR2,
215 result OUT NOCOPY VARCHAR2 );
216
217
218 --
219 -- Procedure
220 -- Fetch_Segmenti_Name
221 -- Purpose
222 -- Fetches the segment name for the segmenti
223 -- History
224 -- 02-FEB-2001 S Brewer Created.
225 -- Arguments
226 -- itemtype Workflow item type (ITR account generator)
227 -- itemkey fnd flex workflow item key
228 -- actid ID of activity, provided by workflow engine
229 -- (not used in this procedure)
230 -- funcmode Function mode (RUN or CANCEL)
231 -- result Result code
232 -- Example
233 -- N/A (not user-callable)
234 --
235 -- Notes
236 -- This procedure is called from the Oracle Workflow engine
237 -- It fetches the segment name of the segment i
238 -- (i being the value of the counter during the looping process)
239 --
240
241 PROCEDURE fetch_segmenti_name (itemtype IN VARCHAR2,
242 itemkey IN VARCHAR2,
243 actid IN NUMBER,
244 funcmode IN VARCHAR2,
245 result OUT NOCOPY VARCHAR2 );
246
247
248
249 --
250 -- Procedure
251 -- cost_center_value_chosen
252 -- Purpose
253 -- Checks whether a cost center value has been chosen by user
254 -- History
255 -- 03-NOV-2000 S Brewer Created.
256 -- Arguments
257 -- itemtype Workflow item type (ITR Account Generator)
258 -- itemkey fnd flex workflow item key
259 -- actid ID of activity, provided by workflow engine
260 -- (not used in this procedure)
261 -- funcmode Function mode (RUN or CANCEL)
262 -- result Result code
263 -- Example
264 -- N/A (not user-callable)
265 --
266 -- Notes
267 -- This procedure is called from the Oracle Workflow engine
268 -- It checks whether a cost center value has been chosen by the user
269 -- Used when generating an account for the header level of a cross charge
270 --
271
272 PROCEDURE cost_center_value_chosen( itemtype IN VARCHAR2,
273 itemkey IN VARCHAR2,
274 actid IN NUMBER,
275 funcmode IN VARCHAR2,
276 result OUT NOCOPY VARCHAR2 );
277
278
279 --
280 -- Procedure
281 -- additional_seg_value_chosen
282 -- Purpose
283 -- Checks whether an additional segment value was chosen by user when
284 -- entering cross charge
285 -- Returns 'Y' or 'N'
286 -- History
287 -- 03-NOV-2000 S Brewer Created.
288 -- Arguments
289 -- itemtype Workflow item type (ITR Account Generator)
290 -- itemkey fnd flex workflow item key
291 -- actid ID of activity, provided by workflow engine
292 -- (not used in this procedure)
293 -- funcmode Function mode (RUN or CANCEL)
294 -- result Result code
295 -- Example
296 -- N/A (not user-callable)
297 --
298 -- Notes
299 -- This procedure is called from the Oracle Workflow engine
300 -- It checks whether an additional segment value was chosen by a user
301 -- when entering a cross charge. Returns 'Y' or 'N'.
302 -- It is used for both header level and line level account generation,
303 -- since the additional segment can optionally be entered at both line
304 -- and header level
305 --
306
307 PROCEDURE additional_seg_value_chosen( itemtype IN VARCHAR2,
308 itemkey IN VARCHAR2,
309 actid IN NUMBER,
310 funcmode IN VARCHAR2,
311 result OUT NOCOPY VARCHAR2 );
312
313
314
315 --
316 -- Procedure
317 -- fetch_additional_seg_name
318 -- Purpose
319 -- Fetches the name of the additional segment
320 -- History
321 -- 03-NOV-2000 S Brewer Created.
322 -- Arguments
323 -- itemtype Workflow item type (ITR Account Generator)
324 -- itemkey fnd flex workflow item key
325 -- actid ID of activity, provided by workflow engine
326 -- (not used in this procedure)
327 -- funcmode Function mode (RUN or CANCEL)
328 -- result Result code
329 -- Example
330 -- N/A (not user-callable)
331 --
332 -- Notes
333 -- This procedure is called from the Oracle Workflow engine
334 -- It fetches the name of the additional segment if an additional segment
335 -- value was chosen by the user when entering a cross charge.
336 -- It is used for both header level and line level account generation,
337 -- since the additional segment can optionally be entered at both line
338 -- and header level
339 --
340
341 PROCEDURE fetch_additional_seg_name( itemtype IN VARCHAR2,
342 itemkey IN VARCHAR2,
343 actid IN NUMBER,
344 funcmode IN VARCHAR2,
345 result OUT NOCOPY VARCHAR2 );
346
347
348
349 --
350 -- Procedure
351 -- fetch_service_receiving_acct
352 -- Purpose
353 -- Fetches the service receiving account defined for charge center.
354 -- History
355 -- 03-NOV-2000 S Brewer Created.
356 -- Arguments
357 -- itemtype Workflow item type (ITR Account Generator)
358 -- itemkey fnd flex workflow item key
359 -- actid ID of activity, provided by workflow engine
360 -- (not used in this procedure)
361 -- funcmode Function mode (RUN or CANCEL)
362 -- result Result code
363 -- Example
364 -- N/A (not user-callable)
365 --
366 -- Notes
367 -- This procedure is called from the Oracle Workflow engine
368 -- It fetches the service receiving account defined for the charge center.
369 -- This account is used as the default account for generating a receiving account
370 -- at the service line level
371 --
372
373 PROCEDURE fetch_service_receiving_acct( itemtype IN VARCHAR2,
374 itemkey IN VARCHAR2,
375 actid IN NUMBER,
376 funcmode IN VARCHAR2,
377 result OUT NOCOPY VARCHAR2 );
378
379
380
381 END IGI_ITR_ACCT_GENERATOR_PKG;