DBA Data[Home] [Help]

PACKAGE: APPS.PA_UTILS2

Source


1 PACKAGE PA_UTILS2 AS
2 /* $Header: PAXGUT2S.pls 120.3 2006/07/28 18:40:36 rmarcel noship $*/
3 
4 /* For Archive purge MRC, these are global variable */
5 
6 ARPUR_Commit_Size      NUMBER := 0;
7 ARPUR_MRC_Commit_Size  NUMBER := 0;
8 MRC_ROW_COUNT          NUMBER := 0;
9 
10 
11 /* CBGA
12  * The following variable TempTab is defined - to be used as a default value
13  * for the table parameter expnd_id.
14  */
15     TempIDTab    PA_PLSQL_DATATYPES.IDTabTyp ;
16     TempRowIDTab PA_PLSQL_DATATYPES.Char30TabTyp ;
17 /**CBGA**/
18 
19     /**Global variables related to pa_date and recvr_pa_date caching **/
20     /*
21      * EPP.
22      * Modified variable names.
23      */
24     /*
25      * Provider.
26      */
27     g_prvdr_org_id                  pa_cost_distribution_lines_all.org_id%TYPE;
28     g_p_earliest_pa_start_date      pa_cost_distribution_lines_all.pa_date%TYPE;
29     g_p_earliest_pa_end_date        pa_cost_distribution_lines_all.pa_date%TYPE;
30     g_p_earliest_pa_period_name     pa_cost_distribution_lines_all.pa_period_name%TYPE;
31 
32     g_prvdr_pa_start_date           pa_cost_distribution_lines_all.pa_date%TYPE;
33     g_prvdr_pa_end_date             pa_cost_distribution_lines_all.pa_date%TYPE;
34     g_prvdr_pa_date                 pa_cost_distribution_lines_all.pa_date%TYPE;
35     g_prvdr_pa_period_name          pa_cost_distribution_lines_all.pa_period_name%TYPE;
36 
37     /*
38      * Receiver.
39      */
40     g_recvr_org_id                 pa_cost_distribution_lines_all.org_id%TYPE;
41     g_r_earliest_pa_start_date     pa_cost_distribution_lines_all.pa_date%TYPE;
42     g_r_earliest_pa_end_date       pa_cost_distribution_lines_all.pa_date%TYPE;
43     g_r_earliest_pa_period_name    pa_cost_distribution_lines_all.pa_period_name%TYPE;
44 
45     g_recvr_pa_start_date          pa_cost_distribution_lines_all.pa_date%TYPE;
46     g_recvr_pa_end_date            pa_cost_distribution_lines_all.pa_date%TYPE;
47     g_recvr_pa_date                pa_cost_distribution_lines_all.pa_date%TYPE;
48     g_recvr_pa_period_name         pa_cost_distribution_lines_all.recvr_pa_period_name%TYPE;
49 
50     G_Business_Group_Id   NUMBER;
51     G_Return_Status       VARCHAR2(30);
52 
53     /*
54      * Provider.
55      */
56     g_p_earliest_gl_start_date    pa_cost_distribution_lines_all.gl_date%TYPE;
57     g_p_earliest_gl_end_date      pa_cost_distribution_lines_all.gl_date%TYPE;
58     g_p_earliest_gl_period_name   pa_cost_distribution_lines_all.gl_period_name%TYPE;
59 
60     g_prvdr_set_of_books_id       pa_implementations_all.set_of_books_id%TYPE;
61     g_prvdr_gl_start_date         pa_cost_distribution_lines_all.gl_date%TYPE;
62     g_prvdr_gl_end_date           pa_cost_distribution_lines_all.gl_date%TYPE;
63     g_prvdr_gl_period_name        pa_cost_distribution_lines_all.gl_period_name%TYPE ;
64     g_prvdr_gl_date               pa_cost_distribution_lines_all.gl_date%TYPE;
65 
66     /*
67      * Receiver.
68      */
69     g_r_earliest_gl_start_date    pa_cost_distribution_lines_all.gl_date%TYPE;
70     g_r_earliest_gl_end_date      pa_cost_distribution_lines_all.gl_date%TYPE;
71     g_r_earliest_gl_period_name   pa_cost_distribution_lines_all.gl_period_name%TYPE;
72 
73     g_recvr_set_of_books_id       pa_implementations_all.set_of_books_id%TYPE;
74     g_recvr_gl_start_date         pa_cost_distribution_lines_all.gl_date%TYPE;
75     g_recvr_gl_end_date           pa_cost_distribution_lines_all.gl_date%TYPE;
76     g_recvr_gl_period_name        pa_cost_distribution_lines_all.recvr_gl_period_name%TYPE ;
77     g_recvr_gl_date               pa_cost_distribution_lines_all.gl_date%TYPE;
78 
79     /*
80      * EPP.
81      */
82     g_prev_expenditure_id          pa_expenditure_items_all.expenditure_id%TYPE;
83     g_prev_prvdr_gl_date           pa_cost_distribution_lines_all.gl_date%TYPE;
84     g_prev_prvdr_gl_period_name    pa_cost_distribution_lines_all.gl_period_name%TYPE;
85     g_prev_recvr_gl_period_name    pa_cost_distribution_lines_all.recvr_gl_period_name%TYPE;
86     g_prev_recvr_gl_date           pa_cost_distribution_lines_all.recvr_gl_date%TYPE;
87 
88     /*
89      * These global variables are used by function get_gl_period_name.
90      */
91     g_org_id pa_cost_distribution_lines_all.org_id%TYPE ;
92     g_gl_period_start_date pa_cost_distribution_lines_all.gl_date%TYPE ;
93     g_gl_period_end_date pa_cost_distribution_lines_all.gl_date%TYPE ;
94     g_gl_period_name pa_cost_distribution_lines_all.gl_period_name%TYPE ;
95 
96   /* Period End Accruals */
97    g_p_org_accr_start_date          pa_expenditure_items_all.prvdr_accrual_date%TYPE := NULL;
98    g_p_org_accr_end_date            pa_expenditure_items_all.prvdr_accrual_date%TYPE := NULL;
99    g_p_rev_accr_nxt_st_dt           pa_expenditure_items_all.prvdr_accrual_date%TYPE := NULL;
100    g_p_rev_accr_nxt_end_dt          pa_expenditure_items_all.prvdr_accrual_date%TYPE := NULL;
101    g_p_rev_gl_period_name           pa_cost_distribution_lines_all.gl_period_name%TYPE;
102 
103    g_r_org_accr_start_date          pa_expenditure_items_all.prvdr_accrual_date%TYPE := NULL;
104    g_r_org_accr_end_date            pa_expenditure_items_all.prvdr_accrual_date%TYPE := NULL;
105    g_r_rev_accr_nxt_st_dt           pa_expenditure_items_all.prvdr_accrual_date%TYPE := NULL;
106    g_r_rev_accr_nxt_end_dt          pa_expenditure_items_all.prvdr_accrual_date%TYPE := NULL;
107    g_r_rev_gl_period_name           pa_cost_distribution_lines_all.gl_period_name%TYPE;
108 
109    g_p_accr_gl_per_st_dt            pa_cost_distribution_lines_all.gl_date%TYPE := NULL;
110    g_p_accr_gl_per_end_dt           pa_cost_distribution_lines_all.gl_date%TYPE := NULL;
111    g_p_accr_gl_per_name             pa_cost_distribution_lines_all.pa_period_name%TYPE := NULL;
112 
113    g_r_accr_gl_per_st_dt            pa_cost_distribution_lines_all.gl_date%TYPE := NULL;
114    g_r_accr_gl_per_end_dt           pa_cost_distribution_lines_all.gl_date%TYPE := NULL;
115    g_r_accr_gl_per_name             pa_cost_distribution_lines_all.pa_period_name%TYPE := NULL;
116 
117    g_prv_accr_prvdr_pa_start_date   pa_cost_distribution_lines_all.pa_date%TYPE := NULL;
118    g_prv_accr_prvdr_pa_date         pa_cost_distribution_lines_all.pa_date%TYPE := NULL;
119    g_prv_accr_prvdr_pa_end_date     pa_cost_distribution_lines_all.pa_date%TYPE := NULL;
120    g_prv_accr_recvr_pa_start_date   pa_cost_distribution_lines_all.pa_date%TYPE := NULL;
121    g_prv_accr_recvr_pa_end_date     pa_cost_distribution_lines_all.pa_date%TYPE := NULL;
122    g_p_accr_rev_pa_date             pa_cost_distribution_lines_all.pa_date%TYPE := NULL;
123    g_r_accr_rev_pa_date             pa_cost_distribution_lines_all.pa_date%TYPE := NULL;
124    g_prv_accr_prvdr_pa_period       pa_cost_distribution_lines_all.pa_period_name%TYPE := NULL;
125    g_prv_accr_recvr_pa_period       pa_cost_distribution_lines_all.pa_period_name%TYPE := NULL;
126    g_prv_accr_prvdr_gl_period       pa_cost_distribution_lines_all.gl_period_name%TYPE := NULL;
127    g_prv_accr_recvr_gl_period       pa_cost_distribution_lines_all.gl_period_name%TYPE := NULL;
128 
129    g_p_accr_rev_pa_period           pa_cost_distribution_lines_all.pa_period_name%TYPE := NULL;
130    g_r_accr_rev_pa_period           pa_cost_distribution_lines_all.pa_period_name%TYPE := NULL;
131    g_p_gl_period                    pa_cost_distribution_lines_all.pa_period_name%TYPE := NULL;
132    g_r_gl_period                    pa_cost_distribution_lines_all.pa_period_name%TYPE := NULL;
133    g_prof_new_gldate_derivation     VARCHAR2(1) := NULL;   --EPP global variable
134 
135 
136    /* added the following two global variables for BUG# 3384892 */
137 
138     g_profile_cache_first_time      varchar2(2) :='Y';
139     g_profile_value                 varchar2(2);
140 
141 
142  /* Bug 5374282  */
143    g_gl_dt_period_str_dt           pa_draft_revenues_all.gl_date%TYPE        := NULL;
144    g_gl_dt_period_end_dt           pa_draft_revenues_all.gl_date%TYPE        := NULL;
145    g_gl_dt_period_name             pa_draft_revenues_all.gl_period_name%TYPE := NULL;
146 
147 PROCEDURE get_gl_dt_period  (p_reference_date IN  DATE,
148                              x_gl_period_name OUT NOCOPY pa_draft_revenues_all.gl_period_name%TYPE,
149                              x_gl_dt          OUT NOCOPY pa_draft_revenues_all.gl_date%TYPE,
150                              x_return_status  OUT NOCOPY NUMBER,
151                              x_error_code     OUT NOCOPY VARCHAR2,
152                              x_error_stage    OUT NOCOPY VARCHAR2
153                             );
154  /* 5374282  ends */
155 
156 
157 ---------------------------------------------------------------
158 -- This function returns 'Y'  if a given org is a Exp organization ,
159 -- otherwise , it returns 'N'
160 ---------------------------------------------------------------
161 FUNCTION get_period_name return pa_cost_distribution_lines_all.pa_period_name%TYPE;/*2835063*/
162 
163 /* added the following two functions for bug 3384892  for caching a the profile value.*/
164 
165 FUNCTION pa_date_profile(exp_item_date IN DATE, accounting_date IN DATE, org_id IN NUMBER)
166 RETURN DATE;
167 
168 FUNCTION pa_period_name_profile RETURN VARCHAR2;
169 
170 FUNCTION CheckExpOrg (x_org_id IN NUMBER,
171 		      x_txn_date in date default trunc(sysdate)) RETURN VARCHAR2 ;
172 --pragma RESTRICT_REFERENCES ( CheckExpOrg, WNDS, WNPS);
173 
174 FUNCTION CheckSysLinkFuncActive(x_exp_type IN VARCHAR2,
175 				x_ei_date IN DATE,
176 				x_sys_link_func IN VARCHAR2) RETURN BOOLEAN ;
177 -- pa_lookups purity level has been changed to WNDS only, so modifying
178 -- functions that use pa_lookups to purity level WNDS, however in 8i
179 -- there is no need to explicitly define purity level, so removing the
180 -- purity level all togeather.
181 -- PRAGMA RESTRICT_REFERENCES (CheckSysLinkFuncActive, WNDS, WNPS);
182 
183 FUNCTION CheckAdjFlag (x_exp_item_id In Number) RETURN VARCHAR2;
184 PRAGMA RESTRICT_REFERENCES (CheckAdjFlag, WNDS, WNPS) ;
185 
186 
187 ---------------------------------------------------------------
188 --=================================================================================
189 -- These are the new procedures and functions added for Archive / Purge
190 --=================================================================================
191 
192   FUNCTION  IsProjectClosed ( X_project_system_status_code  IN VARCHAR2 ) RETURN VARCHAR2 ;
193   PRAGMA RESTRICT_REFERENCES ( IsProjectClosed, WNDS, WNPS ) ;
194 
195   FUNCTION  IsProjectInPurgeStatus ( X_project_system_status_code  IN VARCHAR2 ) RETURN VARCHAR2 ;
196   PRAGMA RESTRICT_REFERENCES ( IsProjectInPurgeStatus, WNDS, WNPS ) ;
197 
198   FUNCTION  IsDestPurged ( X_exp_id  IN NUMBER ) RETURN VARCHAR2 ;
199   PRAGMA RESTRICT_REFERENCES ( IsDestPurged, WNDS, WNPS ) ;
200 
201   FUNCTION  IsSourcePurged ( X_exp_id  IN NUMBER ) RETURN VARCHAR2 ;
202   PRAGMA RESTRICT_REFERENCES ( IsSourcePurged, WNDS, WNPS ) ;
203 
204   PROCEDURE IsActivePrjTxnsPurged(p_project_id          IN NUMBER,
205                                   x_message_code    IN OUT NOCOPY VARCHAR2,
206                                   x_token           IN OUT NOCOPY DATE) ;
207 
208   function IsProjectTxnsPurged(p_project_id  IN NUMBER) RETURN BOOLEAN ;
209 
210   function IsProjectCapitalPurged(p_project_id  IN NUMBER) RETURN BOOLEAN ;
211 
212   function IsProjectBudgetsPurged(p_project_id  IN NUMBER) RETURN BOOLEAN ;
213 
214   function IsProjectSummaryPurged(p_project_id  IN NUMBER) RETURN BOOLEAN ;
215 
216   FUNCTION  GetProductRelease  RETURN VARCHAR2 ;
217   PRAGMA RESTRICT_REFERENCES ( GetProductRelease, WNDS, WNPS ) ;
218 
219 ---------------------------------------------------------------
220   function GetLaborCostMultiplier (x_task_id In Number) RETURN VARCHAR2;
221 --  PRAGMA RESTRICT_REFERENCES (GetLaborCostMultiplier, WNDS, WNPS) ;
222 
223 --=================================================================================
224 
225 FUNCTION  GetPrjOrgId(p_project_id  NUMBER,
226                       p_task_id     NUMBER ) RETURN NUMBER ;
227 --PRAGMA RESTRICT_REFERENCES (GetPrjOrgId, WNDS, WNPS) ;
228 ---------------------------------------------------------------
229 
230 --function  : get_pa_date
231 --	Derive PA Date from GL date and ei date .
232 -- This function accepts the expenditure item date ,GL date and org id
233 -- and derives the PA date based on this. The function has been modified
234 -- to not use the gl_Date (though it is still accepted as a parameter
235 -- just in case the logic changes in the future to use the gl_Date).
236 -- This is mainly used for AP invoices and transactions imported from
237 -- other systems where the GL date is known in advance and the PA date
238 -- has to be determined.
239 -- This function is also modified to use caching.
240 ------------------------------------------------------------------------
241 FUNCTION get_pa_date( p_ei_date  IN date, p_gl_date IN date, p_org_id IN number) return date ;
242 PRAGMA RESTRICT_REFERENCES ( get_pa_date, WNDS ) ;            /**CBGA - removed WNPS**/
243 
244 ----------------------------------------------------------------------
245 
246 --function  : get_recvr_pa_date
247 -- Introduced for CBGA changes.
248 --	Derive PA Date for recvr Org.
249 -- This function accepts the expenditure item date,the GL date and org_id and
250 -- derives the PA date based on this. The function has been modified
251 -- to not use the gl_Date (though it is still accepted as a parameter
252 -- just in case the logic changes in the future to use the gl_Date).
253 -- This is mainly used for AP invoices and transactions imported from
254 -- other systems where the GL date is known in advance and the PA date
255 -- has to be determined.
256 ------------------------------------------------------------------------
257 FUNCTION get_recvr_pa_date(p_ei_date  IN date, p_gl_date IN date, p_org_id IN number) return date;
258 PRAGMA RESTRICT_REFERENCES ( get_recvr_pa_date, WNDS ) ;
259 
260 
261 ---------------------------------------------------------------
262 -- Procedure : refresh_pa_cache
263 --    This procedure is used for DB access and is called by get_pa_date and get_recvr_pa_date.
264 ---------------------------------------------------------------
265 
266 PROCEDURE refresh_pa_cache (   p_org_id IN number ,
267                             p_ei_date IN date ,
268                             p_caller_flag IN varchar2
269                         );
270 PRAGMA RESTRICT_REFERENCES ( refresh_pa_cache, WNDS ) ;
271 
272 ---------------------------------------------------------------
273 -- Procedure : refresh_gl_cache.
274 --    This procedure is called by both get_prvdr_gl_date and get_recvr_gl_date.
275 ---------------------------------------------------------------
276 
277 /*
278  * EPP.
279  * Modified the name of the first parameter.
280  */
281 PROCEDURE refresh_gl_cache ( p_reference_date IN DATE,
282                          p_application_id     IN NUMBER,
283                          p_set_of_books_id    IN NUMBER,
284                          p_caller_flag        IN VARCHAR2
285                         );
286 ---------------------------------------------------------------
287 
288 ---------------------------------------------------------------
289 -- Procedure : populate_gl_dates
290 --    This procedure is called by interface programs.
291 ---------------------------------------------------------------
292 
293 PROCEDURE populate_gl_dates( p_local_set_size           IN NUMBER,
294                              p_application_id            IN PA_PLSQL_DATATYPES.IDTabTyp,
295                              p_request_id                IN PA_PLSQL_DATATYPES.IDTabTyp,
296                              p_cdl_rowid                 IN PA_PLSQL_DATATYPES.Char30TabTyp DEFAULT TempRowIDTab,
297                              p_prvdr_sob_id              IN PA_PLSQL_DATATYPES.IDTabTyp,
298                              p_recvr_sob_id              IN PA_PLSQL_DATATYPES.IDTabTyp,
299                              p_expnd_id                  IN PA_PLSQL_DATATYPES.IDTabTyp DEFAULT TempIDTab,
300                              p_sys_linkage_type          IN VARCHAR2 DEFAULT NULL
301                            );
302 
303 ---------------------------------------------------------------
304 -- Function : get_prvdr_gl_date
305 --    This function is called by populate_gl_dates.
306 ---------------------------------------------------------------
307 /*
308  * EPP.
309  * changed the name of the first parameter.
310  */
311 FUNCTION get_prvdr_gl_date( p_reference_date   IN DATE,
312                             p_application_id  IN NUMBER ,
313                             p_set_of_books_id IN gl_sets_of_books.set_of_books_id%TYPE
314                           ) return date ;
315 
316 
317 ---------------------------------------------------------------
318 -- Function : get_recvr_gl_date
319 --    This function is called populate_gl_dates.
320 ---------------------------------------------------------------
321 /*
322  * EPP.
323  * changed the name of the first parameter.
324  */
325 FUNCTION get_recvr_gl_date( p_reference_date   IN DATE,
326                             p_application_id  IN NUMBER ,
327                             p_set_of_books_id IN gl_sets_of_books.set_of_books_id%TYPE
328                           ) return DATE ;
329 ---------------------------------------------------------------
330 
331 -- Fixed Bug 1534973, 1581184
332 -- Added P_EiDate parameter and performing date check in the query
333 -- If adding new parameters please add before P_EiDate parameter
334 -- cwk changes: added parameter P_Person_Type
335   PROCEDURE  GetEmpId ( P_Business_Group_Id     IN NUMBER
336                       , P_Employee_Number       IN VARCHAR2
337                       , X_Employee_Id          OUT NOCOPY VARCHAR2
338 		      , P_Person_Type IN VARCHAR2 default null
339                       , P_EiDate                IN DATE default SYSDATE);
340 
341   FUNCTION  GetBusinessGroupId ( P_Business_Group_Name  IN VARCHAR2 ) RETURN NUMBER;
342 --  pragma  RESTRICT_REFERENCES ( GetBusinessGroupId, WNDS, WNPS );
343 
344 ---------------------------------------------------------------
345 -- Function : GetGlPeriodName
346 --    This function is called by Transaction Import to get the gl period name.
347 ---------------------------------------------------------------
348 PROCEDURE GetGlPeriodNameDate( p_pa_date   IN DATE,
349                               p_application_id  IN NUMBER ,
350                               p_set_of_books_id IN gl_sets_of_books.set_of_books_id%TYPE,
351                               x_gl_date     OUT NOCOPY DATE,
352                               x_period_name  OUT NOCOPY VARCHAR2
353                             ) ;
354 
355 ---------------------------------------------------------------
356 -- Procedure : get_period_information
357 ---------------------------------------------------------------
358 PROCEDURE get_period_information ( p_expenditure_item_date IN pa_expenditure_items_all.expenditure_item_date%TYPE
359                                   ,p_expenditure_id IN pa_expenditure_items_all.expenditure_id%TYPE := NULL
360                                   ,p_system_linkage_function IN pa_expenditure_items_all.system_linkage_function%TYPE := NULL
361                                   ,p_line_type IN pa_cost_distribution_lines_all.line_type%TYPE := NULL
362                                   ,p_prvdr_raw_pa_date IN pa_cost_distribution_lines_all.pa_date%TYPE := NULL
363                                   ,p_recvr_raw_pa_date IN pa_cost_distribution_lines_all.pa_date%TYPE := NULL
364                                   ,p_prvdr_raw_gl_date IN pa_cost_distribution_lines_all.gl_date%TYPE := NULL
365                                   ,p_recvr_raw_gl_date IN pa_cost_distribution_lines_all.gl_date%TYPE := NULL
366                                   ,p_prvdr_org_id IN pa_expenditure_items_all.org_id%TYPE
367                                   ,p_recvr_org_id IN pa_expenditure_items_all.org_id%TYPE := NULL
368                                   ,p_prvdr_sob_id IN pa_implementations_all.set_of_books_id%TYPE
369                                   ,p_recvr_sob_id IN pa_implementations_all.set_of_books_id%TYPE := NULL
370                                   ,p_calling_module IN VARCHAR2 := NULL
371                                   ,p_ou_context IN VARCHAR2 DEFAULT 'N'
372                                   ,x_prvdr_pa_date OUT NOCOPY pa_cost_distribution_lines_all.pa_date%TYPE
373                                   ,x_prvdr_pa_period_name OUT NOCOPY pa_cost_distribution_lines_all.pa_period_name%TYPE
374                                   ,x_prvdr_gl_date OUT NOCOPY pa_cost_distribution_lines_all.gl_date%TYPE
375                                   ,x_prvdr_gl_period_name OUT NOCOPY pa_cost_distribution_lines_all.gl_period_name%TYPE
376                                   ,x_recvr_pa_date OUT NOCOPY pa_cost_distribution_lines_all.recvr_pa_date%TYPE
377                                   ,x_recvr_pa_period_name OUT NOCOPY pa_cost_distribution_lines_all.recvr_pa_period_name%TYPE
378                                   ,x_recvr_gl_date OUT NOCOPY pa_cost_distribution_lines_all.recvr_gl_date%TYPE
379                                   ,x_recvr_gl_period_name OUT NOCOPY pa_cost_distribution_lines_all.recvr_gl_period_name%TYPE
380                                   ,x_return_status  OUT NOCOPY NUMBER
381                                   ,x_error_code OUT NOCOPY VARCHAR2
382                                   ,x_error_stage OUT NOCOPY NUMBER
383                                  );
384 ---------------------------------------------------------------
385 PROCEDURE get_OU_period_information ( p_reference_date IN pa_expenditure_items_all.expenditure_item_date%TYPE
386                                      ,p_calling_module IN VARCHAR2 := NULL
387                                      ,x_pa_date OUT NOCOPY pa_cost_distribution_lines_all.pa_date%TYPE
388                                      ,x_pa_period_name OUT NOCOPY pa_cost_distribution_lines_all.pa_period_name%TYPE
389                                      ,x_gl_date OUT NOCOPY pa_cost_distribution_lines_all.gl_date%TYPE
390                                      ,x_gl_period_name OUT NOCOPY pa_cost_distribution_lines_all.gl_period_name%TYPE
391                                      ,x_return_status  OUT NOCOPY NUMBER
392                                      ,x_error_code OUT NOCOPY VARCHAR2
393                                      ,x_error_stage OUT NOCOPY NUMBER
394                                     );
395 
396 ---------------------------------------------------------------
397   FUNCTION  get_gl_period_name ( p_gl_date  IN pa_cost_distribution_lines_all.gl_date%TYPE
398                                 ,p_org_id   IN pa_cost_distribution_lines_all.org_id%TYPE
399                                )
400   RETURN pa_cost_distribution_lines_all.gl_period_name%TYPE;
401 ---------------------------------------------------------------
402  FUNCTION get_set_of_books_id (p_org_id IN pa_implementations_all.org_id%TYPE) RETURN NUMBER;
403 ---------------------------------------------------------------
404  /*
405   * This function returns the end_date of the PA period in which the input date falls.
406   */
407  FUNCTION get_pa_period_end_date_OU ( p_date IN pa_periods_all.end_date%TYPE ) RETURN pa_periods_all.end_date%TYPE;
408 ------------------------------------------------------------------------------------------------------------------
409 -- Procedure : get_accrual_gl_dt_period
410 ------------------------------------------------------------------------------------------------------------------
411 PROCEDURE get_accrual_gl_dt_period(p_calling_module  IN  VARCHAR2,
412                                 p_reference_date      IN  DATE,
413                                 p_application_id      IN  NUMBER ,
414                                 p_set_of_books_id     IN  gl_sets_of_books.set_of_books_id%TYPE,
415                                 p_prvdr_recvr_flg     IN  VARCHAR2,
416                                 p_epp_flag            IN  VARCHAR2,
417                                 x_gl_accr_period_name OUT NOCOPY VARCHAR2,
418                                 x_gl_accr_dt          OUT NOCOPY DATE,
419                                 x_return_status       OUT NOCOPY VARCHAR2,
420                                 x_error_code          OUT NOCOPY VARCHAR2,
421                                 x_error_stage         OUT NOCOPY VARCHAR2
422                               );
423 ------------------------------------------------------------------------------------------------------------------
424 -- Procedure : get_accrual_period_information
425 ------------------------------------------------------------------------------------------------------------------
426 PROCEDURE get_accrual_period_information(p_expenditure_item_date IN pa_expenditure_items_all.expenditure_item_date%TYPE
427                                   ,x_prvdr_accrual_date IN OUT NOCOPY pa_cost_distribution_lines_all.gl_date%TYPE
428                                   ,x_recvr_accrual_date IN OUT NOCOPY pa_cost_distribution_lines_all.gl_date%TYPE
429                                   ,p_prvdr_org_id IN pa_expenditure_items_all.org_id%TYPE
430                                   ,p_recvr_org_id IN pa_expenditure_items_all.org_id%TYPE
431                                   ,p_prvdr_sob_id IN pa_implementations_all.set_of_books_id%TYPE
432                                   ,p_recvr_sob_id IN pa_implementations_all.set_of_books_id%TYPE
433                                   ,p_calling_module IN VARCHAR2
434                                   ,x_prvdr_pa_date OUT NOCOPY pa_cost_distribution_lines_all.pa_date%TYPE
435                                   ,x_prvdr_pa_period_name OUT NOCOPY pa_cost_distribution_lines_all.pa_period_name%TYPE
436                                   ,x_prvdr_gl_date IN OUT NOCOPY pa_cost_distribution_lines_all.gl_date%TYPE
437                                   ,x_prvdr_gl_period_name OUT NOCOPY pa_cost_distribution_lines_all.gl_period_name%TYPE
438                                   ,x_recvr_pa_date OUT NOCOPY pa_cost_distribution_lines_all.recvr_pa_date%TYPE
439                                   ,x_recvr_pa_period_name OUT NOCOPY pa_cost_distribution_lines_all.recvr_pa_period_name%TYPE
440                                   ,x_recvr_gl_date OUT NOCOPY pa_cost_distribution_lines_all.recvr_gl_date%TYPE
441                                   ,x_recvr_gl_period_name OUT NOCOPY pa_cost_distribution_lines_all.recvr_gl_period_name%TYPE
442                                   ,p_adj_ei_id  IN  pa_expenditure_items_all.expenditure_item_id%type
443                                   ,p_acct_flag  IN VARCHAR2
444                                   ,x_return_status  OUT NOCOPY VARCHAR2
445                                   ,x_error_code OUT NOCOPY VARCHAR2
446                                   ,x_error_stage OUT NOCOPY VARCHAR2
447                                  );
448 ---------------------------------------------------------------------+
449 PROCEDURE get_accrual_pa_dt_period( p_gl_period      IN  VARCHAR2
450                                    ,p_ei_date        IN  DATE
451                                    ,p_org_id         IN  pa_expenditure_items_all.org_id%TYPE
452                                    ,p_prvdr_recvr_flg IN  VARCHAR2
453                                    ,p_epp_flag       IN  VARCHAR2
454                                    ,p_org_rev_flg    IN  VARCHAR2
455                                    ,x_pa_date        OUT NOCOPY DATE
456                                    ,x_pa_period_name OUT NOCOPY VARCHAR2
457                                    ,x_return_status  OUT NOCOPY VARCHAR2
458                                    ,x_error_code     OUT NOCOPY VARCHAR2
459                           );
460 ---------------------------------------------------------------------+
461 FUNCTION get_rev_accrual_date( p_calling_module  IN  VARCHAR2,
462                             p_reference_date     IN  DATE,
463                             p_application_id     IN  NUMBER ,
464                             p_set_of_books_id    IN  gl_sets_of_books.set_of_books_id%TYPE,
465                             p_prvdr_recvr_flg    IN  VARCHAR2,
466                             p_epp_flag           IN  VARCHAR2,
467                             x_gl_period_name     OUT NOCOPY VARCHAR2,
468                             x_return_status      OUT NOCOPY VARCHAR2,
469                             x_error_code         OUT NOCOPY VARCHAR2,
470                             x_error_stage        OUT NOCOPY VARCHAR2
471                           )
472 RETURN DATE;
473 -----------------------------------------------------------------------
474 FUNCTION get_pa_period_name( p_txn_date IN pa_expenditure_items_all.expenditure_item_date%TYPE
475                             ,p_org_id   IN pa_implementations_all.org_id%TYPE
476                            )
477 RETURN pa_periods.period_name%TYPE;
478 -----------------------------------------------------------------------
479 --Start Bug 3069632
480 FUNCTION get_ts_allow_burden_flag( p_transaction_source IN pa_expenditure_items_all.transaction_source%TYPE)
481 RETURN pa_transaction_sources.allow_burden_flag%TYPE;
482 -----------------------------------------------------------------------
483 FUNCTION get_capital_cost_type_code( p_project_id IN pa_projects_all.project_id%TYPE)
484 RETURN pa_project_types_all.CAPITAL_COST_TYPE_CODE%TYPE;
485 
486 G_CapCostTypProjID_Tab PA_PLSQL_DATATYPES.Char1TabTyp;
487 -----------------------------------------------------------------------
488 g_project_id             NUMBER;
489 g_project_type           pa_projects_all.project_type%type;
490 g_proj_org_id            pa_projects_all.org_id%type;
491 g_capital_cost_type_code pa_project_types_all.CAPITAL_COST_TYPE_CODE%TYPE;
492 g_ts_allow_burden_flag   pa_transaction_sources.allow_burden_flag%TYPE;
493 g_transaction_source     pa_expenditure_items_all.transaction_source%TYPE;
494 --End Bug 3069632
495 
496 Function Get_Burden_Amt_Display_Method(P_Project_Id in Number) Return Varchar2;
497 
498 G_BdMethodProjID_Tab PA_PLSQL_DATATYPES.Char1TabTyp;
499 
500 /*S.N. Bug4746949 */
501 Function Proj_Type_Burden_Disp_Method(P_Project_Id in Number) Return Varchar2;
502 G_Bd_MethodProjID_Tab PA_PLSQL_DATATYPES.Char1TabTyp;
503 /*E.N. Bug4746949 */
504 
505    G_PREV_ORG_ID   NUMBER(15);
506    G_PREV_TXN_DATE DATE;
507    G_PREV_EXP_ORG  VARCHAR2(1);
508    G_PREV_BUSGRP_ID NUMBER(15);
509    G_PREV_EMP_NUM  VARCHAR2(30);
510    G_PREV_EI_DATE  DATE;
511    G_PREV_EMP_ID   NUMBER(15);
512    G_PREV_TASK_ID  NUMBER(15);
513    G_PREV_LCM_NAME  VARCHAR2(20);
514    G_PREV_PROJ_ID  NUMBER(15);
515    G_PREV_TASK_ID2 NUMBER(15);
516    G_PREV_ORG_ID2  NUMBER(15);
517    G_PREV_BUS_GRP_NAME VARCHAR2(60);
518    G_PREV_BUS_GRP_ID NUMBER (15);
519    G_PREV_PERSON_TYPE VARCHAR2(30);
520 
521 FUNCTION IsEnhancedBurdeningEnabled RETURN VARCHAR2;
522 
523 END PA_UTILS2;