1 PACKAGE pa_rev_ca AS
2 /*$Header: PAXICOSS.pls 120.5 2006/07/25 06:37:08 lveerubh noship $*/
3 /*#
4 * This extension is used to apply your company's business rules to the
5 * cost accrual procedures.
6 * @rep:scope public
7 * @rep:product PA
8 * @rep:lifecycle active
9 * @rep:displayname Cost Accrual[Billing] Extension
10 * @rep:compatibility S
11 * @rep:category BUSINESS_ENTITY PA_PROJECT
12 * @rep:category BUSINESS_ENTITY PA_PROJ_COST
13 * @rep:category BUSINESS_ENTITY PA_REVENUE
14 * @rep:doccd 120pjapi.pdf See the Oracle Projects API's, Client Extensions, and Open Interfaces Reference
15 */
16
17 -- Package specification for cost accrual billing extension template
18
19 -- Specification for main procedure to calculate and generate the cost accrual entries
20 --
21
22 /*#
23 * This is the main procedure for calculating and generating the cost accrual entries.
24 * @param X_project_id The identifier of the project
25 * @rep:paraminfo {@rep:required}
26 * @param X_top_task_id The identifier of the top task
27 * @rep:paraminfo {@rep:required}
28 * @param X_calling_process Specifies whether the revenue or invoice program is calling the
29 * billing extension. The valid values are Revenue or Invoice.
30 * @rep:paraminfo {@rep:required}
31 * @param X_calling_place Specifies whether the billing extension is called in the revenue
32 * or invoice program. The valid values are PRE, POST,REG, or ADJ.
33 * @rep:paraminfo {@rep:required}
34 * @param X_amount Amount of the transaction
35 * @rep:paraminfo {@rep:required}
36 * @param X_percentage Cost accrual percentage
37 * @rep:paraminfo {@rep:required}
38 * @param X_rev_or_bill_date The accrue through date if called by revenue generation, or the
39 * bill through date if called by invoice generation.
40 * @rep:paraminfo {@rep:required}
41 * @param X_billing_assignment_id The identifier of the billing assignment associated with the transaction
42 * @rep:paraminfo {@rep:required}
43 * @param X_billing_extension_id The identifier of the billing extension that is being processed. Use
44 * this to select information (such as descriptive flexfield values) from the billing extension definition.
45 * @rep:paraminfo {@rep:required}
46 * @param X_request_id Request identifier
47 * @rep:paraminfo {@rep:required}
48 * @rep:scope public
49 * @rep:lifecycle active
50 * @rep:displayname Cost Accrual Calculation
51 * @rep:compatibility S
52 */
53 PROCEDURE calc_ca_amt
54 ( X_project_id IN NUMBER,
55 X_top_task_id IN NUMBER DEFAULT NULL,
56 X_calling_process IN VARCHAR2 DEFAULT NULL,
57 X_calling_place IN VARCHAR2 DEFAULT NULL,
58 X_amount IN NUMBER DEFAULT NULL,
59 X_percentage IN NUMBER DEFAULT NULL,
60 X_rev_or_bill_date IN DATE DEFAULT NULL,
61 X_billing_assignment_id IN NUMBER DEFAULT NULL,
62 X_billing_extension_id IN NUMBER DEFAULT NULL,
63 X_request_id IN NUMBER DEFAULT NULL
64 )
65 ;
66
67 --
68 -- Specification for procedure that displays the cost accrual columns in PSI
69 -- Will be invoked from PSI client extension
70 --
71 /*#
72 * This procedure displays the cost accrual columns in Project Status Inquiry.
73 * @param x_project_id The identifier of the project
74 * @rep:paraminfo {@rep:required}
75 * @param x_task_id The identifier of the task
76 * @rep:paraminfo {@rep:required}
77 * @param x_resource_list_member_id Identifier of the resource list member
78 * @rep:paraminfo {@rep:required}
79 * @param x_cost_budget_type_code Cost budget type code
80 * @rep:paraminfo {@rep:required}
81 * @param x_rev_budget_type_code Revenue budget type code
82 * @rep:paraminfo {@rep:required}
83 * @param x_status_view The identifier of the status folder: projects, tasks, or resources
84 * @rep:paraminfo {@rep:required}
85 * @param x_pa_install The identifier of the Oracle Projects product installed:
86 * Oracle Project Billing or Oracle Project Costing. Billing includes all default PSI columns.
87 * Costing includes all except the actual revenue and revenue budget columns.
88 * @rep:paraminfo {@rep:required}
89 * @param x_derived_col_1 The derived columns with alphanumeric values. Each
90 * column can have up to 255 characters.
91 * @rep:paraminfo {@rep:required}
92 * @param x_derived_col_2 The derived columns with alphanumeric values. Each
93 * column can have up to 255 characters.
94 * @rep:paraminfo {@rep:required}
95 * @param x_derived_col_3 The derived columns with alphanumeric values. Each
96 * column can have up to 255 characters.
97 * @rep:paraminfo {@rep:required}
98 * @param x_derived_col_4 The derived columns with numeric values
99 * @rep:paraminfo {@rep:required}
100 * @param x_derived_col_5 The derived columns with numeric values
101 * @rep:paraminfo {@rep:required}
102 * @param x_derived_col_6 The derived columns with numeric values
103 * @rep:paraminfo {@rep:required}
104 * @param x_derived_col_7 The derived columns with numeric values
105 * @rep:paraminfo {@rep:required}
106 * @param x_derived_col_8 The derived columns with numeric values
107 * @rep:paraminfo {@rep:required}
108 * @param x_derived_col_9 The derived columns with numeric values
109 * @rep:paraminfo {@rep:required}
110 * @param x_derived_col_10 The derived columns with numeric values
111 * @rep:paraminfo {@rep:required}
112 * @param x_derived_col_11 The derived columns with numeric values
113 * @rep:paraminfo {@rep:required}
114 * @param x_derived_col_12 The derived columns with numeric values
115 * @rep:paraminfo {@rep:required}
116 * @param x_derived_col_13 The derived columns with numeric values
117 * @rep:paraminfo {@rep:required}
118 * @param x_derived_col_14 The derived columns with numeric values
119 * @rep:paraminfo {@rep:required}
120 * @param x_derived_col_15 The derived columns with numeric values
121 * @rep:paraminfo {@rep:required}
122 * @param x_derived_col_16 The derived columns with numeric values
123 * @rep:paraminfo {@rep:required}
124 * @param x_derived_col_17 The derived columns with numeric values
125 * @rep:paraminfo {@rep:required}
126 * @param x_derived_col_18 The derived columns with numeric values
127 * @rep:paraminfo {@rep:required}
128 * @param x_derived_col_19 The derived columns with numeric values
129 * @rep:paraminfo {@rep:required}
130 * @param x_derived_col_20 The derived columns with numeric values
131 * @rep:paraminfo {@rep:required}
132 * @param x_derived_col_21 The derived columns with numeric values
133 * @rep:paraminfo {@rep:required}
134 * @param x_derived_col_22 The derived columns with numeric values
135 * @rep:paraminfo {@rep:required}
136 * @param x_derived_col_23 The derived columns with numeric values
137 * @rep:paraminfo {@rep:required}
138 * @param x_derived_col_24 The derived columns with numeric values
139 * @rep:paraminfo {@rep:required}
140 * @param x_derived_col_25 The derived columns with numeric values
141 * @rep:paraminfo {@rep:required}
142 * @param x_derived_col_26 The derived columns with numeric values
143 * @rep:paraminfo {@rep:required}
144 * @param x_derived_col_27 The derived columns with numeric values
145 * @rep:paraminfo {@rep:required}
146 * @param x_derived_col_28 The derived columns with numeric values
147 * @rep:paraminfo {@rep:required}
148 * @param x_derived_col_29 The derived columns with numeric values
149 * @rep:paraminfo {@rep:required}
150 * @param x_derived_col_30 The derived columns with numeric values
151 * @rep:paraminfo {@rep:required}
152 * @param x_derived_col_31 The derived columns with numeric values
153 * @rep:paraminfo {@rep:required}
154 * @param x_derived_col_32 The derived columns with numeric values
155 * @rep:paraminfo {@rep:required}
156 * @param x_derived_col_33 The derived columns with numeric values
157 * @rep:paraminfo {@rep:required}
158 * @param p_revenue_ptd Percentage for accruing period-to-date revenue
159 * @rep:paraminfo {@rep:required}
160 * @param p_revenue_itd Percentage for accruing inception-to-date revenue
161 * @rep:paraminfo {@rep:required}
162 * @rep:scope public
163 * @rep:lifecycle active
164 * @rep:displayname PSI Cost Accrual
165 * @rep:compatibility S
166 */
167
168
169
170 PROCEDURE get_psi_cols (
171 x_project_id IN NUMBER
172 , x_task_id IN NUMBER
173 , x_resource_list_member_id IN NUMBER
174 , x_cost_budget_type_code IN VARCHAR2
175 , x_rev_budget_type_code IN VARCHAR2
176 , x_status_view IN VARCHAR2
177 , x_pa_install IN VARCHAR2
178 , x_derived_col_1 OUT NOCOPY VARCHAR2
179 , x_derived_col_2 OUT NOCOPY VARCHAR2
180 , x_derived_col_3 OUT NOCOPY VARCHAR2
181 , x_derived_col_4 OUT NOCOPY NUMBER
182 , x_derived_col_5 OUT NOCOPY NUMBER
183 , x_derived_col_6 OUT NOCOPY NUMBER
184 , x_derived_col_7 OUT NOCOPY NUMBER
185 , x_derived_col_8 OUT NOCOPY NUMBER
186 , x_derived_col_9 OUT NOCOPY NUMBER
187 , x_derived_col_10 OUT NOCOPY NUMBER
188 , x_derived_col_11 OUT NOCOPY NUMBER
189 , x_derived_col_12 OUT NOCOPY NUMBER
190 , x_derived_col_13 OUT NOCOPY NUMBER
191 , x_derived_col_14 OUT NOCOPY NUMBER
192 , x_derived_col_15 OUT NOCOPY NUMBER
193 , x_derived_col_16 OUT NOCOPY NUMBER
194 , x_derived_col_17 OUT NOCOPY NUMBER
195 , x_derived_col_18 OUT NOCOPY NUMBER
196 , x_derived_col_19 OUT NOCOPY NUMBER
197 , x_derived_col_20 OUT NOCOPY NUMBER
198 , x_derived_col_21 OUT NOCOPY NUMBER
199 , x_derived_col_22 OUT NOCOPY NUMBER
200 , x_derived_col_23 OUT NOCOPY NUMBER
201 , x_derived_col_24 OUT NOCOPY NUMBER
202 , x_derived_col_25 OUT NOCOPY NUMBER
203 , x_derived_col_26 OUT NOCOPY NUMBER
204 , x_derived_col_27 OUT NOCOPY NUMBER
205 , x_derived_col_28 OUT NOCOPY NUMBER
206 , x_derived_col_29 OUT NOCOPY NUMBER
207 , x_derived_col_30 OUT NOCOPY NUMBER
208 , x_derived_col_31 OUT NOCOPY NUMBER
209 , x_derived_col_32 OUT NOCOPY NUMBER
210 , x_derived_col_33 OUT NOCOPY NUMBER
211 , p_revenue_ptd IN NUMBER
212 , p_revenue_itd IN NUMBER
213 );
214 --
215 -- Specification for procedure that pre-requisites before project close
216 -- for cost accrual.
217 -- Will be invoked from the project status change client extension
218 --
219
220 /*#
221 * This procedure is called when a user changes the projects status.
222 * @param x_calling_module Module from which the extension is called
223 * @rep:paraminfo {@rep:required}
224 * @param X_project_id The identifier of the project
225 * @rep:paraminfo {@rep:required}
226 * @param X_old_proj_status_code Existing status code for the project
227 * @rep:paraminfo {@rep:required}
228 * @param X_new_proj_status_code New status code for the project
229 * @rep:paraminfo {@rep:required}
230 * @param X_project_type Project type of the project
231 * @rep:paraminfo {@rep:required}
232 * @param X_project_start_date Start date of the project
233 * @rep:paraminfo {@rep:required}
234 * @param X_project_end_date End date of the project
235 * @rep:paraminfo {@rep:required}
236 * @param X_public_sector_flag Flag indicating the public sector
237 * @rep:paraminfo {@rep:required}
238 * @param X_attribute_category Descriptive flexfield category
239 * @rep:paraminfo {@rep:required}
240 * @param X_attribute1 Descriptive flexfield segment
241 * @rep:paraminfo {@rep:required}
242 * @param X_attribute2 Descriptive flexfield segment
243 * @rep:paraminfo {@rep:required}
244 * @param X_attribute3 Descriptive flexfield segment
245 * @rep:paraminfo {@rep:required}
246 * @param X_attribute4 Descriptive flexfield segment
247 * @rep:paraminfo {@rep:required}
248 * @param X_attribute5 Descriptive flexfield segment
249 * @rep:paraminfo {@rep:required}
250 * @param X_attribute6 Descriptive flexfield segment
251 * @rep:paraminfo {@rep:required}
252 * @param X_attribute7 Descriptive flexfield segment
253 * @rep:paraminfo {@rep:required}
254 * @param X_attribute8 Descriptive flexfield segment
255 * @rep:paraminfo {@rep:required}
256 * @param X_attribute9 Descriptive flexfield segment
257 * @rep:paraminfo {@rep:required}
258 * @param X_attribute10 Descriptive flexfield segment
259 * @rep:paraminfo {@rep:required}
260 * @param x_pm_product_code The project management product code
261 * @rep:paraminfo {@rep:required}
262 * @param x_err_code The error handling code
263 * @rep:paraminfo {@rep:required}
264 * @param x_warnings_only_flag Flag indicating if the procedure had only warning messages
265 * @rep:paraminfo {@rep:required}
266 * @rep:scope public
267 * @rep:lifecycle active
268 * @rep:displayname Verify Project Status for Cost Accrual
269 * @rep:compatibility S
270 */
271
272
273 PROCEDURE Verify_Project_Status_CA
274 (x_calling_module IN VARCHAR2
275 ,X_project_id IN NUMBER
276 ,X_old_proj_status_code IN VARCHAR2
277 ,X_new_proj_status_code IN VARCHAR2
278 ,X_project_type IN VARCHAR2
279 ,X_project_start_date IN DATE
280 ,X_project_end_date IN DATE
281 ,X_public_sector_flag IN VARCHAR2
282 ,X_attribute_category IN VARCHAR2
283 ,X_attribute1 IN VARCHAR2
284 ,X_attribute2 IN VARCHAR2
285 ,X_attribute3 IN VARCHAR2
286 ,X_attribute4 IN VARCHAR2
287 ,X_attribute5 IN VARCHAR2
288 ,X_attribute6 IN VARCHAR2
289 ,X_attribute7 IN VARCHAR2
290 ,X_attribute8 IN VARCHAR2
291 ,X_attribute9 IN VARCHAR2
292 ,X_attribute10 IN VARCHAR2
293 ,x_pm_product_code IN VARCHAR2
294 ,x_err_code OUT NOCOPY NUMBER
295 ,x_warnings_only_flag OUT NOCOPY VARCHAR2
296 );
297 --
298 -- Procedure that checks if project has cost accrual and sets the
299 -- variables from attribute columns 11-15 of billing extension
300 --
301
302 /*#
303 * This procedure checks whether a project has cost accrual, and sets the
304 * variables from attribute columns 11 through 15 of the billing extension.
305 * @param p_project_id The identifier of the project
306 * @rep:paraminfo {@rep:required}
307 * @param x_cost_accrual_flag Flag indicating if the project has cost accrual
308 * @rep:paraminfo {@rep:required}
309 * @param x_funding_flag Flag indicating whether the project has funding
310 * @rep:paraminfo {@rep:required}
311 * @param x_ca_event_type Cost accrual event type
312 * @rep:paraminfo {@rep:required}
313 * @param x_ca_contra_event_type Cost accrual contra event type
314 * @rep:paraminfo {@rep:required}
315 * @param x_ca_wip_event_type Cost accrual WIP event type
316 * @rep:paraminfo {@rep:required}
317 * @param x_ca_budget_type Cost accrual budget type
318 * @rep:paraminfo {@rep:required}
319 * @rep:scope public
320 * @rep:lifecycle active
321 * @rep:displayname Check Cost Accrual
322 * @rep:compatibility S
323 */
324 PROCEDURE Check_if_Cost_Accrual ( p_project_id IN NUMBER
325 ,x_cost_accrual_flag IN OUT NOCOPY VARCHAR2
326 ,x_funding_flag IN OUT NOCOPY VARCHAR2
327 ,x_ca_event_type IN OUT NOCOPY VARCHAR2
328 ,x_ca_contra_event_type IN OUT NOCOPY VARCHAR2
329 ,x_ca_wip_event_type IN OUT NOCOPY VARCHAR2
330 ,x_ca_budget_type IN OUT NOCOPY VARCHAR2
331 );
332
333 END pa_rev_ca;