DBA Data[Home] [Help]

PACKAGE BODY: APPS.JG_GLPPOS_PKG

Source


1 PACKAGE BODY JG_GLPPOS_PKG as
2 /* $Header: jgzzposb.pls 120.2.12000000.2 2007/07/12 07:18:19 ashdas ship $ */
3 
4 PROCEDURE glphk (posting_run_id IN NUMBER) is
5   retcode                      NUMBER        := 0;
6   errmsg                       VARCHAR2(100) := '';
7   cutoff_error                 EXCEPTION;
8   sequence_error               EXCEPTION;
9   v_set_of_books_id            NUMBER        := 0;
10   v_install_flag               char(1);
11   v_global_attribute_category  VARCHAR2(150);
12  /* commented for June 24 th release bug by shijain, uncomment later
13   v_country_attribute_category VARCHAR2(150) := 'JE.GR.GLXSTBKS.BOOKS'; -- Greece
14 */
15 BEGIN
16 
17   v_set_of_books_id := FND_PROFILE.VALUE('GL_SET_OF_BKS_ID');
18   --
19   -- Determine what country we're in by looking at the
20   -- set of books global_attribute_category
21   --
22 
23 /* commented out bug 5194263 */
24   /* select global_attribute_category
25   into   v_global_attribute_category
26   from   gl_sets_of_books
27   where  set_of_books_id = v_set_of_books_id;
28 */
29 select 'Y'
30 into v_install_flag
31 from dual
32 where exists
33 (select 'Y'                          --
34    from fnd_product_installations    -- Check if European Localization(7002)
35   where application_id = 7002        -- is installed.
36    and  db_status = 'I'              --
37    and  status = 'I'                 --
38  intersect
39  select 'Y'                          --
40  from fnd_product_installations      -- Check if Regional Localization(7003)
41  where application_id = 7003         -- is installed.
42    and db_status = 'I'               --
43    and status = 'I' );                 --
44 
45  IF v_install_flag ='Y' THEN
46 
47   /*IF (v_global_attribute_category = v_country_attribute_category) THEN*/
48      --
49      -- Check the cutoff rules
50      --
51  /* commented for June 24 th release bug by shijain, uncomment later*/
52 /* uncommented bug 5194263 */
53    JE_GR_STATUTORY.gl_cutoff(posting_run_id, retcode, errmsg);
54      IF (retcode < 0) THEN
55        raise cutoff_error;
56      END IF;
57 
58      --
59      -- Check the sequencing
60      --
61  /* commented for June 24 th release bug by shijain, uncomment later
62      JE_GR_STATUTORY.gl_sequence(posting_run_id, retcode, errmsg);
63      IF (retcode < 0) THEN
64        raise sequence_error;
65      END IF;
66 */
67   END IF;
68 --END IF;
69 EXCEPTION
70   WHEN cutoff_error THEN
71     FND_MESSAGE.set_name ('GL', 'GL_PLL_ROUTINE_ERROR');
72     FND_MESSAGE.set_token('ROUTINE', 'JE_GR_STATUTORY.GL_CUTOFF');
73     APP_EXCEPTION.raise_exception;
74   WHEN sequence_error THEN
75     FND_MESSAGE.set_name ('GL', 'GL_PLL_ROUTINE_ERROR');
76     FND_MESSAGE.set_token('ROUTINE', 'JE_GR_STATUTORY.GL_SEQUENCE');
77     APP_EXCEPTION.raise_exception;
78   WHEN others THEN
79     FND_MESSAGE.set_name ('FND', 'SQL_PLSQL_ERROR');
80     FND_MESSAGE.set_token('ERRNO', sqlcode);
81     FND_MESSAGE.set_token('REASON', substr(sqlerrm, 1, 80));
82     FND_MESSAGE.set_token('ROUTINE', 'GL_GLPPOS_PKH.GLPHK');
83     APP_EXCEPTION.raise_exception;
84 END;
85 
86 END JG_GLPPOS_PKG;