DBA Data[Home] [Help]

PACKAGE: APPS.GCS_INTERCO_DYNAMIC_PKG

Source


1 PACKAGE GCS_INTERCO_DYNAMIC_PKG AUTHID CURRENT_USER AS
2  /*$Header: gcsicdps.pls 120.2 2006/03/10 05:21:31 spala noship $ */
3 
4 --
5 -- Package
6 --   gcs_interco_dynamic_pkg
7 -- Purpose
8 --   Dynamic package procedures for the Translation Program
9 -- History
10 --   08-JAN-04    Srini Pala       Created
11 --
12   --
13   -- Procedure
14   --   Insert_Interco_Lines
15 
16   -- Purpose
17 
18   --   This routine is responsible for inserting all the intercompnay
19   --   entry lineentities for each intercompany rule into the
20   --   GCS_ENTRY_LINES table.
21 
22   -- Process steps are as follwos:
23      --  The routine uses different set of SQl statements to insert
24      --  elimination lines into the GCS_ENTRY_LINES table based on the
25      --  p_elim_mode parameter.
26 
27      -- Elimination lines are created based on the matching rule set
28      -- at the hierarchy level.
29      -- The matching will be done by organization, company or cost center.
30 
31   -- Arguments
32 
33   -- Example
34   --   GCS_TRANSLATION_PKG.Roll_Forward_Historical_Rates;
35   -- Notes
36   --
37 
38    FUNCTION  INSR_INTERCO_LINES (p_hierarchy_id IN NUMBER,
39                                  p_cal_period_id IN NUMBER,
40                                  p_entity_id IN NUMBER,
41                                  p_match_rule_code VARCHAR2,
42 				 p_balance_type  VARCHAR2,
43 				 p_elim_mode  IN VARCHAR2,
44                                  P_Currency_code IN VARCHAR2,
45                                  p_dataset_code IN NUMBER,
46                                  p_lob_dim_col_name IN VARCHAR2,
47                                  p_cons_run_name IN VARCHAR2,
48                                  p_period_end_date IN DATE,
49                                  p_fem_ledger_id  IN NUMBER)
50                                 RETURN BOOLEAN;
51 
52 
53   --
54   -- Function
55   --   insertr_suspense_lines
56 
57   -- Purpose
58 
59   --   This routine is responsible for inserting the suspense plug in lines
60   --   into the GCS_ENTRY_LINES table.
61 
62   -- Process steps are as follwos:
63 
64   -- Reason
65      -- Before consolidation the intercompany transactions have to be
66      -- eliminated to avoid double counting in the consolidation entity.
67      -- The elimination is just done by switching debits and credits for the
68      -- balanced intercompnay transactions.
69 
70      -- May be some of the intercompany transactions that are not balanced
71      -- becuase of missed transactions or errors.
72      -- In this case along with creating elimination entries,
73      -- the processe engine has to create suspense lines to balnace the
74      -- unbalanced intercompany transactions.
75 
76      -- The plug-in suspense lines will be generated in two steps by
77      -- using two different SQL statements.
78 	-- The first SQL statement generates suspense lines for the unbalanced
79         -- matched intercompnay transactions.
80         -- EXAMPLE
81         --   ORG_ID     Line	Interco_id	Cr	      Dr
82 	-------------------------------------------------------------
83         --   01.1001   	2020	02.2004        100.00
84         --   02.2004	2020    01.1001                     80.00
85 
86         --  In the above transactions there are matched transactions
87 	--  but the balances are off by 20. So a suspense line
88 	-- will be generated with balance 20.
89 
90 	-- The second SQL statement generates suspense line for the unmatched
91         -- intercompnay transactions.
92 
93 	-- EXAMPLE
94         --   ORG_ID     Line	Interco_id	Cr	      Dr
95 	-------------------------------------------------------------
96 	--	01.6677 	3434		02.9978		100.00
97 
98  	-- If you look at the above transaction there is no matching
99 	-- intercompnay transaction, so a suspense line has to be created
100 	-- to balance the above transaction.
101 
102    FUNCTION  INSR_SUSPENSE_LINES(p_hierarchy_id IN NUMBER,
103                              	   p_cal_period_id IN NUMBER,
104                              	   p_entity_id IN NUMBER,
105                                    p_match_rule_code VARCHAR2,
106 			     	   p_balance_type  VARCHAR2,
107 			     	   p_elim_mode  IN VARCHAR2,
108                              	   p_currency_code IN VARCHAR2,
109                                    p_data_set_code IN NUMBER,
110                                    p_err_code OUT NOCOPY VARCHAR2,
111                                    p_err_msg OUT NOCOPY VARCHAR2)
112                                                         RETURN BOOLEAN;
113 
114 
115 
116   --
117   -- Procedure
118   --   Insert_Interco_Trx
119   -- Purpose
120   --  Inserts eligible elimination transactions
121   --  into GCS_INTERCO_ELM_TRX after dataprep operation.
122   --
123  -- Arguments
124  -- P_entry_id        Entry_id (created by dataprep) for the monetary currency
125  -- p_stat_entry_id   Entry id (created by dataprep) for the stat currency
126  -- p_Hierarchy_id    Hierarchy_id for the above entries.
127  --                   This hierarchy id will
128  --                   be used to determine the matching rule like
129  -- 		      match by organization, match by company,
130  --                   or match by cost center.
131  -- x_errbuf          Returns error message to concurrent manager,
132  --                   if there are any errors.
133  -- x_retcode         Returns error code to concurrent manager,
134  --                   if there are any errors.
135 
136   -- Synatx for Calling from external package.
137 
138      --  GCS_INTERCO_PROCESSING_PKG.Insert_Interco_Trx	(1112,
139      --							1114
140      --  						10041)
141      --
142 
143      --
144 
145 
146   PROCEDURE Insert_Interco_Trx(p_entry_id In NUMBER,
147                               p_stat_entry_id IN NUMBER,
148                               p_hierarchy_id IN NUMBER,
149                               p_period_end_date IN DATE,
150                               x_errbuf OUT NOCOPY VARCHAR2,
151                               x_retcode OUT NOCOPY VARCHAR2);
152 
153 END GCS_INTERCO_DYNAMIC_PKG;