1 PACKAGE CST_Inventory_PVT AUTHID CURRENT_USER AS
2 /* $Header: CSTVIVTS.pls 120.5 2010/05/24 22:08:25 anjha ship $ */
3 /* Defining the Global variables */
4 g_run_onhand_date DATE;
5 g_run_receiving_date DATE;
6 g_run_incmng_intransit_date DATE;
7 g_run_outgng_intransit_date DATE;
8
9 -- Start of comments
10 -- API name : Populate_ItemList
11 -- Type : Private
12 -- Pre-reqs : None
13 -- Function : Populates temporary table CST_ITEM_LIST_TEMP with the
14 -- items that match the given specifications
15 -- Parameters : p_api_version IN NUMBER Required
16 -- p_organization_id IN NUMBER Required
17 -- p_cost_type_id IN NUMBER
18 -- This parameter indicates the cost type against which
19 -- the asset status of the item is verified.
20 -- p_item_from IN VARCHAR2
21 -- p_item_to IN VARCHAR2
22 -- p_category_set_id IN NUMBER Required
23 -- p_category_from IN VARCHAR2
24 -- p_category_to IN VARCHAR2
25 -- p_zero_cost_only IN NUMBER
26 -- This parameter restricts the range of items to
27 -- those with zero item costs.
28 -- p_expense_item IN NUMBER
29 -- This parameter indicates whether to include expense
30 -- items.
31 -- p_cost_enabled_only IN NUMBER
32 -- This parameter restricts the items to include cost
33 -- enabled items only. If 1, only cost enabled items
34 -- will be included. Otherwise, all items including
35 -- non-cost enabled items will be included - in which case
36 -- all items in the range, regardless of whether they are
37 -- expense or have zero cost, will be included.
38 -- p_one_time_item IN NUMBER
39 -- If this parameter is 1, indicates that a row with null
40 -- item id should be included for one-time items. When called from
41 -- the Receiving Value Report, the parameter should be 1 so as
42 -- to include one-time (description) items. If any value other
43 -- than 1, one-time items will not be included.
44 -- x_return_status OUT NOCOPY VARCHAR2 Required
45 -- Version : Current version 1.0
46 -- Initial version 1.0
47 -- End of comments
48 PROCEDURE Populate_ItemList(
49 p_api_version IN NUMBER,
50 p_organization_id IN NUMBER,
51 p_cost_type_id IN NUMBER := NULL,
52 p_item_from IN VARCHAR2 := NULL,
53 p_item_to IN VARCHAR2 := NULL,
54 p_category_set_id IN NUMBER,
55 p_category_from IN VARCHAR2 := NULL,
56 p_category_to IN VARCHAR2 := NULL,
57 p_zero_cost_only IN NUMBER := NULL,
58 p_expense_item IN NUMBER := NULL,
59 p_cost_enabled_only IN NUMBER := NULL,
60 p_one_time_item IN NUMBER := NULL,
61 x_return_status OUT NOCOPY VARCHAR2
62 );
63
64 -- Start of comments
65 -- API name : Populate_CostGroupList
66 -- Type : Private
67 -- Pre-reqs : None
68 -- Function : Populates temporary table CST_CG_LIST_TEMP with the cost
69 -- groups that match the given specifications.
70 -- Parameters : p_api_version IN NUMBER Required
71 -- p_organization_id IN NUMBER Required
72 -- p_cost_group_from IN VARCHAR2
73 -- p_cost_group_to IN VARCHAR2
74 -- p_own IN NUMBER
75 -- This identifier specifies if the cost group list
76 -- should include cost groups of all the organizations
77 -- that are in the current organization's shipping
78 -- network.
79 -- x_return_status OUT NOCOPY VARCHAR2 Required
80 -- Version : Current version 1.0
81 -- Initial version 1.0
82 -- End of comments
83 PROCEDURE Populate_CostGroupList(
84 p_api_version IN NUMBER,
85 p_organization_id IN NUMBER,
86 p_cost_group_from IN VARCHAR2 := NULL,
87 p_cost_group_to IN VARCHAR2 := NULL,
88 p_own IN NUMBER := 1,
89 x_return_status OUT NOCOPY VARCHAR2
90 );
91
92 -- Start of comments
93 -- API name : Populate_SubinventoryList
94 -- Type : Private
95 -- Pre-reqs : None
96 -- Function : Populates temporary table CST_SUB_LIST_TEMP with the
97 -- subinventories that match the given specifications.
98 -- Parameters : p_api_version IN NUMBER Required
99 -- p_organization_id IN NUMBER Required
100 -- p_subinventory_from IN VARCHAR2
101 -- p_subinventory_to IN VARCHAR2
102 -- p_expense_sub IN NUMBER
103 -- This parameter indicates whether to include expense
104 -- subinventories.
105 -- x_return_status OUT NOCOPY VARCHAR2 Required
106 -- Version : Current version 1.0
107 -- Initial version 1.0
108 -- End of comments
109 PROCEDURE Populate_SubinventoryList(
110 p_api_version IN NUMBER,
111 p_organization_id IN NUMBER,
112 p_subinventory_from IN VARCHAR2 := NULL,
113 p_subinventory_to IN VARCHAR2 := NULL,
114 p_expense_sub IN NUMBER := NULL,
115 x_return_status OUT NOCOPY VARCHAR2
116 );
117
118 -- Start of comments
119 -- API name : Calculate_OnhandQty
120 -- Type : Private
121 -- Pre-reqs : Calls to Populate_ItemList, Populate_SubinventoryList,
122 -- and Populate_CostGroupList.
123 -- Function : Populates temporary table CST_INV_QTY_TEMP with the
124 -- quantity of items in the cost groups and subinventories
125 -- that match the given specifications.
126 -- Parameters : p_api_version IN NUMBER Required
127 -- p_organization_id IN NUMBER Required
128 -- p_valuation_date IN DATE
129 -- This paramater indicates the date at which the onhand
130 -- quantity needs to be calculated. If no date is
131 -- specified, the procedure will calculate the current
132 -- onhand quantity.
133 -- p_qty_by_revision IN NUMBER
134 -- This parameter indicates whether the item revision
135 -- information needs to be gathered.
136 -- p_zero_qty IN NUMBER
137 -- This parameter is valid only for current valuation
138 -- (p_valuation_date is NULL) to include items with zero
139 -- onhand quantity.
140 -- p_unvalued_txns IN NUMBER
141 -- This parameter indicates whether to include uncosted
142 -- transactions in the calculation for onhand quantity.
143 -- x_return_status OUT NOCOPY VARCHAR2 Required
144 -- Version : Current version 1.0
145 -- Initial version 1.0
146 -- End of comments
147 PROCEDURE Calculate_OnhandQty(
148 p_api_version IN NUMBER,
149 p_organization_id IN NUMBER,
150 p_valuation_date IN DATE := NULL,
151 p_qty_by_revision IN NUMBER := NULL,
152 p_zero_qty IN NUMBER := NULL,
153 p_unvalued_txns IN NUMBER := NULL,
154 x_return_status OUT NOCOPY VARCHAR2
155 );
156
157 -- Start of comments
158 -- API name : Calculate_IntransitQty
159 -- Type : Private
160 -- Pre-reqs : Calls to Populate_ItemList and Populate_CostGroupList.
161 -- Function : Populates temporary table CST_INV_QTY_TEMP with the
162 -- quantity of intransit items in the cost groups that
163 -- match the given specifications.
164 -- Parameters : p_api_version IN NUMBER Required
165 -- p_organization_id IN NUMBER Required
166 -- p_valuation_date IN DATE
167 -- This parameter indicates the date at which the
168 -- intransit quantity needs to be calculated. If no date
169 -- is specified, the procedure will calculate the current
170 -- intransit quantity.
171 -- p_receipt IN NUMBER
172 -- This parameter indicates whether to calculate the
173 -- intransit quantity that is coming to the current
174 -- organization
175 -- p_shipment IN NUMBER
176 -- This parameter indicates whether to calculate the
177 -- intransit quantity that is coming from the current
178 -- organization
179 -- p_detail IN NUMBER
180 -- This parameter indicates whether to calculate the
181 -- intransit quantity at the shipment line level
182 -- granularity. The default is no.
183 -- p_unvalued_txns IN NUMBER
184 -- This parameter indicates whether to include uncosted
185 -- transactions in the calculation for intransit quantity.
186 -- x_return_status OUT NOCOPY VARCHAR2 Required
187 -- Version : Current version 1.0
188 -- Initial version 1.0
189 -- End of comments
190 PROCEDURE Calculate_IntransitQty(
191 p_api_version IN NUMBER,
192 p_organization_id IN NUMBER,
193 p_valuation_date IN DATE := NULL,
194 p_receipt IN NUMBER := NULL,
195 p_shipment IN NUMBER := NULL,
196 p_detail IN NUMBER := NULL,
197 p_own IN NUMBER := NULL,
198 p_unvalued_txns IN NUMBER := NULL,
199 x_return_status OUT NOCOPY VARCHAR2
200 );
201
202 -- Start of comments
203 -- API name : Calculate_ReceivingQty
204 -- Type : Private
205 -- Pre-reqs : Calls to Populate_ItemList and Populate_CostGroupList.
206 -- Function : Populates temporary table CST_INV_QTY_TEMP with the
207 -- quantity of items in receiving dock in the cost groups
208 -- that match the given specifications.
209 -- Parameters : p_api_version IN NUMBER Required
210 -- p_organization_id IN NUMBER Required
211 -- p_valuation_date IN DATE
212 -- This parameter indicates the date at which the
213 -- receiving quantity needs to be calculated. If no date
214 -- is specified, the procedure will calculate the current
215 -- receiving quantity.
216 -- p_qty_by_revision IN NUMBER
217 -- This parameter indicates whether the item revision
218 -- information needs to be gathered.
219 -- p_include_period_end IN NUMBER
220 -- This parameter indicates whether receiving quantity
221 -- for period-end accrual PO shipments needs to be gathered.
222 -- If not, only online accrual PO shipments will be included.
223 -- x_return_status OUT NOCOPY VARCHAR2 Required
224 -- Version : Current version 1.0
225 -- Initial version 1.0
226 -- End of comments
227 PROCEDURE Calculate_ReceivingQty(
228 p_api_version IN NUMBER,
229 p_organization_id IN NUMBER,
230 p_valuation_date IN DATE := NULL,
231 p_qty_by_revision IN NUMBER := NULL,
232 p_include_period_end IN NUMBER := NULL,
233 x_return_status OUT NOCOPY VARCHAR2
234 );
235
236 -- Start of comments
237 -- API name : Get_ParentReceiveTxn
238 -- Type : Private
239 -- Pre-reqs : None
240 -- Function : Given the transaction_id passed in, returns the
241 -- parent Receive or Match transaction id in RT.
242 -- Parameters : p_rcv_transaction_id IN NUMBER
243 -- This is the transaction_id in RCV_TRANSACTIONS
244 -- for which this function will find the parent
245 -- Receive or Match transaction in RCV_TRANSACTIONS.
246 -- Version : Current version 1.0
247 -- Initial version 1.0
248 -- End of comments
249 FUNCTION Get_ParentReceiveTxn (
250 p_rcv_transaction_id IN NUMBER
251 )
252 RETURN NUMBER;
253
254 -- Start of comments
255 -- API name : Calculate_InventoryCost
256 -- Type : Private
257 -- Pre-reqs : Calls to Calculate_OnhandQty, Calculate_IntransitQty or
258 -- Calculate_ReceivingQty
259 -- Function : Populates temporary table CST_INV_COST_TEMP with the
260 -- cost of items CST_INV_QTY_TEMP.
261 -- Parameters : p_api_version IN NUMBER Required
262 -- p_valuation_date IN DATE
263 -- p_organization_id IN NUMBER
264 -- x_return_status OUT NOCOPY VARCHAR2 Required
265 -- Version : Current version 1.0
266 -- Initial version 1.0
267 -- End of comments
268 PROCEDURE Calculate_InventoryCost(
269 p_api_version IN NUMBER,
270 p_valuation_date IN DATE := NULL,
271 p_organization_id IN NUMBER,
272 x_return_status OUT NOCOPY VARCHAR2
273 );
274
275 END CST_Inventory_PVT;