DBA Data[Home] [Help]

PACKAGE BODY: APPS.PA_CC_IDENT_CLIENT_EXTN

Source


1 PACKAGE BODY PA_CC_IDENT_CLIENT_EXTN
2 --  $Header: PACCIXTB.pls 120.1 2005/08/10 14:36:23 eyefimov noship $
3 AS
4 
5 
6 -- PROCEDURE OVERRIDE_PRVDR_RECVR (
7 --           P_PrvdrOrganizationId      IN  NUMBER,
8 --           P_PrvdrOrgId               IN  NUMBER,
9 --           P_RecvrOrganizationId      IN  NUMBER,
10 --           P_RecvrOrgId               IN  NUMBER,
11 --           P_TransId                  IN  NUMBER,
12 --           P_SysLink                  IN  VARCHAR2,
13 --           P_calling_mode          IN  VARCHAR2 default 'TRANSACTION',
14 --           X_Status                   IN OUT NOCOPY VARCHAR2,
15 --           X_PrvdrOrganizationId      IN OUT NOCOPY NUMBER,
16 --           X_RecvrOrganizationId      IN OUT NOCOPY NUMBER,
17 --           X_Error_Stage              OUT NOCOPY VARCHAR2,
18 --           X_Error_Code               OUT NOCOPY NUMBER)
19 -- IS
20 --
21 --  The following example gets the parent organization Id of the provider
22 --  and receiver organizations. If you want to run the sample code then
23 --  remove REM at the begining of the sample code and commemting out the
24 --  default.
25 --  NOTE : P_calling_mode is 'TRANSACTION' then P_TransId stores the expenditure_item_id
26 --         if P_calling_mode is 'TRANSACTION_IMPORT' then P_TransId stores the transaction_interface_id
27 --         which is unique on table pa_transaction_interface_all.
28 --         if P_calling_mode is 'FORECAST' the p_transid stores the value of forecast_item_id
29 --         so code your logic accordingly.
30 --
31 --   --
32 --   -- Sample code for provider and receiver organization override
33 --   --
34 --   -- The following cursor retrieves the parent organization
35 --   -- from the hierarchy that is used for the provider organization
36 --   -- that is passed in.
37 --   --
38 --
39 --   CURSOR C_PRVDR_OVERRIDE IS
40 --      SELECT se.ORGANIZATION_ID_PARENT
41 --        FROM per_org_structure_elements se,
42 --             pa_implementations_all i
43 --       WHERE i.EXP_ORG_STRUCTURE_VERSION_ID = se.ORG_STRUCTURE_VERSION_ID
44 --         AND i.ORG_ID  = P_PrvdrOrgId
45 --         AND se.ORGANIZATION_ID_CHILD = P_PrvdrOrganizationId ;
46 --
47 --   --
48 --   -- The following cursor retrieves the parent organization
49 --   -- from the hierarchy that is used for the receiver organization
50 --   -- that is passed in.
51 --   --
52 --
53 --   CURSOR C_RECVR_OVERRIDE IS
54 --      SELECT se.ORGANIZATION_ID_PARENT
55 --        FROM per_org_structure_elements se,
56 --             pa_implementations_all i
57 --       WHERE i.PROJ_ORG_STRUCTURE_VERSION_ID = se.ORG_STRUCTURE_VERSION_ID
58 --         AND i.ORG_ID  = P_RecvrOrgId
59 --         AND se.ORGANIZATION_ID_CHILD = P_RecvrOrganizationId ;
60 --
61 --   l_parent_prvdr_organization_id  NUMBER;
62 --   l_parent_recvr_organization_id  NUMBER;
63 --
64 -- BEGIN
65 --     --
66 --     -- Get the parent of the provider organization
67 --     --
68 --     OPEN c_prvdr_override ;
69 --     FETCH c_prvdr_override
70 --      INTO l_parent_prvdr_organization_id ;
71 --     IF c_prvdr_override%NOTFOUND THEN
72 --         l_parent_prvdr_organization_id := P_PrvdrOrganizationId ;
73 --     END IF;
74 --     CLOSE c_prvdr_override  ;
75 --
76 --     --
77 --     -- Get the parent of the receiver organization
78 --     --
79 --     OPEN c_recvr_override ;
80 --     FETCH c_recvr_override
81 --      INTO l_parent_recvr_organization_id ;
82 --     IF c_prvdr_override%NOTFOUND THEN
83 --         l_parent_recvr_organization_id := P_PrvdrOrganizationId ;
84 --     END IF;
85 --     CLOSE c_recvr_override  ;
86 --
87 --     X_PrvdrOrganizationId :=  l_parent_prvdr_organization_id ;
88 --     X_RecvrOrganizationId :=  l_parent_recvr_organization_id ;
89 --
90 --
91 -- EXCEPTION
92 --
93 -- WHEN OTHERS THEN
94 --      RAISE ;
95 --
96 -- END OVERRIDE_PRVDR_RECVR ;
97 -- /
98 
99 --
100 -- Default code for provider and receiver organization override.
101 --
102 -- Default code returns the provider and receiver organizations that were passed into
103 -- the procedure.
104 --
105 
106 PROCEDURE OVERRIDE_PRVDR_RECVR (
107           P_PrvdrOrganizationId      IN  NUMBER,
108           P_PrvdrOrgId               IN  NUMBER,
109           P_RecvrOrganizationId      IN  NUMBER,
110           P_RecvrOrgId               IN  NUMBER,
111           P_TransId                  IN  NUMBER,
112           P_SysLink                  IN  VARCHAR2,
113 	      P_calling_mode             IN  VARCHAR2 default 'TRANSACTION',
114           X_Status                   IN OUT NOCOPY VARCHAR2,
115           X_PrvdrOrganizationId      IN OUT NOCOPY NUMBER,
116           X_RecvrOrganizationId      IN OUT NOCOPY NUMBER,
117           X_Error_Stage              OUT NOCOPY VARCHAR2,
118           X_Error_Code               OUT NOCOPY NUMBER)
119 IS
120 
121 
122 BEGIN
123 
124             pa_cc_utils.set_curr_function('PA_CC_IDENT_CLIENT_EXTN.OVERRIDE_PRVDR_RECVR');
125             --
126             -- Default code returns the provider organization and receiver organization
127             -- that were passed to it.
128             --
129             IF pa_cc_utils.g_debug_mode THEN
130                pa_cc_utils.log_message('20.10.170.10: Calling the custom code in client extension ');
131             END IF;
132             X_Error_Stage := 'Assigning the original values back to it';
133 
134             X_PrvdrOrganizationId :=  P_PrvdrOrganizationId ;
135             X_RecvrOrganizationId :=  P_RecvrOrganizationId ;
136 
137             pa_cc_utils.reset_curr_function;
138 
139 EXCEPTION
140 
141 WHEN OTHERS THEN
142      RAISE ;
143 
144 END OVERRIDE_PRVDR_RECVR ;
145 
146 --
147 -- -- The sample code for overriding processing method sets the cross charge
148 -- -- code to 'N' if the system linkage function is expense reports and the
149 -- -- the cost rate flag is 'Y'.
150 --  NOTE : P_calling_mode is 'TRANSACTION' then P_TransId stores the expenditure_item_id
151 --         P_TransDate will store expenditure_item_date
152 --         if P_calling_mode is 'TRANSACTION_IMPORT' then P_TransId stores the transaction_interface_id
153 --         which is unique on table pa_transaction_interface_all.
154 --         if P_calling_mode is 'FORECAST' then P_Transid stores the value of forecast_item_id
155 --         and P_TaskId  will be NULL,
156 --         P_TransDate   will be NULL,
157 --         P_TransSource will be NULL
158 --         so code your logic accordingly.
159 --
160 -- PROCEDURE OVERRIDE_CC_PROCESSING_METHOD (
161 --           P_PrvdrOrganizationId      IN  NUMBER,
162 --           P_RecvrOrganizationId      IN  NUMBER,
163 --           P_PrvdrOrgId               IN  NUMBER,
164 --           P_RecvrOrgId               IN  NUMBER,
165 --           P_PrvdrLEId                IN  NUMBER,
166 --           P_RecvrLEId                IN  NUMBER,
167 --           P_PersonId                 IN  NUMBER,
168 --           P_ProjectId                IN  NUMBER,
169 --           P_TaskId                   IN  NUMBER,
170 --           P_SysLink                  IN  VARCHAR2,
171 --           P_TransDate                IN  DATE,
172 --           P_TransSource              IN  VARCHAR2,
173 --           P_TransId                  IN  NUMBER,
174 --           P_CrossChargeCode          IN  VARCHAR2,
175 --           P_CrossChargeType          IN  VARCHAR2,
176 --           P_calling_mode             IN  VARCHAR2 default 'TRANSACTION',
177 --           X_OvrridCrossChargeCode    OUT NOCOPY VARCHAR2,
178 --           X_Status                   IN OUT NOCOPY VARCHAR2,
179 --           X_Error_Stage              OUT NOCOPY VARCHAR2,
180 --           X_Error_Code               OUT NOCOPY NUMBER)
181 -- IS
182 --
183 --  CURSOR C_get_cost_rate_flag IS
184 --      SELECT cost_rate_flag
185 --        FROM pa_expenditure_types et,
186 --             pa_expenditure_items_all ei
187 --       WHERE ei.expenditure_type = et.expenditure_type
188 --         AND ei.expenditure_item_id = P_ExpItemId ;
189 --
190 --  l_cr_flag      VARCHAR2(1);
191 --
192 -- BEGIN
193 --     IF P_calling_mode = 'TRANSACTION' then
194 --         OPEN C_get_cost_rate_flag;
195 --         FETCH C_get_cost_rate_flag
196 --         INTO l_cr_flag ;
197 --         IF l_cr_flag = 'Y' AND P_SysLink = 'ER' THEN
198 --               X_OvrridCrossChargeCode := 'N' ;
199 --         ELSE
200 --               X_OvrridCrossChargeCode := P_CrossChargeCode ;
201 --         END IF ;
202 --
203 --         CLOSE C_get_cost_rate_flag ;
204 --     ELSE
205 --          X_OvrridCrossChargeCode := P_CrossChargeCode ;
206 --     END IF;
207 --
208 -- EXCEPTION
209 --   WHEN OTHERS THEN
210 --      RAISE;
211 --
212 -- END OVERRIDE_CC_PROCESSING_METHOD ;
213 --
214 
215 -- Default code for cross charge code override.
216 --
217 -- The default code returns the cross charge code that has been provided to it.
218 --
219 PROCEDURE OVERRIDE_CC_PROCESSING_METHOD (
220           P_PrvdrOrganizationId      IN  NUMBER,
221           P_RecvrOrganizationId      IN  NUMBER,
222           P_PrvdrOrgId               IN  NUMBER,
223           P_RecvrOrgId               IN  NUMBER,
224           P_PrvdrLEId                IN  NUMBER,
225           P_RecvrLEId                IN  NUMBER,
226           P_PersonId                 IN  NUMBER,
227           P_ProjectId                IN  NUMBER,
228           P_TaskId                   IN  NUMBER,
229           P_SysLink                  IN  VARCHAR2,
230           P_TransDate                IN  DATE,
231           P_TransSource              IN  VARCHAR2,
232           P_TransId                  IN  NUMBER,
233           P_CrossChargeCode          IN  VARCHAR2,
234           P_CrossChargeType          IN  VARCHAR2,
235           P_calling_mode             IN  VARCHAR2 default 'TRANSACTION',
236           X_OvrridCrossChargeCode    OUT NOCOPY VARCHAR2,
237           X_Status                   IN OUT NOCOPY VARCHAR2,
238           X_Error_Stage              OUT NOCOPY VARCHAR2,
239           X_Error_Code               OUT NOCOPY NUMBER)
240 IS
241 
242 BEGIN
243 
244         pa_cc_utils.set_curr_function('PA_CC_IDENT_CLIENT_EXTN.OVR_CC_PROCESS');
245         --
246         -- Return the cross charge code that was passed into this procedure.
247         --
248         IF pa_cc_utils.g_debug_mode THEN
249            pa_cc_utils.log_message('20.20.210.10: Calling custom code in client extension');
250         END IF;
251 
252         X_OvrridCrossChargeCode   := P_CrossChargeCode ;
253 
254         pa_cc_utils.reset_curr_function;
255 
256 EXCEPTION
257   WHEN OTHERS THEN
258      RAISE;
259 
260 END OVERRIDE_CC_PROCESSING_METHOD ;
261 
262 END PA_CC_IDENT_CLIENT_EXTN;