1 PACKAGE CSTPACHK AUTHID CURRENT_USER AS
2 /* $Header: CSTACHKS.pls 120.2.12010000.2 2010/02/26 08:11:57 lchevala ship $ */
3
4 TYPE inv_layer_rec IS RECORD(
5 inv_layer_id cst_inv_layers.inv_layer_id%TYPE,
6 layer_quantity cst_inv_layers.layer_quantity%TYPE
7 );
8
9 TYPE inv_layer_tbl IS TABLE OF inv_layer_rec;
10
11 -- FUNCTION
12 -- actual_cost_hook Cover routine to allow users to add
13 -- customization. This would let users circumvent
14 -- our transaction cost processing. This function
15 -- is called by both CSTPACIN and CSTPACWP.
16 --
17 -- INPUT PARAMETERS
18 -- I_ORG_ID
19 -- I_TXN_ID
20 -- I_LAYER_ID
21 -- I_COST_TYPE
22 -- I_COST_METHOD
23 -- I_USER_ID
24 -- I_LOGIN_ID
25 -- I_REQ_ID
26 -- I_PRG_APPL_ID
27 -- I_PRG_ID
28 -- O_Err_Num
29 -- O_Err_Code
30 -- O_Err_Msg
31 --
32 -- RETURN VALUES
33 -- integer 1 Hook has been used.
34 -- 0 Continue cost processing for this transaction
35 -- as usual.
36 --
37 function actual_cost_hook(
38 I_ORG_ID IN NUMBER,
39 I_TXN_ID IN NUMBER,
40 I_LAYER_ID IN NUMBER,
41 I_COST_TYPE IN NUMBER,
42 I_COST_METHOD IN NUMBER,
43 I_USER_ID IN NUMBER,
44 I_LOGIN_ID IN NUMBER,
45 I_REQ_ID IN NUMBER,
46 I_PRG_APPL_ID IN NUMBER,
47 I_PRG_ID IN NUMBER,
48 O_Err_Num OUT NOCOPY NUMBER,
49 O_Err_Code OUT NOCOPY VARCHAR2,
50 O_Err_Msg OUT NOCOPY VARCHAR2
51 )
52 return integer;
53
54 -- FUNCTION
55 -- cost_dist_hook Cover routine to allow users to customize.
56 -- They will be able to circumvent the
57 -- average cost distribution processor.
58 --
59 -- INPUT PARAMETERS
60 -- I_ORG_ID
61 -- I_TXN_ID
62 -- I_USER_ID
63 -- I_LOGIN_ID
64 -- I_REQ_ID
65 -- I_PRG_APPL_ID
66 -- I_PRG_ID
67 -- O_Err_Num
68 -- O_Err_Code
69 -- O_Err_Msg
70 --
71 -- RETURN VALUES
72 -- integer 1 Hook has been used.
73 -- 0 Continue cost distribution for this transaction
74 -- as ususal.
75 --
76 function cost_dist_hook(
77 I_ORG_ID IN NUMBER,
78 I_TXN_ID IN NUMBER,
79 I_USER_ID IN NUMBER,
80 I_LOGIN_ID IN NUMBER,
81 I_REQ_ID IN NUMBER,
82 I_PRG_APPL_ID IN NUMBER,
83 I_PRG_ID IN NUMBER,
84 O_Err_Num OUT NOCOPY NUMBER,
85 O_Err_Code OUT NOCOPY VARCHAR2,
86 O_Err_Msg OUT NOCOPY VARCHAR2
87 )
88 return integer ;
89
90 -- FUNCTION
91 -- get_account_id Cover routine to allow users the flexbility
92 -- in determining the account they want to
93 -- post the inventory transaction to.
94 --
95 -- INPUT PARAMETERS
96 -- I_ORG_ID
97 -- I_TXN_ID
98 -- I_DEBIT_CREDIT 1 for debit and -1 for credit.
99 -- I_ACCT_LINE_TYPE The accounting line type.
100 -- I_COST_ELEMENT_ID
101 -- I_RESOURCE_ID
102 -- I_SUBINV The subinventory involved if there is one.
103 -- I_EXP Indicates that the cost distributor is looking
104 -- for an expense account.
105 -- I_SND_RCV_ORG Indicates whether this is an sending or
106 -- receiving organization for interorg txns.
107 -- I_USER_ID
108 -- I_LOGIN_ID
109 -- I_REQ_ID
110 -- I_PRG_APPL_ID
111 -- I_PRG_ID
112 -- O_Err_Num
113 -- O_Err_Code
114 -- O_Err_Msg
115 -- I_COST_GROUP_ID Added as part of BUG 8881927
116 --
117 -- RETURN VALUES
118 -- integer >0 User selected account number
119 -- -1 Use the default account for distribution.
120 --
121 function get_account_id(
122 I_ORG_ID IN NUMBER,
123 I_TXN_ID IN NUMBER,
124 I_DEBIT_CREDIT IN NUMBER,
125 I_ACCT_LINE_TYPE IN NUMBER,
126 I_COST_ELEMENT_ID IN NUMBER,
127 I_RESOURCE_ID IN NUMBER,
128 I_SUBINV IN VARCHAR2,
129 I_EXP IN NUMBER,
130 I_SND_RCV_ORG IN NUMBER,
131 O_Err_Num OUT NOCOPY NUMBER,
132 O_Err_Code OUT NOCOPY VARCHAR2,
133 O_Err_Msg OUT NOCOPY VARCHAR2,
134 I_COST_GROUP_ID IN NUMBER DEFAULT NULL /*8881927*/
135 )
136 return integer;
137
138 -- FUNCTION
139 -- layer_hook This routine is a client extension that lets the
140 -- user specify which layer to consume from.
141 --
142 --
143 -- RETURN VALUES
144 -- integer >0 Hook has been used,return value is inv layer id.
145 -- 0 Hook has not been used.
146 -- -1 Error in Hook.
147
148 function layer_hook(
149 I_ORG_ID IN NUMBER,
150 I_TXN_ID IN NUMBER,
151 I_LAYER_ID IN NUMBER,
152 I_COST_METHOD IN NUMBER,
153 I_USER_ID IN NUMBER,
154 I_LOGIN_ID IN NUMBER,
155 I_REQ_ID IN NUMBER,
156 I_PRG_APPL_ID IN NUMBER,
157 I_PRG_ID IN NUMBER,
158 O_Err_Num OUT NOCOPY NUMBER,
159 O_Err_Code OUT NOCOPY VARCHAR2,
160 O_Err_Msg OUT NOCOPY VARCHAR2
161 )
162 return integer;
163
164 -- PROCEDURE
165 -- layers_hook This routine is a client extension that lets the
166 -- user specify multiple layers that a transaction
167 -- should consume from.
168 --
169 -- PARAMETERS
170 -- i_txn_id Id of the inventory material transactions in
171 -- MTL_MATERIAL_TRANSACTIONS
172 -- i_required_qty The quantity in primary UOM that this transaction
173 -- needs to consume
174 -- i_cost_method The cost method of the organization. The possible
175 -- values are 5 (FIFO) and 6 (LIFO).
176 -- o_custom_layers A list of Ids of the inventory layers in CST_INV_LAYERS
177 -- that should be consumed for the transaction and the
178 -- quantity that should be consumed from each layer. The
179 -- inventory layers must correspond to the organization,
180 -- item and cost group of the transaction. The quantity
181 -- must be positive and less than or equal to the available
182 -- quantity in the specified layer
183 -- o_err_num 0 indicates no error. Other values indicates errors.
184 -- o_err_code A short code to help identify errors.
185 -- o_err_msg A message to help identify errors.
186
187 PROCEDURE layers_hook(
188 i_txn_id IN NUMBER,
189 i_required_qty IN NUMBER,
190 i_cost_method IN NUMBER,
191 o_custom_layers IN OUT NOCOPY inv_layer_tbl,
192 o_err_num OUT NOCOPY NUMBER,
193 o_err_code OUT NOCOPY VARCHAR2,
194 o_err_msg OUT NOCOPY VARCHAR2
195 );
196
197 -- FUNCTION
198 -- LayerMerge_hook This routine is a client extension that lets the
199 -- user specify if layer merge should be attempted.
200 --
201 -- PARAMETERS
202 -- i_txn_id Id of the receipt transaction in
203 -- MTL_MATERIAL_TRANSACTIONS
204 -- o_err_num 0 indicates no error. Other values indicates errors.
205 -- o_err_code A short code to help identify errors.
206 -- o_err_msg A message to help identify errors.
207 --
208 -- RETURN VALUE
209 -- 1 Attempt to combine the quantity from the specified
210 -- receipt transaction with an existing inventory layer
211 -- 0 Create a new inventory layer for the specified
212 -- receipt transaction
213
214 FUNCTION LayerMerge_hook(
215 i_txn_id IN NUMBER,
216 o_err_num OUT NOCOPY NUMBER,
217 o_err_code OUT NOCOPY VARCHAR2,
218 o_err_msg OUT NOCOPY VARCHAR2
219 )
220 RETURN INTEGER;
221
222 function get_date(
223 I_ORG_ID IN NUMBER,
224 O_Error_Message OUT NOCOPY VARCHAR2
225 )
226 return date;
227
228 -- FUNCTION
229 -- get_absorption_account_id
230 -- Cover routing to allow users to specify the resource absorption account
231 -- based on the resource instance and charge department
232 --
233 -- Return Values
234 -- integer > 0 User selected account number
235 -- -1 Use default account
236 --
237 function get_absorption_account_id (
238 I_ORG_ID IN NUMBER,
239 I_TXN_ID IN NUMBER,
240 I_CHARGE_DEPT_ID IN NUMBER,
241 I_RES_INSTANCE_ID IN NUMBER
242 ) return integer;
243
244
245 -- FUNCTION validate_job_est_status_hook
246 -- introduced as part of support for EAM Job Costing
247 -- This function can be modified to contain validations that allow/disallow
248 -- job cost re-estimation.
249 -- The Work Order Value summary form calls this function, to determine if the
250 -- re-estimation flag can be updated or not. If the function is not used, then
251 -- the default validations contained in cst_eamcost_pub.validate_for_reestimation
252 -- procedure will be implemented
253 -- RETURN VALUES
254 -- 0 hook is not used or procedure raises exception
255 -- 1 hook is used
256 -- VALUES for o_validate_flag
257 -- 0 reestimation flag is not updateable
258 -- 1 reestimation flag is updateable
259
260 function validate_job_est_status_hook (
261 i_wip_entity_id IN NUMBER,
262 i_job_status IN NUMBER,
263 i_curr_est_status IN NUMBER,
264 o_validate_flag OUT NOCOPY NUMBER,
265 o_err_num OUT NOCOPY NUMBER,
266 o_err_code OUT NOCOPY VARCHAR2,
267 o_err_msg OUT NOCOPY VARCHAR2 )
268 return integer;
269
270 --
271 -- OPM INVCONV umoogala Process-Discrete Xfers Enh.
272 -- Hook to get transfer price
273 --
274 procedure Get_xfer_price_user_hook
275 ( p_api_version IN NUMBER
276 , p_init_msg_list IN VARCHAR2
277
278 , p_transaction_uom IN VARCHAR2
279 , p_inventory_item_id IN NUMBER
280 , p_transaction_id IN NUMBER
281 , p_from_organization_id IN NUMBER
282 , p_to_organization_id IN NUMBER
283 , p_from_ou IN NUMBER
284 , p_to_ou IN NUMBER
285
286 , x_return_status OUT NOCOPY NUMBER
290 , x_transfer_price OUT NOCOPY NUMBER
287 , x_msg_data OUT NOCOPY VARCHAR2
288 , x_msg_count OUT NOCOPY NUMBER
289
291 , x_currency_code OUT NOCOPY VARCHAR2
292 )
293 ;
294
295 END CSTPACHK;