1 PACKAGE PA_PLAN_REVENUE as
2 /* $Header: PAXPLRTS.pls 120.1 2005/06/15 04:39:26 appldev $ */
3
4 --
5 -- Procedure : Get_Planning_Rates
6 -- Purpose : This procedure will calculate the bill rate and raw revenue from one of
7 -- the given criteria's on the basis of passed parameters for the Planning Transaction
8 -- Parameters :
9
10
11
12 PROCEDURE Get_planning_Rates (
13 p_project_id IN NUMBER,
14 p_task_id IN NUMBER DEFAULT NULL,
15 p_top_task_id IN NUMBER DEFAULT NULL, /* for costing top task Id */
16 p_person_id IN NUMBER,
17 p_job_id IN NUMBER, /* for costing p_proj_cost_job_id */
18 p_bill_job_grp_id IN NUMBER DEFAULT NULL,
19 p_resource_class IN VARCHAR2, /* resource_class_code for Resource Class */
20 p_planning_resource_format IN VARCHAR2, /* resource format required for Costing */
21 p_use_planning_rates_flag IN VARCHAR2 DEFAULT 'N', /* Rate using Actual Rates */
22 p_rate_based_flag IN VARCHAR2 DEFAULT 'Y', /* to identify a rate based transaction */
23 p_uom IN VARCHAR2, /* Planning UOM */
24 p_system_linkage IN VARCHAR2,
25 p_project_organz_id IN NUMBER DEFAULT NULL, /* For revenue calc use in Resource Class Sch carrying out Org Id */
26 p_rev_res_class_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on Resource Class*/
27 p_cost_res_class_rate_sch_id IN NUMBER DEFAULT NULL, /* For Cost Rate Calculations based on Resource Class*/
28 p_rev_task_nl_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on Non Labor*/
29 p_rev_proj_nl_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on Non Labor*/
30 p_rev_job_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on Job*/
31 p_rev_emp_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on Emp*/
32 p_plan_rev_job_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on job for planning*/
33 p_plan_cost_job_rate_sch_id IN NUMBER DEFAULT NULL, /* For Cost Rate Calculations based on job for planning*/
34 p_plan_rev_emp_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on emp for planning*/
35 p_plan_cost_emp_rate_sch_id IN NUMBER DEFAULT NULL, /* For cost Rate Calculations based on emp for planning*/
36 p_plan_rev_nlr_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on non labor for planning*/
37 p_plan_cost_nlr_rate_sch_id IN NUMBER DEFAULT NULL, /* For Cost Rate Calculations based on non labor for planning*/
38 p_plan_burden_cost_sch_id IN NUMBER DEFAULT NULL, /* For Cost Rate Calculations based on burdening for planning*/
39 p_calculate_mode IN VARCHAR2 DEFAULT 'COST_REVENUE' ,/* useed for calculating either only Cost(COST),only Revenue(REVENUE) or both Cost and Revenue(COST_REVENUE) */
40 p_mcb_flag IN VARCHAR2 DEFAULT NULL,
41 p_cost_rate_multiplier IN NUMBER DEFAULT NULL ,
42 p_bill_rate_multiplier IN NUMBER DEFAULT 1,
43 p_quantity IN NUMBER, /* required param for People/Equipment Class */
44 p_item_date IN DATE, /* Used as p_expenditure_item_date for non labor */
45 p_cost_sch_type IN VARCHAR2 , /* Costing Schedule Type'COST' / 'REVENUE' / 'INVOICE' */
46 p_labor_sch_type IN VARCHAR2, /* Revenue Labor Schedule Type B/I */
47 p_non_labor_sch_type IN VARCHAR2 , /* Revenue Non_Labor Schedule Type B/I */
48 p_labor_schdl_discnt IN NUMBER DEFAULT NULL,
49 p_labor_bill_rate_org_id IN NUMBER DEFAULT NULL,
50 p_labor_std_bill_rate_schdl IN VARCHAR2 DEFAULT NULL,
51 p_labor_schdl_fixed_date IN DATE DEFAULT NULL,
52 p_assignment_id IN NUMBER DEFAULT NULL, /* used as p_item_id in the internal APIs */
53 p_project_org_id IN NUMBER, /* Project Org Id */
54 p_project_type IN VARCHAR2,
55 p_expenditure_type IN VARCHAR2,
56 p_non_labor_resource IN VARCHAR2 DEFAULT NULL,
57 p_incurred_by_organz_id IN NUMBER, /* Incurred By Org Id */
58 p_override_to_organz_id IN NUMBER, /* Override Org Id */
59 p_expenditure_org_id IN NUMBER, /* p_expenditure_OU (p_exp_organization_id in costing) */
60 p_assignment_precedes_task IN VARCHAR2, /* Added for Asgmt overide */
61 p_planning_transaction_id IN NUMBER DEFAULT NULL, /* changeed from p_forecast_item_id will passed to client extension */
62 p_task_bill_rate_org_id IN NUMBER DEFAULT NULL, /* Org Id of the Bill Rate at Project Level */
63 p_project_bill_rate_org_id IN NUMBER DEFAULT NULL, /* Org Id of the Bill Rate at task Level */
64 p_nlr_organization_id IN NUMBER DEFAULT NULL, /* Org Id of the Non Labor Resource */
65 p_project_sch_date IN DATE DEFAULT NULL, /* Revenue Non_Labor Schedule Date at project Level */
66 p_task_sch_date IN DATE DEFAULT NULL, /* Revenue Non_Labor Schedule Date at task Level */
67 p_project_sch_discount IN NUMBER DEFAULT NULL , /* Revenue Non_Labor Schedule Discount at project Level */
68 p_task_sch_discount IN NUMBER DEFAULT NULL , /* Revenue Non_Labor Schedule Discount at task Level */
69 p_inventory_item_id IN NUMBER DEFAULT NULL, /* Passed for Inventoty Items */
70 p_BOM_resource_Id IN NUMBER DEFAULT NULL, /* Passed for BOM Resource Id */
71 P_mfc_cost_type_id IN NUMBER DEFAULT 0, /* Manufacturing cost api */
72 P_item_category_id IN NUMBER DEFAULT NULL, /* Manufacturing cost api */
73 p_mfc_cost_source IN NUMBER DEFAULT 1,
74 p_cost_override_rate IN NUMBER DEFAULT NULL, /*override rate if not null no call to costing internal api.*/
75 p_revenue_override_rate IN NUMBER DEFAULT NULL, /*override rate if not null no call to billing internal api.*/
76 p_override_burden_cost_rate IN NUMBER DEFAULT NULL, /*override burden multiplier and p_raw_cost is not null calculate x_burden_cost */
77 p_override_currency_code IN VARCHAR2 DEFAULT NULL, /*override currency Code */
78 p_txn_currency_code IN VARCHAR2 DEFAULT NULL, /* if not null, amounts to be returned in this currency only else in x_txn_curr_code*/
79 p_raw_cost IN NUMBER, /*If p_raw_cost is only passed,return the burden multiplier, burden_cost */
80 p_burden_cost IN NUMBER DEFAULT NULL,
81 p_raw_revenue IN NUMBER DEFAULT NULL,
82 p_billability_flag IN VARCHAR2 DEFAULT 'Y', /* Added rate calculation honoring billability flag */
83 x_bill_rate OUT NOCOPY NUMBER,
84 x_cost_rate OUT NOCOPY NUMBER,
85 x_burden_cost_rate OUT NOCOPY NUMBER,
86 x_burden_multiplier OUT NOCOPY NUMBER,
87 x_raw_cost OUT NOCOPY NUMBER,
88 x_burden_cost OUT NOCOPY NUMBER,
89 x_raw_revenue OUT NOCOPY NUMBER,
90 x_bill_markup_percentage OUT NOCOPY NUMBER,
91 x_cost_txn_curr_code OUT NOCOPY VARCHAR2,
92 x_rev_txn_curr_code OUT NOCOPY VARCHAR2,
93 x_raw_cost_rejection_code OUT NOCOPY VARCHAR2,
94 x_burden_cost_rejection_code OUT NOCOPY VARCHAR2,
95 x_revenue_rejection_code OUT NOCOPY VARCHAR2,
96 x_cost_ind_compiled_set_id OUT NOCOPY NUMBER,
97 x_return_status OUT NOCOPY VARCHAR2,
98 x_msg_data OUT NOCOPY VARCHAR2,
99 x_msg_count OUT NOCOPY NUMBER
100 );
101 --
102 -- Procedure : Get_plan_actual_Rates
103 -- Purpose : This is an internal procedure for calculating the bill rate and raw revenue from one of
104 -- the given criteria's on the basis of passed parameters for the 'ACTUAL RATES' of Planning Transaction
105 -- Parameters :
106 --
107
108 PROCEDURE Get_plan_actual_Rates (
109 p_project_id IN NUMBER,
110 p_task_id IN NUMBER DEFAULT NULL,
111 p_top_task_id IN NUMBER DEFAULT NULL, /* for costing top task Id */
112 p_person_id IN NUMBER,
113 p_job_id IN NUMBER, /* for costing p_proj_cost_job_id */
114 p_bill_job_grp_id IN NUMBER DEFAULT NULL,
115 p_resource_class IN VARCHAR2, /* resource_class_code for Resource Class */
116 p_planning_resource_format IN VARCHAR2 , /* resource format required for Costing */
117 p_use_planning_rates_flag IN VARCHAR2 DEFAULT 'N', /* Rate using Actual Rates */
118 p_rate_based_flag IN VARCHAR2 DEFAULT 'Y', /* to identify a rate based transaction */
119 p_uom IN VARCHAR2, /* Planning UOM */
120 p_system_linkage IN VARCHAR2,
121 p_project_organz_id IN NUMBER DEFAULT NULL, /* For revenue calc use in Resource Class Sch carrying out Org Id */
122 p_rev_task_nl_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on Non Labor*/
123 p_rev_proj_nl_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on Non Labor*/
124 p_rev_job_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on Job*/
125 p_rev_emp_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on Emp*/
126 p_calculate_mode IN VARCHAR2 DEFAULT 'COST_REVENUE' ,/* useed for calculating either only Cost(COST),only Revenue(REVENUE) or both Cost and Revenue(COST_REVENUE) */
127 p_mcb_flag IN VARCHAR2 DEFAULT NULL,
128 p_cost_rate_multiplier IN NUMBER DEFAULT NULL ,
129 p_bill_rate_multiplier IN NUMBER DEFAULT 1,
130 p_quantity IN NUMBER, /* required param for People/Equipment Class */
131 p_item_date IN DATE, /* Used as p_expenditure_item_date for non labor */
132 p_cost_sch_type IN VARCHAR2 , /* Costing Schedule Type'COST' / 'REVENUE' / 'INVOICE' */
133 p_labor_sch_type IN VARCHAR2, /* Revenue Labor Schedule Type B/I */
134 p_non_labor_sch_type IN VARCHAR2 , /* Revenue Non_Labor Schedule Type B/I */
135 p_labor_schdl_discnt IN NUMBER DEFAULT NULL,
136 p_labor_bill_rate_org_id IN NUMBER DEFAULT NULL,
137 p_labor_std_bill_rate_schdl IN VARCHAR2 DEFAULT NULL,
138 p_labor_schdl_fixed_date IN DATE DEFAULT NULL,
139 p_assignment_id IN NUMBER DEFAULT NULL, /* used as p_item_id in the internal APIs */
140 p_project_org_id IN NUMBER, /* Project Org Id */
141 p_project_type IN VARCHAR2,
142 p_expenditure_type IN VARCHAR2,
143 p_non_labor_resource IN VARCHAR2 DEFAULT NULL,
144 p_incurred_by_organz_id IN NUMBER, /* Incurred By Org Id */
145 p_override_to_organz_id IN NUMBER, /* Override Org Id */
146 p_expenditure_org_id IN NUMBER, /* p_expenditure_OU (p_exp_organization_id in costing) */
147 p_assignment_precedes_task IN VARCHAR2, /* Added for Asgmt overide */
148 p_planning_transaction_id IN NUMBER DEFAULT NULL, /* changeed from p_forecast_item_id will passed to client extension */
149 p_task_bill_rate_org_id IN NUMBER DEFAULT NULL, /* Org Id of the Bill Rate at Project Level */
150 p_project_bill_rate_org_id IN NUMBER DEFAULT NULL, /* Org Id of the Bill Rate at task Level */
151 p_nlr_organization_id IN NUMBER DEFAULT NULL, /* Org Id of the Non Labor Resource */
152 p_project_sch_date IN DATE DEFAULT NULL, /* Revenue Non_Labor Schedule Date at project Level */
153 p_task_sch_date IN DATE DEFAULT NULL, /* Revenue Non_Labor Schedule Date at task Level */
154 p_project_sch_discount IN NUMBER DEFAULT NULL , /* Revenue Non_Labor Schedule Discount at project Level */
155 p_task_sch_discount IN NUMBER DEFAULT NULL , /* Revenue Non_Labor Schedule Discount at task Level */
156 p_inventory_item_id IN NUMBER DEFAULT NULL, /* Passed for Inventoty Items */
157 p_BOM_resource_Id IN NUMBER DEFAULT NULL, /* Passed for BOM Resource Id */
158 P_mfc_cost_type_id IN NUMBER DEFAULT 0, /* Manufacturing cost api */
159 P_item_category_id IN NUMBER DEFAULT NULL, /* Manufacturing cost api */
160 p_mfc_cost_source IN NUMBER DEFAULT 1,
161 p_cost_override_rate IN NUMBER DEFAULT NULL, /*override rate if not null no call to costing internal api.*/
162 p_revenue_override_rate IN NUMBER DEFAULT NULL, /*override rate if not null no call to billing internal api.*/
163 p_override_burden_cost_rate IN NUMBER DEFAULT NULL,
164 p_override_currency_code IN VARCHAR2 DEFAULT NULL, /*override currency Code */
165 p_txn_currency_code IN VARCHAR2 DEFAULT NULL, /* if not null, amounts to be returned in this currency only else in x_txn_curr_code*/
166 p_raw_cost IN NUMBER, /*If p_raw_cost is only passed,return the burden multiplier, burden_cost */
167 p_burden_cost IN NUMBER DEFAULT NULL,
168 p_raw_revenue IN NUMBER DEFAULT NULL,
169 x_bill_rate OUT NOCOPY NUMBER,
170 x_cost_rate OUT NOCOPY NUMBER,
171 x_burden_cost_rate OUT NOCOPY NUMBER,
172 x_burden_multiplier OUT NOCOPY NUMBER,
173 x_raw_cost OUT NOCOPY NUMBER,
174 x_burden_cost OUT NOCOPY NUMBER,
175 x_raw_revenue OUT NOCOPY NUMBER,
176 x_bill_markup_percentage OUT NOCOPY NUMBER,
177 x_cost_txn_curr_code OUT NOCOPY VARCHAR2,
178 x_rev_txn_curr_code OUT NOCOPY VARCHAR2,
179 x_raw_cost_rejection_code OUT NOCOPY VARCHAR2,
180 x_burden_cost_rejection_code OUT NOCOPY VARCHAR2,
181 x_revenue_rejection_code OUT NOCOPY VARCHAR2,
182 x_cost_ind_compiled_set_id OUT NOCOPY NUMBER,
183 x_return_status OUT NOCOPY VARCHAR2,
184 x_msg_data OUT NOCOPY VARCHAR2,
185 x_msg_count OUT NOCOPY NUMBER
186 );
187 -- Procedure : Get_plan_actual_Rates
188 -- Purpose : This is an internal procedure for calculating the bill rate and raw revenue from one of
189 -- the given criteria's on the basis of passed parameters for the 'ACTUAL RATES' of Planning Transaction
190 -- Parameters :
191 --
192
193 PROCEDURE Get_Plan_Actual_Rev_Rates (
194 p_project_id IN NUMBER,
195 p_task_id IN NUMBER DEFAULT NULL,
196 p_person_id IN NUMBER,
197 p_job_id IN NUMBER, /* for costing p_proj_cost_job_id */
198 p_bill_job_grp_id IN NUMBER DEFAULT NULL,
199 p_resource_class IN VARCHAR2, /* resource_class_code for Resource Class */
200 p_rate_based_flag IN VARCHAR2 DEFAULT 'Y', /* to identify a rate based transaction */
201 p_uom IN VARCHAR2, /* Planning UOM */
202 p_system_linkage IN VARCHAR2,
203 p_project_organz_id IN NUMBER DEFAULT NULL, /* For revenue calc use in Resource Class Sch carrying out Org Id */
204 p_rev_proj_nl_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on Non Labor*/
205 p_rev_task_nl_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on Non Labor*/
206 p_rev_job_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on Job*/
207 p_rev_emp_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on Emp*/
208 p_mcb_flag IN VARCHAR2 DEFAULT NULL,
209 p_bill_rate_multiplier IN NUMBER DEFAULT 1,
210 p_quantity IN NUMBER, /* required param for People/Equipment Class */
211 p_item_date IN DATE, /* Used as p_expenditure_item_date for non labor */
212 p_labor_sch_type IN VARCHAR2, /* Revenue Labor Schedule Type B/I */
213 p_labor_schdl_discnt IN NUMBER DEFAULT NULL,
214 p_labor_bill_rate_org_id IN NUMBER DEFAULT NULL,
215 p_labor_std_bill_rate_schdl IN VARCHAR2 DEFAULT NULL,
216 p_labor_schdl_fixed_date IN DATE DEFAULT NULL,
217 p_assignment_id IN NUMBER DEFAULT NULL, /* used as p_item_id in the internal APIs */
218 p_project_org_id IN NUMBER, /* Project Org Id */
219 p_project_type IN VARCHAR2,
220 p_expenditure_type IN VARCHAR2,
221 p_incurred_by_organz_id IN NUMBER, /* Incurred By Org Id */
225 p_planning_transaction_id IN NUMBER DEFAULT NULL, /* changeed from p_forecast_item_id will passed to client extension */
222 p_override_to_organz_id IN NUMBER, /* Override Org Id */
223 p_expenditure_org_id IN NUMBER, /* p_expenditure_OU (p_exp_organization_id in costing) */
224 p_assignment_precedes_task IN VARCHAR2, /* Added for Asgmt overide */
226 p_task_bill_rate_org_id IN NUMBER DEFAULT NULL, /* Org Id of the Bill Rate at Project Level */
227 p_project_bill_rate_org_id IN NUMBER DEFAULT NULL, /* Org Id of the Bill Rate at task Level */
228 p_non_labor_resource IN VARCHAR2 DEFAULT NULL,
229 p_NLR_organization_id IN NUMBER DEFAULT NULL, /* Org Id of the Non Labor Resource */
230 p_non_labor_sch_type IN VARCHAR2 , /* Revenue Non_Labor Schedule Type B/I */
231 p_project_sch_date IN DATE DEFAULT NULL, /* Revenue Non_Labor Schedule Date at project Level */
232 p_task_sch_date IN DATE DEFAULT NULL, /* Revenue Non_Labor Schedule Date at task Level */
233 p_project_sch_discount IN NUMBER DEFAULT NULL , /* Revenue Non_Labor Schedule Discount at project Level */
234 p_task_sch_discount IN NUMBER DEFAULT NULL , /* Revenue Non_Labor Schedule Discount at task Level */
235 p_revenue_override_rate IN NUMBER DEFAULT NULL, /*override rate if not null no call to billing internal api.*/
236 p_override_currency_code IN VARCHAR2 DEFAULT NULL, /*override currency Code */
237 p_txn_currency_code IN VARCHAR2 DEFAULT NULL, /* if not null, amounts to be returned in this currency only else in x_txn_curr_code*/
238 p_raw_cost IN NUMBER, /*If p_raw_cost is only passed,return the burden multiplier, burden_cost */
239 p_burden_cost IN NUMBER DEFAULT NULL,
240 p_raw_revenue IN NUMBER DEFAULT NULL,
241 p_raw_cost_rate IN NUMBER DEFAULT NULL,
242 x_bill_rate OUT NOCOPY NUMBER,
243 x_raw_revenue OUT NOCOPY NUMBER,
244 x_bill_markup_percentage OUT NOCOPY NUMBER,
245 x_txn_curr_code OUT NOCOPY VARCHAR2,
246 x_return_status OUT NOCOPY VARCHAR2,
247 x_msg_data OUT NOCOPY VARCHAR2,
248 x_msg_count OUT NOCOPY NUMBER
249 );
250
251
252
253
254 --
255 -- Procedure : Get_plan_res_class_rates
256 -- Purpose :This procedure will calculate the raw revenue and bill amount from one of the 12
257 -- criterias on the basis of passed parameters
258 -- Parameters :
259 --
260
261 PROCEDURE Get_plan_res_class_rates (
262 p_project_type IN VARCHAR2,
263 p_project_id IN NUMBER,
264 p_task_id IN NUMBER DEFAULT NULL,
265 p_person_id IN NUMBER,
266 p_job_id IN NUMBER DEFAULT NULL,
267 p_resource_class IN VARCHAR2, /* resource_class_code for Resource Class */
268 p_use_planning_rates_flag IN VARCHAR2 DEFAULT 'N', /* Rate using Actual Rates */
269 p_rate_based_flag IN VARCHAR2 DEFAULT 'Y', /* to identify a rate based transaction */
270 p_uom IN VARCHAR2, /* Planning UOM */
271 p_project_organz_id IN NUMBER DEFAULT NULL, /* For revenue calculation use in Resource Class Sch carrying out*/
272 p_rev_res_class_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on Resource Class*/
273 p_cost_res_class_rate_sch_id IN NUMBER DEFAULT NULL, /* For Cost Rate Calculations based on Resource Class*/
274 p_plan_burden_cost_sch_id IN NUMBER DEFAULT NULL, /* For Cost Rate Calculations based on burdening for planning*/
275 p_cost_rate_multiplier IN NUMBER DEFAULT 1, /* p_bill_rate_multiplier or p_cost_rate_multiplier */
276 p_bill_rate_multiplier IN NUMBER DEFAULT 1, /* p_bill_rate_multiplier or p_cost_rate_multiplier */
277 p_quantity IN NUMBER,
278 p_item_date IN DATE, /* Used as p_expenditure_item_date for non labor */
279 p_schedule_type IN VARCHAR2 DEFAULT NULL, /* REVENUE OR COST OR NULL , will calculate both cost and Revenue*/
280 p_project_org_id IN NUMBER,
281 p_incurred_by_organz_id IN NUMBER,
282 p_override_to_organz_id IN NUMBER,
283 p_expenditure_org_id IN NUMBER,
284 p_nlr_organization_id IN NUMBER DEFAULT NULL, /* Org Id of the Non Labor Resource */
285 p_override_trxn_cost_rate IN NUMBER DEFAULT NULL, /*p_override_trxn_cost_rate for costing */
286 p_override_burden_cost_rate IN NUMBER DEFAULT NULL, /*override burden multiplier and p_raw_cost is not null calculate x_burden_cost */
287 p_override_trxn_bill_rate IN NUMBER DEFAULT NULL, /*p_override_trxn_bill_rate or for billing */
288 p_override_txn_currency_code IN VARCHAR2 DEFAULT NULL,
289 p_txn_currency_code IN VARCHAR2,
290 p_raw_cost IN NUMBER,
291 p_burden_cost IN NUMBER DEFAULT NULL,
292 p_raw_revenue IN NUMBER DEFAULT NULL,
293 p_system_linkage IN VARCHAR2,
294 p_expenditure_type IN VARCHAR2,
295 x_bill_rate OUT NOCOPY NUMBER,
296 x_cost_rate OUT NOCOPY NUMBER,
297 x_burden_cost_rate OUT NOCOPY NUMBER,
298 x_burden_multiplier OUT NOCOPY NUMBER,
299 x_raw_cost OUT NOCOPY NUMBER,
300 x_burden_cost OUT NOCOPY NUMBER,
301 x_raw_revenue OUT NOCOPY NUMBER,
302 x_bill_markup_percentage OUT NOCOPY NUMBER,
303 x_cost_markup_percentage OUT NOCOPY NUMBER,
304 x_cost_txn_curr_code OUT NOCOPY VARCHAR2,
305 x_rev_txn_curr_code OUT NOCOPY VARCHAR2,
306 x_raw_cost_rejection_code OUT NOCOPY VARCHAR2,
307 x_burden_cost_rejection_code OUT NOCOPY VARCHAR2,
308 x_revenue_rejection_code OUT NOCOPY VARCHAR2,
309 x_cost_ind_compiled_set_id OUT NOCOPY NUMBER,
310 x_return_status OUT NOCOPY VARCHAR2,
311 x_msg_count OUT NOCOPY NUMBER,
312 x_msg_data OUT NOCOPY VARCHAR2);
313
314
315
316 --
317 -- Procedure : Get_plan_plan_Rates
318 -- Purpose : This is an internal procedure for calculating the cost/bill rate and raw cost/burden cost/raw revenue from one of
319 -- the given criteria's on the basis of passed parameters for the 'PLANNING RATES' of Planning Transaction
320 -- Parameters :
321 --
322
323 PROCEDURE Get_plan_plan_Rates ( p_project_id IN NUMBER,
324 p_task_id IN NUMBER DEFAULT NULL,
325 p_top_task_id IN NUMBER DEFAULT NULL, /* for costing top task Id */
326 p_person_id IN NUMBER,
327 p_job_id IN NUMBER, /* for costing p_proj_cost_job_id */
328 p_bill_job_grp_id IN NUMBER DEFAULT NULL,
329 p_resource_class IN VARCHAR2, /* resource_class_code for Resource Class */
330 p_rate_based_flag IN VARCHAR2 DEFAULT 'Y', /* to identify a rate based transaction */
331 p_uom IN VARCHAR2, /* Planning UOM */
332 p_system_linkage IN VARCHAR2,
333 p_project_organz_id IN NUMBER DEFAULT NULL, /* For revenue calc use in Resource Class Sch carrying out Org Id */
334 p_plan_rev_job_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on job for planning*/
335 p_plan_cost_job_rate_sch_id IN NUMBER DEFAULT NULL, /* For Cost Rate Calculations based on job for planning*/
336 p_plan_rev_emp_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on emp for planning*/
337 p_plan_cost_emp_rate_sch_id IN NUMBER DEFAULT NULL, /* For cost Rate Calculations based on emp for planning*/
338 p_plan_rev_nlr_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on non labor for planning*/
339 p_plan_cost_nlr_rate_sch_id IN NUMBER DEFAULT NULL, /* For Cost Rate Calculations based on non labor for planning*/
340 p_plan_burden_cost_sch_id IN NUMBER DEFAULT NULL, /* For Cost Rate Calculations based on burdening for planning*/
341 p_calculate_mode IN VARCHAR2 DEFAULT 'COST_REVENUE' ,/* useed for calculating either only Cost(COST),only Revenue(REVENUE) or both Cost and Revenue(COST_REVENUE) */
342 p_mcb_flag IN VARCHAR2 DEFAULT NULL,
343 p_cost_rate_multiplier IN NUMBER DEFAULT NULL ,
344 p_bill_rate_multiplier IN NUMBER DEFAULT 1,
345 p_quantity IN NUMBER, /* required param for People/Equipment Class */
346 p_item_date IN DATE, /* Used as p_expenditure_item_date for non labor */
347 p_project_org_id IN NUMBER, /* Project Org Id */
348 p_project_type IN VARCHAR2,
349 p_expenditure_type IN VARCHAR2,
350 p_non_labor_resource IN VARCHAR2 DEFAULT NULL,
351 p_incurred_by_organz_id IN NUMBER, /* Incurred By Org Id */
352 p_override_to_organz_id IN NUMBER, /* Override Org Id */
353 p_expenditure_org_id IN NUMBER, /* p_expenditure_OU (p_exp_organization_id in costing) */
354 p_planning_transaction_id IN NUMBER DEFAULT NULL, /* changeed from p_forecast_item_id will passed to client extension */
355 p_nlr_organization_id IN NUMBER DEFAULT NULL, /* Org Id of the Non Labor Resource */
356 p_inventory_item_id IN NUMBER DEFAULT NULL, /* Passed for Inventoty Items */
357 p_BOM_resource_Id IN NUMBER DEFAULT NULL, /* Passed for BOM Resource Id */
358 P_mfc_cost_type_id IN NUMBER DEFAULT 0, /* Manufacturing cost api */
359 P_item_category_id IN NUMBER DEFAULT NULL, /* Manufacturing cost api */
360 p_mfc_cost_source IN NUMBER DEFAULT 1,
361 p_cost_override_rate IN NUMBER DEFAULT NULL, /*override rate if not null no call to costing internal api.*/
362 p_revenue_override_rate IN NUMBER DEFAULT NULL, /*override rate if not null no call to billing internal api.*/
363 p_override_burden_cost_rate IN NUMBER DEFAULT NULL, /*override burden multiplier and p_raw_cost is not null calculate x_burden_cost */
364 p_override_currency_code IN VARCHAR2 DEFAULT NULL, /*override currency Code */
365 p_txn_currency_code IN VARCHAR2 DEFAULT NULL, /* if not null, amounts to be returned in this currency only else in x_txn_curr_code*/
366 p_raw_cost IN NUMBER, /*If p_raw_cost is only passed,return the burden multiplier, burden_cost */
367 p_burden_cost IN NUMBER DEFAULT NULL,
368 p_raw_revenue IN NUMBER DEFAULT NULL,
369 x_bill_rate OUT NOCOPY NUMBER,
370 x_cost_rate OUT NOCOPY NUMBER,
371 x_burden_cost_rate OUT NOCOPY NUMBER,
372 x_burden_multiplier OUT NOCOPY NUMBER,
373 x_raw_cost OUT NOCOPY NUMBER,
374 x_burden_cost OUT NOCOPY NUMBER,
375 x_raw_revenue OUT NOCOPY NUMBER,
376 x_bill_markup_percentage OUT NOCOPY NUMBER,
377 x_cost_txn_curr_code OUT NOCOPY VARCHAR2,
378 x_rev_txn_curr_code OUT NOCOPY VARCHAR2, /* x_txn_currency_code for Labor and x_rev_curr_code for non labor */
379 x_raw_cost_rejection_code OUT NOCOPY VARCHAR2,
380 x_burden_cost_rejection_code OUT NOCOPY VARCHAR2,
381 x_revenue_rejection_code OUT NOCOPY VARCHAR2,
382 x_cost_ind_compiled_set_id OUT NOCOPY NUMBER,
383 x_return_status OUT NOCOPY VARCHAR2,
384 x_msg_data OUT NOCOPY VARCHAR2,
385 x_msg_count OUT NOCOPY NUMBER
386 );
387 -- Procedure : Get_Plan_plan_Rev_Rates
388 -- Purpose : This is an internal procedure for calculating the bill rate and raw revenue from one of
389 -- the given criteria's on the basis of passed parameters for the 'PLANNING RATES' of Planning Transaction
390 -- Parameters :
391 --
392
393 PROCEDURE Get_Plan_plan_Rev_Rates (
394 p_project_id IN NUMBER,
395 p_task_id IN NUMBER DEFAULT NULL,
396 p_person_id IN NUMBER,
397 p_job_id IN NUMBER, /* for costing p_proj_cost_job_id */
398 p_bill_job_grp_id IN NUMBER DEFAULT NULL,
399 p_resource_class IN VARCHAR2, /* resource_class_code for Resource Class */
400 p_rate_based_flag IN VARCHAR2 DEFAULT 'Y', /* to identify a rate based transaction */
401 p_uom IN VARCHAR2, /* Planning UOM */
402 p_system_linkage IN VARCHAR2,
403 p_project_organz_id IN NUMBER DEFAULT NULL, /* For revenue calc use in Resource Class Sch carrying out Org Id */
404 p_plan_rev_job_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on job for planning*/
405 p_plan_rev_emp_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on emp for planning*/
406 p_plan_rev_nlr_rate_sch_id IN NUMBER DEFAULT NULL, /* For Bill Rate Calculations based on non labor for planning*/
407 p_mcb_flag IN VARCHAR2 DEFAULT NULL,
408 p_bill_rate_multiplier IN NUMBER DEFAULT 1,
409 p_quantity IN NUMBER, /* required param for People/Equipment Class */
410 p_item_date IN DATE, /* Used as p_expenditure_item_date for non labor */
411 p_project_org_id IN NUMBER, /* Project Org Id */
412 p_project_type IN VARCHAR2,
413 p_expenditure_type IN VARCHAR2,
414 p_incurred_by_organz_id IN NUMBER, /* Incurred By Org Id */
415 p_override_to_organz_id IN NUMBER, /* Override Org Id */
416 p_expenditure_org_id IN NUMBER, /* p_expenditure_OU (p_exp_organization_id in costing) */
417 p_planning_transaction_id IN NUMBER DEFAULT NULL, /* changeed from p_forecast_item_id will passed to client extension */
418 p_non_labor_resource IN VARCHAR2 DEFAULT NULL,
419 p_NLR_organization_id IN NUMBER DEFAULT NULL, /* Org Id of the Non Labor Resource */
423 p_raw_cost IN NUMBER,
420 p_revenue_override_rate IN NUMBER DEFAULT NULL,
421 p_override_currency_code IN VARCHAR2 DEFAULT NULL, /*override currency Code */
422 p_txn_currency_code IN VARCHAR2 DEFAULT NULL,
424 p_burden_cost IN NUMBER DEFAULT NULL,
425 p_raw_revenue IN NUMBER DEFAULT NULL,
426 x_bill_rate OUT NOCOPY NUMBER,
427 x_raw_revenue OUT NOCOPY NUMBER,
428 x_bill_markup_percentage OUT NOCOPY NUMBER,
429 x_txn_curr_code OUT NOCOPY VARCHAR2,
430 x_return_status OUT NOCOPY VARCHAR2,
431 x_msg_data OUT NOCOPY VARCHAR2,
432 x_msg_count OUT NOCOPY NUMBER
433 );
434
435
436
437
438 END PA_PLAN_REVENUE;
439