DBA Data[Home] [Help]

PACKAGE: APPS.PO_CUSTOM_PRICE_PUB

Source


1 PACKAGE PO_CUSTOM_PRICE_PUB AS
2 /* $Header: POXPCPRS.pls 120.3.12010000.6 2008/09/29 07:41:38 lswamina ship $ */
3 /*#
4  * Provide the ability to perform custom pricing on Oracle Purchasing
5  * documents directly through an API.
6  *
7  * @rep:scope public
8  * @rep:product PO
9  * @rep:displayname Purchase Order Custom Pricing APIs
10  */
11 
12 
13 /*#
14  * Provides the ability to customize the pricing date through an API.
15  *
16  * The API is called by the Oracle Requisition Pricing API and
17  * PO/Release Pricing API that would use the pricing date to fetch the
18  * price.  Prices of products in catalogs may not be static and can
19  * vary with time due to various factors: supply/demand variations,
20  * buying volume, and component price variations.
21  *
22  * The variation of price of a product with time is actually captured
23  * in terms of price and effective periods in the form of price breaks
24  * on blanket purchase agreements and catalog quotations. Price list
25  * lines in Oracle Advanced Pricing can also have effective periods
26  * defined.
27  *
28  * Based on the supplier agreement, the price of the product being
29  * ordered or requested from the catalog may be determined based on the
30  * price that is effective on the pricing date. The pricing date can be
31  * the date that the order is placed, the date that the order is
32  * shipped, or the date that the material is expected to arrive. Rules
33  * around determining the pricing date widely vary from one business to
34  * another and even within a business from one commodity to another.
35  *
36  * Businesses can add PL/SQL code to the custom API that can
37  * accommodate their own special rules to determine the pricing date.
38  * The subsequent pricing call will return the unit price from the
39  * source blanket or quotation that is effective on the pricing date.
40  *
41  * @param p_api_version Null not allowed.  Value should match the
42  * current version of the API (currently 1.0). Used by the API to
43  * determine compatibility of API and calling program.
44  * @rep:paraminfo  {@rep:required}
45  *
46  * @param p_source_document_header_id Internal ID for source document
47  * header. (i.e. PO_LINES_ALL.po_header_id)
48  * @rep:paraminfo  {@rep:required}
49  *
50  * @param p_source_document_line_id Internal ID for source document
51  * line. (i.e. PO_LINES_ALL.po_line_id)
52  * @rep:paraminfo  {@rep:required}
53  *
54  * @param p_order_line_id Internal ID for an order line. (i.e.
55  * PO_HEADERS_ALL.po_header_id)
56  * @rep:paraminfo  {@rep:required}
57  *
58  * @param p_quantity Quantity
59  * @rep:paraminfo  {@rep:required}
60  *
61  * @param p_ship_to_location_id Ship to location ID
62  * @rep:paraminfo  {@rep:required}
63  *
64  * @param p_ship_to_organization_id Ship to organization ID
65  * @rep:paraminfo  {@rep:required}
66  *
67  * @param p_need_by_date Need by date
68  * @rep:paraminfo  {@rep:required}
69  *
70  * @param x_pricing_date New custom pricing date
71  * @rep:paraminfo  {@rep:required}
72  *
73  * @param x_return_status Possible Values are:
74  * S = Success - Completed without errors.
75  * E = Error - Parameters are in error.
76  * U = Unexpected error.
77  * Bug5598011 @param p_order_type Adding new parameter p_order_type which will
78  * indicate if the order document is PO or REQUISITION
79 
80  * @rep:displayname Get custom price date
81  *
82  * @rep:category BUSINESS_ENTITY PO_STANDARD_PURCHASE_ORDER
83  * @rep:category BUSINESS_ENTITY PO_BLANKET_RELEASE
84  * @rep:category BUSINESS_ENTITY PO_PURCHASE_REQUISITION
85  * @rep:category BUSINESS_ENTITY PO_INTERNAL_REQUISITION
86  */
87 PROCEDURE GET_CUSTOM_PRICE_DATE(p_api_version			IN  NUMBER,
88                                 p_source_document_header_id	IN  NUMBER,   -- <FPJ Advanced Price>
89                                 p_source_document_line_id	IN  NUMBER,
90                                 p_order_line_id			IN  NUMBER, -- <Bug 3754828>
91                                 p_quantity			IN  NUMBER,
92                                 p_ship_to_location_id		IN  NUMBER,
93                                 p_ship_to_organization_id	IN  NUMBER,
94                                 p_need_by_date			IN  DATE,
95                                 x_pricing_date			OUT NOCOPY DATE,
96                                 x_return_status			OUT NOCOPY VARCHAR2,
97 				p_order_type                    IN VARCHAR2 DEFAULT NULL); -- <Bug5598011>
98 
99 
100 /*#
101  * Provides the ability to customize the requisition price through an
102  * API.
103  *
104  * This API is called by the Oracle Requisition Pricing API that could
105  * return a different price than what the Oracle Requisition Pricing
106  * API has returned.
107  *
108  * Often times the price maintained on supplier catalogs are purely
109  * list prices and does not factor in adjustments such as discounts or
110  * surcharges as negotiated between a specific buyer and supplier.
111  *
112  * The Custom Requisition Pricing API enables you to add PL/SQL code to
113  * a new custom price adjustment hook in the standard requisition
114  * pricing API to adjust the price as determined from a source document
115  * (blanket agreement or quotation). This provides a mechanism to
116  * factor in negotiated discounts, surcharges, or other adjustments on
117  * top of the catalog prices.
118  *
119  * @param p_api_version Null not allowed. Value should match the
120  * current version of the API (currently 1.0). Used by the API to
121  * determine compatibility of API and calling program.
122  * @rep:paraminfo  {@rep:required}
123  *
124  * @param p_source_document_header_id Internal ID for source document
125  * header. (i.e. PO_LINES_ALL.po_header_id)
126  * @rep:paraminfo  {@rep:required}
127  *
128  * @param p_source_document_line_num Line number for source document
129  * line. (i.e. PO_LINES_ALL.po_line_id)
130  * @rep:paraminfo  {@rep:required}
131  *
132  * @param p_order_line_id Internal ID for an order line. (i.e.
133  * PO_HEADERS_ALL.po_header_id)
134  * @rep:paraminfo  {@rep:required}
135  *
136  * @param p_quantity Quantity
137  * @rep:paraminfo  {@rep:required}
138  *
139  * @param p_unit_of_measure Unit of Measure
140  * @rep:paraminfo  {@rep:required}
141  *
142  * @param p_deliver_to_location_id Deliver to location ID
143  * @rep:paraminfo  {@rep:required}
144  *
145  * @param p_required_currency Required currency
146  * @rep:paraminfo  {@rep:required}
147  *
148  * @param p_required_rate_type Required rate type
149  * @rep:paraminfo  {@rep:required}
150  *
151  * @param p_need_by_date Need by date
152  * @rep:paraminfo  {@rep:required}
153  *
154  * @param p_pricing_date Pricing date
155  * @rep:paraminfo  {@rep:required}
156  *
157  * @param p_destination_org_id Destination organization ID
158  * @rep:paraminfo  {@rep:required}
159  *
160  * @param p_currency_price Currency price
161  * @rep:paraminfo  {@rep:required}
162  *
163  * @param x_new_currency_price New customized price
164  * @rep:paraminfo  {@rep:required}
165  *
166  * @param x_return_status Possible Values are:
167  * S = Success - Completed without errors.
168  * E = Error - Parameters are in error.
169  * U = Unexpected error.
170  * @rep:paraminfo  {@rep:required}
171  *
172  * @rep:displayname Get custom requisition price
173  *
174  * @rep:category BUSINESS_ENTITY PO_PURCHASE_REQUISITION
175  * @rep:category BUSINESS_ENTITY PO_INTERNAL_REQUISITION
176  */
177 PROCEDURE GET_CUSTOM_REQ_PRICE(p_api_version			IN  NUMBER,
178                                p_source_document_header_id	IN  NUMBER,
179                                p_source_document_line_num	IN  NUMBER,
180                                p_order_line_id			IN  NUMBER, -- <Bug 3754828>
181                                p_quantity			IN  NUMBER,
182                                p_unit_of_measure		IN  VARCHAR2,
183                                p_deliver_to_location_id		IN  NUMBER,
184                                p_required_currency		IN  VARCHAR2,
185                                p_required_rate_type		IN  VARCHAR2,
186                                p_need_by_date			IN  DATE,
187                                p_pricing_date			IN  DATE,
188                                p_destination_org_id		IN  NUMBER,
189                                p_currency_price			IN  NUMBER,
190                                x_new_currency_price		OUT NOCOPY NUMBER,
191                                x_return_status			OUT NOCOPY VARCHAR2);
192 
193 /*#
194  * Provides the ability to customize PO/Release price through an API.
195  *
196  * The API is called by the Oracle PO/Release Pricing API that could
197  * return a different price than what the Oracle PO/Release Pricing API
198  * has returned.
199  *
200  * The Custom PO/Release Pricing API enables you to add PL/SQL code to
201  * a custom price adjustment hook in the standard PO/Release Pricing
202  * API that can adjust the unit price as determined from a source
203  * document (blanket agreement or quotation). This provides a mechanism
204  * to factor in negotiated discounts, surcharges, or other adjustments
205  * on top of the catalog prices.
206  *
207  * @param p_api_version Null not allowed. Value should match the
208  * current version of the API (currently 1.0). Used by the API to
209  * determine compatibility of API and calling program.
210  * @rep:paraminfo  {@rep:required}
211  *
212  * @param p_order_quantity Order quantity
213  * @rep:paraminfo  {@rep:required}
214  *
215  * @param p_ship_to_org Ship to organization
216  * @rep:paraminfo  {@rep:required}
217  *
218  * @param p_ship_to_loc Ship to location
219  * @rep:paraminfo  {@rep:required}
220  *
221  * @param p_po_line_id Internal ID for PO Line. (i.e.
222  * PO_LINES_ALL.po_line_id)
223  * @rep:paraminfo  {@rep:required}
224  *
225  * @param p_cum_flag Cumulative flag
226  * @rep:paraminfo  {@rep:required}
227  *
228  * @param p_need_by_date Need by date
229  * @rep:paraminfo  {@rep:required}
230  *
231  * @param p_pricing_date Pricing date
232  * @rep:paraminfo  {@rep:required}
233  *
234  * @param p_line_location_id Internal ID for PO Shipment. (i.e.
235  * PO_LINE_LOCATIONS_ALL.line_location_id)
236  * @rep:paraminfo  {@rep:required}
237  *
238  * @param p_price Calculated price
239  * @rep:paraminfo  {@rep:required}
240  *
241  * @param x_new_price New customized price
242  * @rep:paraminfo  {@rep:required}
243  *
244  * @param x_return_status Possible Values are:
245  * S = Success - Completed without errors.
246  * E = Error - Parameters are in error.
247  * U = Unexpected error.
248  * @rep:paraminfo  {@rep:required}
249  *
250  * @rep:displayname Get custom purchase order price
251  *
252  * @rep:category BUSINESS_ENTITY PO_STANDARD_PURCHASE_ORDER
253  * @rep:category BUSINESS_ENTITY PO_BLANKET_RELEASE
254  */
255 PROCEDURE GET_CUSTOM_PO_PRICE(p_api_version		IN NUMBER,
256                               p_order_quantity		IN NUMBER,
257                               p_ship_to_org		IN NUMBER,
258                               p_ship_to_loc		IN NUMBER,
259                               p_po_line_id		IN NUMBER,
260                               p_cum_flag		IN BOOLEAN,
261                               p_need_by_date		IN DATE,
262                               p_pricing_date		IN DATE,
263                               p_line_location_id	IN NUMBER,
264                               p_price			IN NUMBER,
265                               x_new_price		OUT NOCOPY NUMBER,
266                               x_return_status		OUT NOCOPY VARCHAR2,
267                               p_req_line_price IN NUMBER DEFAULT NULL); --< Bug 7154646 >
268 
269 -- <Bug 3794940 START>
270 /* Bug 7154646 Adding the parameter p_req_line_price to retain the Req Line Price, if Required. */
271 /*#
272  * Provides the ability to audit advanced pricing adjustments during pricing
273  * API call
274  *
275  * The API is called by the Oracle PO/Release Pricing API after invoking
276  * advanced pricing engine.
277  *
278  * The information about pricing adjustments is stored in temporary view
279  * QP_LDETS_V. To get the records, user should query this view for the records
280  * that satisfy the following:
281  *  qp_ldets_v.line_index = p_line_index AND
282  *  qp_ldets_v.automatic_flag = 'Y'
283  *
284  * @param p_api_version Null not allowed. Value should match the
285  * current version of the API (currently 1.0). Used by the API to
286  * determine compatibility of API and calling program.
287  * @rep:paraminfo  {@rep:required}
288  *
289  * @param p_order_type Type of the document ('PO' or 'REQUISITION')
290  * @rep:paraminfo  {@rep:required}
291  *
292  * @param p_order_line_id Line ID of the document (po line or requisition line)
293  * @rep:paraminfo  {@rep:required}
294  *
295  * @param p_line_index The index of pricing adjustments stored in
296  * temporary view QP_LDETS_V.
297  * @rep:paraminfo  {@rep:required}
298  *
299  * @param x_return_status Return status of the API. Possible Values are:
300  * S = Success - Completed without errors.
301  * E = Error - Parameters are in error.
302  * U = Unexpected error.
303  * @rep:paraminfo  {@rep:required}
304  *
305  * @param x_msg_count Number of messages added to FND_MSG_PUB message stack, if
306  * used
307  * @rep:paraminfo  {@rep:required}
308  *
309  * @param x_msg_data If x_msg_count = 1, this output parameter should return
310  * the text of the message
311  * @rep:paraminfo  {@rep:required}
312  *
313  * @rep:displayname Audit advanced pricing adjustments
314  *
315  * @rep:category BUSINESS_ENTITY PO_PURCHASE_REQUISITION
316  * @rep:category BUSINESS_ENTITY PO_STANDARD_PURCHASE_ORDER
317  */
318 PROCEDURE audit_qp_price_adjustment(p_api_version       IN  NUMBER,
319                                     p_order_type        IN  VARCHAR2,
320                                     p_order_line_id     IN  NUMBER,
321                                     p_line_index        IN  NUMBER,
322                                     x_return_status     OUT NOCOPY VARCHAR2,
323                                     x_msg_count         OUT NOCOPY NUMBER,
324                                     x_msg_data          OUT NOCOPY VARCHAR2);
325 -- <Bug 3794940 END>
326 -- < Bug 7430760 START>
327 /*#
328  * This procedure provides for fetching custom unit price for an inventory item
329  * on an internal requisition based on the item, source and destination inventories
330  * and unit of measure. The parameters are
331 
332  * IN PARAMETERS
333  *
334  * @param p_api_version p_api_version : Null not allowed. Value should match the
335  * current version of the API (currently 1.0). Used by the API to
336  * determine compatibility of API and calling program.
337  * @rep:paraminfo  {@rep:required}
338  *
339  * @param p_item_id : inventory item id of the item for which custom price is fetched
340  * @rep:paraminfo  {@rep:required}
341  *
342  * @param p_category_id : category id of the item for which custom price is fetched
343  * @rep:paraminfo  {@rep:required}
344  *
345  * @param p_req_header_id : Header id of the requisition
346  * @rep:paraminfo  {@rep:required}
347  *
348  * @param p_req_line_id : Line of the requisition line
349  * @rep:paraminfo  {@rep:required}
350  *
351  * @param p_src_organization_id : source inventory organization of the requisition line
352  * @rep:paraminfo  {@rep:required}
353  *
354  * @param p_src_sub_inventory : Source sub inventory
355  * @rep:paraminfo  {@rep:required}
356  *
357  * @param p_dest_organization_id : destination inventory organization of the requisition line
358  * @rep:paraminfo  {@rep:required}
359  *
360  * @param p_dest_sub_inventory : destination sub inventory
361  * @rep:paraminfo  {@rep:required}
362  *
363  * @param p_deliver_to_location_id : deliver to location in the destination organization
364  * @rep:paraminfo  {@rep:required}
365  *
366  * @param p_need_by_date : need by date
367  * @rep:paraminfo  {@rep:required}
368  *
369  * @param p_unit_of_measure : unit of measure of the requisition line
370  * @rep:paraminfo  {@rep:required}
371  *
372  * @param p_quantity : quantity
373  * @rep:paraminfo  {@rep:required}
374  *
375  * @param p_currency_code : currency code of the source organization
376  * @rep:paraminfo  {@rep:required}
377  *
378  * @param p_rate : Rate of conversion of p_currency_code to fsp currency code
379  * @rep:paraminfo  {@rep:required}
380  *
381  * @param p_rate_type : type of conversion
382  * @rep:paraminfo  {@rep:required}
383  *
384  * @param p_rate_date : date of conversion
385  * @rep:paraminfo  {@rep:required}
386  *
387  * OUT PARAMETERS
388  *
389  * @param x_return_status
390  * FND_API.G_RET_STS_SUCCESS if API succeeds
391  * FND_API.G_RET_STS_ERROR if API fails
392  * FND_API.G_RET_STS_UNEXP_ERROR if unexpected error occurs
393  * @rep:paraminfo  {@rep:required}
394  *
395  * IN OUT PARAMETERS
396  *
397  * @param x_unit_price
398  * custom price if the custom code is in place
399  * system price if the custom code is not in place
400  * @rep:paraminfo  {@rep:required}
401  *
402  * @rep:displayname Get custom Internal Requisition Price
403  *
407 
404  * @rep:category BUSINESS_ENTITY PO_INTERNAL_REQUISITION
405  *
406  */
408 PROCEDURE GET_CUST_INTERNAL_REQ_PRICE(p_api_version             IN     NUMBER,
409                                       p_item_id                 IN     NUMBER DEFAULT NULL,
410                                       p_category_id             IN     NUMBER DEFAULT NULL,
411                                       p_req_header_id           IN     NUMBER DEFAULT NULL,
412                                       p_req_line_id             IN     NUMBER DEFAULT NULL,
413                                       p_src_organization_id     IN     NUMBER DEFAULT NULL,
414 				      p_src_sub_inventory       IN     VARCHAR2 DEFAULT NULL,
415                                       p_dest_organization_id    IN     NUMBER DEFAULT NULL,
416 				      p_dest_sub_inventory      IN     VARCHAR2 DEFAULT NULL,
417 				      p_deliver_to_location_id  IN     NUMBER DEFAULT NULL,
418 				      p_need_by_date            IN     DATE DEFAULT NULL,
419 				      p_unit_of_measure         IN     VARCHAR2 DEFAULT NULL,
420 				      p_quantity                IN     NUMBER DEFAULT NULL,
421 				      p_currency_code           IN     VARCHAR2 DEFAULT NULL,
422 				      p_rate                    IN     NUMBER DEFAULT NULL,
423 				      p_rate_type               IN     VARCHAR2 DEFAULT NULL,
424 				      p_rate_date               IN     DATE DEFAULT NULL,
425 				      x_return_status           OUT NOCOPY VARCHAR2,
426                                       x_unit_price              IN OUT NOCOPY NUMBER
427 				      );
428 
429 -- < Bug 7430760 END>
430 
431 END PO_CUSTOM_PRICE_PUB; -- Package spec