DBA Data[Home] [Help]

PACKAGE: APPS.CST_COST_API

Source


1 PACKAGE CST_COST_API AS
2 /* $Header: CSTCAPIS.pls 120.1 2007/11/07 00:11:22 ipineda ship $ */
3 /*#
4  * This package contains Item Cost APIs.
5  * @rep:scope public
6  * @rep:product BOM
7  * @rep:lifecycle active
8  * @rep:displayname Item Cost API
9  * @rep:compatibility S
10  * @rep:category BUSINESS_ENTITY CST_ITEM_COST
11  */
12 
13 -------------------------------------------------------------------------
14 -- get_item_cost()
15 --
16 -- Synopsis:
17 --
18 --   This function returns the item cost for a given item and organization.
19 --   This function accepts only IN parameters, and returns a single value.
20 --   This makes the API simple to call as part of SQL statements.
21 --
22 --   You may also pass either the cost group ID or the cost type ID,
23 --   if you desire more specific cost information.  Do not pass both the
24 --   cost group and the cost type at the same time.
25 --
26 --   For now, pass p_api_version = 1.
27 --
28 --   This API currently does not support the retrieval of specific layer
29 --   costs within a FIFO/LIFO organization.
30 --
31 --
32 -- Code Details:
33 --
34 --   The output of this function is dependent on the primary cost method
35 --   of the organization, and which of the parameters were specified.
36 --   Note that you should never specify both the cost_type_id and
37 --   the cost_group_id together; to not pass a parameter, use NULL.
38 --
39 --   For FIFO/LIFO, the cost group average from CQL is returned.
40 --
41 --   Parameters             | Standard              | Average/FIFO/LIFO
42 --   -----------------------+-----------------------+----------------------
43 --   item, org              | Frozen from CIC       | Default CG from CQL
44 --   item, org, cost_group  | Frozen from CIC       | Specified CG from CQL
45 --   item, org, cost_type   | Specified CT from CIC | Specified CT from CIC
46 --
47 --   The precision parameter is used to determinate what type of rounding
48 --   should be applied to the item cost value that is returned. The number
49 --   specified for this parameter represents the number of decimal digits
50 --   that the output will be rounded to and its defaulted as NULL.
51 --
52 -- Error Conditions:
53 --
54 --   For all errors, the returned value is NULL.
55 --
56 --   The possible error conditions are:
57 --     Invalid item/organization combination.
58 --     Item is not cost enabled.
59 --     Item has no cost in the specified cost group or cost type.
60 ----------------------------------------------------------------------
61 
62 /*#
63  * This function returns the item cost for a given item and organization.
64  * @param p_api_version API version
65  * @param p_inventory_item_id inventory item id
66  * @param p_organization_id organization id
67  * @param p_cost_group_id cost group id
68  * @param p_cost_type_id cost type id
69  * @param p_precision precision
70  * @return Item Cost
71  * @rep:scope public
72  * @rep:lifecycle active
73  * @rep:displayname Get Item Cost
74  * @rep:compatibility S
75  */
76 function get_item_cost (
77         p_api_version         in number,
78         p_inventory_item_id   in number,
79         p_organization_id     in number,
80         p_cost_group_id       in number default NULL,
81         p_cost_type_id        in number default NULL,
82         p_precision	      in number default NULL
83 )
84 return number;
85 
86 
87 END CST_COST_API;