DBA Data[Home] [Help]

PACKAGE BODY: APPS.PJI_PJP_SUM_CUST

Source


1 package body PJI_PJP_SUM_CUST as
2   /* $Header: PJISC01B.pls 120.0 2005/05/29 12:39:14 appldev noship $ */
3 
4   -- -----------------------------------------------------
5   -- procedure PJP_CUSTOM_FPR_API
6   --
7   --   Attention Project Performance customer:
8   --
9   --   This API should be used to implement custom measures in the
10   --   Financial Planning Reporting Lines fact: PJI_FP_XBS_ACCUM_F.
11   --
12   --   1. Only modify code in the indicated area.
13   --   2. Do not issue any statements that result in a "commit" or a "rollback"
14   --   3. Only populate PJI_FP_CUST_PJP0.
15   --
16   --   History
17   --   19-MAR-2004  SVERMETT  Created
18   --
19   -- -----------------------------------------------------
20   procedure PJP_CUSTOM_FPR_API (p_worker_id in number) is
21 
22     l_process         varchar2(30);
23     l_batch_id        number;
24     l_extraction_type varchar2(15);
25     l_pji_schema      varchar2(30);
26 
27   begin
28 
29     l_process := PJI_PJP_SUM_MAIN.g_process ||
30                  to_char(p_worker_id);
31 
32     if (not PJI_PROCESS_UTIL.NEED_TO_RUN_STEP
33         (l_process,
34          'PJI_PJP_SUM_CUST.PJP_CUSTOM_FPR_API(p_worker_id);')) then
35       return;
36     end if;
37 
38     l_batch_id := PJI_PROCESS_UTIL.GET_PROCESS_PARAMETER
39                   (l_process, 'CURRENT_BATCH');
40 
41     l_extraction_type := PJI_PROCESS_UTIL.GET_PROCESS_PARAMETER
42                          (l_process, 'EXTRACTION_TYPE');
43 
44     l_pji_schema := PJI_UTILS.GET_PJI_SCHEMA_NAME;
45 
46     /**************************************************************
47      *                                                            *
48      * Insert custom measures code after this box comment         *
49      *                                                            *
50      *                                                            *
51      * IMPORTANT:  DO NOT INCLUDE ANY COMMIT STATEMENTS IN THE    *
52      *             CUSTOM CODE.                                   *
53      *                                                            *
54      *                                                            *
55      **************************************************************/
56 
57     /**************************************************************************************************************
58      *                                                                                                            *
59      * Sample code with steps to customize custom measures for FP CUSTOM MEASURE TABLE(i.e.PJI_FP_CUST_PJP0) table*
60      *                                                                                                            *
61      *                                                                                                            *
62      * FP BASIS TABLE ( I.E. PJI_FP_AGGR_PJP0)                                                                    *
63      * --------------------------------------                                                                     *
64      *  This table is the first aggregation point after the transaction accum tables and provides a basis for     *
65      *  custom measures. This table has to be populated to store customized measures. It holds the mandatory      *
66      *  keys, which are being used, in custom table (i.e. PJI_FP_CUST_PJP0) to store customized measures.         *
67      *  To see the definition of this table and its columns, please refer ETRM.                                   *
68      *                                                                                                            *
69      * MANDOTORY PREREQUISTE TO DEFINE CUSTOM MEASURE                                                             *
70      * ---------------------------------------------                                                              *
71      *  1. Basis Table PJI_FP_AGGR_PJP0 should be populated                                                       *
72      *   WHAT IF FP BASIS TABLE IS NOT POPULATED                                                                  *
73      *   --------------------------------------                                                                   *
74      *    If the basis table is not populated then the program will not use and store the customized measures     *
75      *    at all.                                                                                                 *
76      *                                                                                                            *
77      * FP CUSTOM MEASURES TABLE ( I.E. PJI_FP_CUST_PJP0)                                                          *
78      * -------------------------------------------------                                                          *
79      *  This table is used to derive PJP custom measures only if derived measures are available in context        *
80      *  of RESOURCE and TASK. After customizing the custom measures, they are stored in this table.               *
81      *  Following is the list of custom measure available:                                                        *
82      *  1. WORKER_ID                 Identify the set of data used by a particular process so that                *
83      *                               when other process is running should not pickup the same record.             *
84      *  2. TXN_ACCUM_HEADER_ID       Identifier for the transaction header                                        *
85      *  3. PROJECT_ID                Identifier for the project                                                   *
86      *  4. PROJECT_ORG_ID            Identifier of the Project Operating Unit                                     *
87      *  5. PROJECT_ORGANIZATION_ID   Identifier of the Project Organization                                       *
88      *  6. PROJECT_ELEMENT_ID        This is the WBS element id and consists of projects and tasks.               *
89      *  7. TIME_ID                   Numeric identifier for time                                                  *
90      *  8. PERIOD_TYPE_ID            Numeric identifier for the period type (period, quarter, year, weeks)        *
91      *  9. CALENDAR_TYPE             Specifies the calendar type (PA, GL, Enterprise)                             *
92      *  10. RBS_AGGR_LEVEL           Indicates, for the current task, the type of RBS aggregation.                *
93      *                               'L' = Lowest (data extracted from the transaction system)                    *
94      *                               'R' = Rollup (date rollup up by RBS)'T' = Top (Common amount that is         *
95      *                               the sum total of a given RBS structure for the current task.)                *
96      *  11. WBS_ROLLUP_FLAG          Indicates, for the given project structure version, whether the amounts      *
97      *                               are rolled up by WBS or not.'N' = No (Task self amounts.)                    *
98      *                               'Y' = Yes (Task amounts rolled up by WBS.                                    *
99      *                               Rolled up amounts do not include self amounts.)                              *
100      *  12. PRG_ROLLUP_FLAG          Indicates whether the amounts are rolled up by Project Hierarchy or not.     *
101      *                               'N' = No (Amounts within a given project.)                                   *
102      *                               'Y' = Yes (Project structure version amounts rolled up by Project            *
103      *                               Hierarchy. Rolled up amounts do not include self amounts.)                   *
104      *  13. CURR_RECORD_TYPE_ID      Identifier for the Currency record type                                      *
105      *  14. CURRENCY_CODE            Currency Code                                                                *
106      *  15. RBS_ELEMENT_ID           Identifier for the RBS                                                       *
107      *  16. RBS_VERSION_ID           Identifier for the RBS version                                               *
108      *  17. PLAN_VERSION_ID          Same as Budget version identifier.                                           *
109      *                               >0 = version id, -1 = Actuals, -2 = Progress Actuals,                        *
110      *                               -3 = Current Baselined, -4 = Current Original Baselined                      *
111      *  18. PLAN_TYPE_ID             Identifier of the Plan Type                                                  *
112      *  19. There are 15 custom measures available to store the customized data.                                  *
113      *                                                                                                            *
114      * PJI LOOKUP TABLE ( I.E. PJI_FP_TXN_ACCUM_HEADER) FOR CUSTOM MEASURES                                       *
115      * --------------------------------------------------------------------                                       *
116      * This table stores all-important information regarding the transactions used in customizing measures.       *
117      * It has 26 attributes/filers, which can be used to customize measure in a very precise manor                *
118      * E.g. If user want to use different amount for timecard having expenditure type is 'Airfare'                *
119      * and it should belong to a particular expenditure org then EXPENDITURE_TYPE and                             *
120      * EXPENDITURE_ORG_ID attribute can be used to filter. Please see example in example section to understand    *
121      * more clearly. To see the complete definition of this table and its columns, please refer ETRM              *
122      *                                                                                                            *
123      * EXAMPLE TO CUSTOMIZE CUSTOM MEASURES                                                                       *
124      * ------------------------------------                                                                       *
125      *  - Customizing a measure using  EXPENDITURE_TYPE, and EXPENDITURE_ORG_ID                                   *
126      *  - Define computation logic for custom measure 1                                                           *
127      *  - Remove 1=2 from the SELECT part                                                                         *
128      * INSERT INTO PJI_FP_CUST_PJP0 cust_i                                                                        *
129      * (                                                                                                          *
130      *   WORKER_ID,                                                                                               *
131      *   TXN_ACCUM_HEADER_ID,                                                                                     *
132      *   PROJECT_ID,                                                                                              *
133      *   PROJECT_ORG_ID,                                                                                          *
134      *   PROJECT_ORGANIZATION_ID,                                                                                 *
135      *   PROJECT_ELEMENT_ID,                                                                                      *
136      *   TIME_ID,                                                                                                 *
137      *   PERIOD_TYPE_ID,                                                                                          *
138      *   CALENDAR_TYPE,                                                                                           *
139      *   RBS_AGGR_LEVEL,                                                                                          *
140      *   WBS_ROLLUP_FLAG,                                                                                         *
141      *   PRG_ROLLUP_FLAG,                                                                                         *
142      *   CURR_RECORD_TYPE_ID,                                                                                     *
143      *   CURRENCY_CODE,                                                                                           *
144      *   RBS_ELEMENT_ID,                                                                                          *
145      *   RBS_VERSION_ID,                                                                                          *
149      *   CUSTOM2,                                                                                                 *
146      *   PLAN_VERSION_ID,                                                                                         *
147      *   PLAN_TYPE_ID,                                                                                            *
148      *   CUSTOM1,                                                                                                 *
150      *   CUSTOM3,                                                                                                 *
151      *   CUSTOM4,                                                                                                 *
152      *   CUSTOM5,                                                                                                 *
153      *   CUSTOM6,                                                                                                 *
154      *   CUSTOM7,                                                                                                 *
155      *   CUSTOM8,                                                                                                 *
156      *   CUSTOM9,                                                                                                 *
157      *   CUSTOM10,                                                                                                *
158      *   CUSTOM11,                                                                                                *
159      *   CUSTOM12,                                                                                                *
160      *   CUSTOM13,                                                                                                *
161      *   CUSTOM14,                                                                                                *
162      *   CUSTOM15                                                                                                 *
163      *   )                                                                                                        *
164      * SELECT                                                                                                     *
165      *   p_worker_id,                                                                                             *
166      *   pjp0.TXN_ACCUM_HEADER_ID,                                                                                *
167      *   pjp0.PROJECT_ID,                                                                                         *
168      *   pjp0.PROJECT_ORG_ID,                                                                                     *
169      *   pjp0.PROJECT_ORGANIZATION_ID,                                                                            *
170      *   pjp0.PROJECT_ELEMENT_ID,                                                                                 *
171      *   pjp0.TIME_ID,                                                                                            *
172      *   pjp0.PERIOD_TYPE_ID,                                                                                     *
173      *   pjp0.CALENDAR_TYPE,                                                                                      *
174      *   pjp0.RBS_AGGR_LEVEL,                                                                                     *
175      *   pjp0.WBS_ROLLUP_FLAG,                                                                                    *
176      *   pjp0.PRG_ROLLUP_FLAG,                                                                                    *
177      *   pjp0.CURR_RECORD_TYPE_ID,                                                                                *
178      *   pjp0.CURRENCY_CODE,                                                                                      *
179      *   pjp0.RBS_ELEMENT_ID,                                                                                     *
180      *   pjp0.RBS_VERSION_ID,                                                                                     *
181      *   pjp0.PLAN_VERSION_ID,                                                                                    *
182      *   pjp0.PLAN_TYPE_ID,                                                                                       *
183      *   -- Custom measure 1                                                                                      *
184      *   DECODE(pjilookup.expenditure_type,'Airfare',DECODE(pjilookup.expenditure_org_id,-1,100,50),0) CUSTOM1,   *
185      *   -- Custom measure 1                                                                                      *
186      *   TO_NUMBER(NULL)                               CUSTOM2,                                                   *
187      *   TO_NUMBER(NULL)                               CUSTOM3,                                                   *
188      *   TO_NUMBER(NULL)                               CUSTOM4,                                                   *
189      *   TO_NUMBER(NULL)                               CUSTOM5,                                                   *
190      *   TO_NUMBER(NULL)                               CUSTOM6,                                                   *
191      *   TO_NUMBER(NULL)                               CUSTOM7,                                                   *
192      *   TO_NUMBER(NULL)                               CUSTOM8,                                                   *
193      *   TO_NUMBER(NULL)                               CUSTOM9,                                                   *
194      *   TO_NUMBER(NULL)                               CUSTOM10,                                                  *
195      *   TO_NUMBER(NULL)                               CUSTOM11,                                                  *
196      *   TO_NUMBER(NULL)                               CUSTOM12,                                                  *
197      *   TO_NUMBER(NULL)                               CUSTOM13,                                                  *
198      *   TO_NUMBER(NULL)                               CUSTOM14,                                                  *
199      *   TO_NUMBER(NULL)                               CUSTOM15                                                   *
200      * FROM                                                                                                       *
204      *   pjp0.WORKER_ID = p_worker_id                                                                             *
201      *   PJI_FP_AGGR_PJP0 pjp0 -- FP basis table,                                                                 *
202      *   PJI_FP_TXN_ACCUM_HEADER pjilookup -- PJI Lookup table                                                    *
203      * WHERE                                                                                                      *
205      *   AND  pjp0.TXN_ACCUM_HEADER_ID = pjilookup.TXN_ACCUM_HEADER_ID;                                           *
206      *                                                                                                            *
207      * LIMITATION TO CUSTOMIZE CUSTOM MEASURES                                                                    *
208      * --------------------------------------                                                                     *
209      *  1. Currently, User can customize any measure available in Oracle Projects.                                *
210      *  2. Only Number data type can be stored in Custom measures.                                                *
211      *  3. The summarization always extracts incremental records from the transaction source.  If the custom      *
212      *     measures are defined on an amount column from the basis table, then they are always computed on        *
213      *     incremental values. However, if the custom measures are derived from other sources then the custom     *
214      *     pl/sql logic has to ensure that it derives incremental amounts (ie., change since the last time        *
215      *     summarization has been run).                                                                           *
216      **************************************************************************************************************/
217 
218     INSERT INTO PJI_FP_CUST_PJP0 cust_i
219     (
220       WORKER_ID,
221       TXN_ACCUM_HEADER_ID,
222       PROJECT_ID,
223       PROJECT_ORG_ID,
224       PROJECT_ORGANIZATION_ID,
225       PROJECT_ELEMENT_ID,
226       TIME_ID,
227       PERIOD_TYPE_ID,
228       CALENDAR_TYPE,
229       RBS_AGGR_LEVEL,
230       WBS_ROLLUP_FLAG,
231       PRG_ROLLUP_FLAG,
232       CURR_RECORD_TYPE_ID,
233       CURRENCY_CODE,
234       RBS_ELEMENT_ID,
235       RBS_VERSION_ID,
236       PLAN_VERSION_ID,
237       PLAN_TYPE_ID,
238       CUSTOM1,
239       CUSTOM2,
240       CUSTOM3,
241       CUSTOM4,
242       CUSTOM5,
243       CUSTOM6,
244       CUSTOM7,
245       CUSTOM8,
246       CUSTOM9,
247       CUSTOM10,
248       CUSTOM11,
249       CUSTOM12,
250       CUSTOM13,
251       CUSTOM14,
252       CUSTOM15
253     )
254     SELECT
255       p_worker_id,
256       pjp0.TXN_ACCUM_HEADER_ID,
257       pjp0.PROJECT_ID,
258       pjp0.PROJECT_ORG_ID,
259       pjp0.PROJECT_ORGANIZATION_ID,
260       pjp0.PROJECT_ELEMENT_ID,
261       pjp0.TIME_ID,
262       pjp0.PERIOD_TYPE_ID,
263       pjp0.CALENDAR_TYPE,
264       pjp0.RBS_AGGR_LEVEL,
265       pjp0.WBS_ROLLUP_FLAG,
266       pjp0.PRG_ROLLUP_FLAG,
267       pjp0.CURR_RECORD_TYPE_ID,
268       pjp0.CURRENCY_CODE,
269       pjp0.RBS_ELEMENT_ID,
270       pjp0.RBS_VERSION_ID,
271       pjp0.PLAN_VERSION_ID,
272       pjp0.PLAN_TYPE_ID,
273       TO_NUMBER(NULL)                               CUSTOM1,
274       TO_NUMBER(NULL)                               CUSTOM2,
275       TO_NUMBER(NULL)                               CUSTOM3,
276       TO_NUMBER(NULL)                               CUSTOM4,
277       TO_NUMBER(NULL)                               CUSTOM5,
278       TO_NUMBER(NULL)                               CUSTOM6,
279       TO_NUMBER(NULL)                               CUSTOM7,
280       TO_NUMBER(NULL)                               CUSTOM8,
281       TO_NUMBER(NULL)                               CUSTOM9,
282       TO_NUMBER(NULL)                               CUSTOM10,
283       TO_NUMBER(NULL)                               CUSTOM11,
284       TO_NUMBER(NULL)                               CUSTOM12,
285       TO_NUMBER(NULL)                               CUSTOM13,
286       TO_NUMBER(NULL)                               CUSTOM14,
287       TO_NUMBER(NULL)                               CUSTOM15
288     FROM
289       PJI_FP_AGGR_PJP0 pjp0
290     WHERE
291       pjp0.WORKER_ID = p_worker_id AND
292       1 = 2;
293 
294     /**************************************************************
295      *                                                            *
296      * Insert custom measures code before this box comment        *
297      *                                                            *
298      **************************************************************/
299 
300     PJI_PROCESS_UTIL.REGISTER_STEP_COMPLETION
301     (l_process,
302      'PJI_PJP_SUM_CUST.PJP_CUSTOM_FPR_API(p_worker_id);');
303 
304     commit;
305 
306   end PJP_CUSTOM_FPR_API;
307 
308 
309   -- -----------------------------------------------------
310   -- procedure PJP_CUSTOM_ACR_API
311   --
312   --   Attention Project Performance customer:
313   --
314   --   This API should be used to implement custom measures in the
315   --   Activities Reporting Lines fact: PJI_AC_XBS_ACCUM_F.
316   --
317   --   1. Only modify code in the indicated area.
318   --   2. Do not issue any statements that result in a "commit" or a "rollback"
319   --   3. Only populate PJI_AC_CUST_PJP0.
320   --
321   --   History
322   --   19-MAR-2004  SVERMETT  Created
323   --
324   -- -----------------------------------------------------
325   procedure PJP_CUSTOM_ACR_API (p_worker_id in number) is
326 
327     l_process         varchar2(30);
328     l_batch_id        number;
329     l_extraction_type varchar2(15);
330     l_pji_schema      varchar2(30);
334     l_process := PJI_PJP_SUM_MAIN.g_process ||
331 
332   begin
333 
335                  to_char(p_worker_id);
336 
337     if (not PJI_PROCESS_UTIL.NEED_TO_RUN_STEP
338         (l_process,
339          'PJI_PJP_SUM_CUST.PJP_CUSTOM_ACR_API(p_worker_id);')) then
340       return;
341     end if;
342 
343     l_batch_id := PJI_PROCESS_UTIL.GET_PROCESS_PARAMETER
344                   (l_process, 'CURRENT_BATCH');
345 
346     l_extraction_type := PJI_PROCESS_UTIL.GET_PROCESS_PARAMETER
347                          (l_process, 'EXTRACTION_TYPE');
348 
349     l_pji_schema := PJI_UTILS.GET_PJI_SCHEMA_NAME;
350 
351     /**************************************************************
352      *                                                            *
353      * Insert custom measures code after this box comment         *
354      *                                                            *
355      *                                                            *
356      * IMPORTANT:  DO NOT INCLUDE ANY COMMIT STATEMENTS IN THE    *
357      *             CUSTOM CODE.                                   *
358      *                                                            *
359      *                                                            *
360      **************************************************************/
361 
362 
363     /**************************************************************************************************************
364      * Sample code with steps to customize custom measures for AC CUSTOM MEASURE TABLE(i.e.PJI_AC_CUST_PJP0) table*
365      *                                                                                                            *
366      *                                                                                                            *
367      * AC BASIS TABLE ( I.E. PJI_AC_AGGR_PJP0)                                                                    *
368      * --------------------------------------                                                                     *
369      *  This table is the first aggregation point after the transaction accum tables and provides a basis for     *
370      *  custom measures. This table has to be populated to store customized measures. It holds the mandatory      *
371      *  keys, which are being used, in custom table (i.e. PJI_AC_CUST_PJP0) to store customized measures.         *
372      *  To see the definition of this table and its columns, please refer ETRM.                                   *
373      *                                                                                                            *
374      * MANDOTORY PREREQUISTE TO DEFINE CUSTOM MEASURE                                                             *
375      * ---------------------------------------------                                                              *
376      *  1. Basis Table PJI_AC_AGGR_PJP0 should be populated                                                       *
377      *   WHAT IF AC BASIS TABLE IS NOT POPULATED                                                                  *
378      *   --------------------------------------                                                                   *
379      *    If the basis table is not populated then the program will not use and store the customized measures     *
380      *    at all.
381      *                                                                                                            *
382      * AC CUSTOM MEASURES TABLE ( I.E. PJI_AC_CUST_PJP0)                                                          *
383      * -------------------------------------------------                                                          *
384      *  This table is used to derive PJP custom measures only if derived measures are available in context        *
385      *  of TASK. After customizing the custom measures, they are stored in this table.                            *
386      *  Following is the list of custom measure available:                                                        *
387      *  1. WORKER_ID                 Identify the set of data used by a particular process so that                *
388      *                               when other process is running should not pickup the same record.             *
389      *  2. PROJECT_ID                Identifier for the project                                                   *
390      *  3. PROJECT_ORG_ID            Identifier of the Project Operating Unit                                     *
391      *  4. PROJECT_ORGANIZATION_ID   Identifier of the Project Organization                                       *
392      *  5. PROJECT_ELEMENT_ID        This is the WBS element id and consists of projects and tasks.               *
393      *  6. TIME_ID                   Numeric identifier for time                                                  *
394      *  7. PERIOD_TYPE_ID            Numeric identifier for the period type (period, quarter, year, weeks)        *
395      *  8. CALENDAR_TYPE             Specifies the calendar type (PA, GL, Enterprise)                             *
396      *  9. WBS_ROLLUP_FLAG          Indicates, for the given project structure version, whether the amounts       *
397      *                               are rolled up by WBS or not.'N' = No (Task self amounts.)                    *
398      *                               'Y' = Yes (Task amounts rolled up by WBS.                                    *
399      *                               Rolled up amounts do not include self amounts.)                              *
400      *  10. PRG_ROLLUP_FLAG          Indicates whether the amounts are rolled up by Project Hierarchy or not.     *
401      *                               'N' = No (Amounts within a given project.)                                   *
402      *                               'Y' = Yes (Project structure version amounts rolled up by Project            *
403      *                               Hierarchy. Rolled up amounts do not include self amounts.)                   *
404      *  11. CURR_RECORD_TYPE_ID      Identifier for the Currency record type                                      *
405      *  12. CURRENCY_CODE            Currency Code                                                                *
409      * ----------------------------------------------------------                                                 *
406      *  13. There are 15 custom measures available to store the customized data.                                  *
407      *                                                                                                            *
408      * USING AC BASIS TABLE FOR LOOKUP AND CUSTOMIZING MEASURE                                                    *
410      * As mentioned  above any table in Oracle Projects can be used to derive customized measures. In this section      *
411      * basis table is being used                                                                                  *
412      * E.g. If user wants to calculate certain amount of tax percentage base on Revenue for PA calendar ,USD      *
413      * currency then CURRENCY_CODE, and CALENDAR_TYPE attribute can be used to filter.                            *
414      * Please see example in example section to understand more clearly.                                          *
415      *                                                                                                            *
416      * EXAMPLE TO CUSTOMIZE CUSTOM MEASURES                                                                       *
417      * ------------------------------------                                                                       *
418      *  - Customizing a measure using  CALENDAR_TYPE,CURRENCY_CODE,REVENUE                                        *
419      *  - Define computation logic for custom measure 1                                                           *
420      *  - Remove 1=2 from the SELECT part                                                                         *
421      * INSERT INTO PJI_AC_CUST_PJP0 cust_i                                                                        *
422      * (                                                                                                          *
423      *   WORKER_ID,                                                                                               *
424      *   PROJECT_ID,                                                                                              *
425      *   PROJECT_ORG_ID,                                                                                          *
426      *   PROJECT_ORGANIZATION_ID,                                                                                 *
427      *   PROJECT_ELEMENT_ID,                                                                                      *
428      *   TIME_ID,                                                                                                 *
429      *   PERIOD_TYPE_ID,                                                                                          *
430      *   CALENDAR_TYPE,                                                                                           *
431      *   WBS_ROLLUP_FLAG,                                                                                         *
432      *   PRG_ROLLUP_FLAG,                                                                                         *
433      *   CURR_RECORD_TYPE_ID,                                                                                     *
434      *   CURRENCY_CODE,                                                                                           *
435      *   CUSTOM1,                                                                                                 *
436      *   CUSTOM2,                                                                                                 *
437      *   CUSTOM3,                                                                                                 *
438      *   CUSTOM4,                                                                                                 *
439      *   CUSTOM5,                                                                                                 *
440      *   CUSTOM6,                                                                                                 *
441      *   CUSTOM7,                                                                                                 *
442      *   CUSTOM8,                                                                                                 *
443      *   CUSTOM9,                                                                                                 *
444      *   CUSTOM10,                                                                                                *
445      *   CUSTOM11,                                                                                                *
446      *   CUSTOM12,                                                                                                *
447      *   CUSTOM13,                                                                                                *
448      *   CUSTOM14,                                                                                                *
449      *   CUSTOM15                                                                                                 *
450      *   )                                                                                                        *
451      * SELECT                                                                                                     *
452      *   p_worker_id,                                                                                             *
453      *   pjp0.PROJECT_ID,                                                                                         *
454      *   pjp0.PROJECT_ORG_ID,                                                                                     *
455      *   pjp0.PROJECT_ORGANIZATION_ID,                                                                            *
456      *   pjp0.PROJECT_ELEMENT_ID,                                                                                 *
457      *   pjp0.TIME_ID,                                                                                            *
458      *   pjp0.PERIOD_TYPE_ID,                                                                                     *
459      *   pjp0.CALENDAR_TYPE,                                                                                      *
460      *   pjp0.WBS_ROLLUP_FLAG,                                                                                    *
464      *   -- Custom measure 1                                                                                      *
461      *   pjp0.PRG_ROLLUP_FLAG,                                                                                    *
462      *   pjp0.CURR_RECORD_TYPE_ID,                                                                                *
463      *   pjp0.CURRENCY_CODE,                                                                                      *
465      *   (0.15*pjp0.REVENUE) CUSTOM1,                                                                             *
466      *   -- Custom measure 1                                                                                      *
467      *   TO_NUMBER(NULL)                               CUSTOM2,                                                   *
468      *   TO_NUMBER(NULL)                               CUSTOM3,                                                   *
469      *   TO_NUMBER(NULL)                               CUSTOM4,                                                   *
470      *   TO_NUMBER(NULL)                               CUSTOM5,                                                   *
471      *   TO_NUMBER(NULL)                               CUSTOM6,                                                   *
472      *   TO_NUMBER(NULL)                               CUSTOM7,                                                   *
473      *   TO_NUMBER(NULL)                               CUSTOM8,                                                   *
474      *   TO_NUMBER(NULL)                               CUSTOM9,                                                   *
475      *   TO_NUMBER(NULL)                               CUSTOM10,                                                  *
476      *   TO_NUMBER(NULL)                               CUSTOM11,                                                  *
477      *   TO_NUMBER(NULL)                               CUSTOM12,                                                  *
478      *   TO_NUMBER(NULL)                               CUSTOM13,                                                  *
479      *   TO_NUMBER(NULL)                               CUSTOM14,                                                  *
480      *   TO_NUMBER(NULL)                               CUSTOM15                                                   *
481      * FROM                                                                                                       *
482      *   PJI_AC_AGGR_PJP0 pjp0 -- AC basis table,                                                                 *
483      * WHERE                                                                                                      *
484      *   pjp0.WORKER_ID = p_worker_id AND                                                                         *
485      *   pjp0.CURRENCY_CODE = 'USD' AND                                                                           *
486      *   pjp0.CALENDAR_TYPE = 'PA;                                                                                *
487      *                                                                                                            *
488      * LIMITATION TO CUSTOMIZE CUSTOM MEASURES                                                                    *
489      * --------------------------------------                                                                     *
490      *  1. Currently, User can customize any measure available in Oracle Projects.                                *
491      *  2. Only Number data type can be stored in Custom measures.                                                *
492      *  3. The summarization always extracts incremental records from the transaction source.  If the custom      *
493      *     measures are defined on an amount column from the basis table, then they are always computed on        *
494      *     incremental values. However, if the custom measures are derived from other sources then the custom     *
495      *     pl/sql logic has to ensure that it derives incremental amounts (ie., change since the last time        *
496      *     summarization has been run).
497      **************************************************************************************************************/
498 
499     INSERT INTO PJI_AC_CUST_PJP0 cust_i
500     (
501       WORKER_ID,
502       PROJECT_ID,
503       PROJECT_ORG_ID,
504       PROJECT_ORGANIZATION_ID,
505       PROJECT_ELEMENT_ID,
506       TIME_ID,
507       PERIOD_TYPE_ID,
508       CALENDAR_TYPE,
509       WBS_ROLLUP_FLAG,
510       PRG_ROLLUP_FLAG,
511       CURR_RECORD_TYPE_ID,
512       CURRENCY_CODE,
513       CUSTOM1,
514       CUSTOM2,
515       CUSTOM3,
516       CUSTOM4,
517       CUSTOM5,
518       CUSTOM6,
519       CUSTOM7,
520       CUSTOM8,
521       CUSTOM9,
522       CUSTOM10,
523       CUSTOM11,
524       CUSTOM12,
525       CUSTOM13,
526       CUSTOM14,
527       CUSTOM15
528     )
529     SELECT
530       p_worker_id,
531       pjp0.PROJECT_ID,
532       pjp0.PROJECT_ORG_ID,
533       pjp0.PROJECT_ORGANIZATION_ID,
534       pjp0.PROJECT_ELEMENT_ID,
535       pjp0.TIME_ID,
536       pjp0.PERIOD_TYPE_ID,
537       pjp0.CALENDAR_TYPE,
538       pjp0.WBS_ROLLUP_FLAG,
539       pjp0.PRG_ROLLUP_FLAG,
540       pjp0.CURR_RECORD_TYPE_ID,
541       pjp0.CURRENCY_CODE,
542       TO_NUMBER(NULL)                               CUSTOM1,
543       TO_NUMBER(NULL)                               CUSTOM2,
544       TO_NUMBER(NULL)                               CUSTOM3,
545       TO_NUMBER(NULL)                               CUSTOM4,
546       TO_NUMBER(NULL)                               CUSTOM5,
547       TO_NUMBER(NULL)                               CUSTOM6,
548       TO_NUMBER(NULL)                               CUSTOM7,
549       TO_NUMBER(NULL)                               CUSTOM8,
550       TO_NUMBER(NULL)                               CUSTOM9,
551       TO_NUMBER(NULL)                               CUSTOM10,
552       TO_NUMBER(NULL)                               CUSTOM11,
553       TO_NUMBER(NULL)                               CUSTOM12,
554       TO_NUMBER(NULL)                               CUSTOM13,
555       TO_NUMBER(NULL)                               CUSTOM14,
556       TO_NUMBER(NULL)                               CUSTOM15
557     FROM
558       PJI_AC_AGGR_PJP0 pjp0
559     WHERE
560       pjp0.WORKER_ID = p_worker_id AND
561       1 = 2;
562 
563     /**************************************************************
564      *                                                            *
565      * Insert custom measures code before this box comment        *
566      *                                                            *
567      **************************************************************/
568 
569     PJI_PROCESS_UTIL.REGISTER_STEP_COMPLETION
570     (l_process,
571      'PJI_PJP_SUM_CUST.PJP_CUSTOM_ACR_API(p_worker_id);');
572 
573     commit;
574 
575   end PJP_CUSTOM_ACR_API;
576 
577 end PJI_PJP_SUM_CUST;