DBA Data[Home] [Help]

PACKAGE: APPS.CSTPACHK

Source


1 PACKAGE CSTPACHK AS
2 /* $Header: CSTACHKS.pls 120.1.12000000.2 2007/10/12 18:36:05 ipineda 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 --
116 -- RETURN VALUES
117 --  integer		>0	User selected account number
118 --			-1  	Use the default account for distribution.
119 --
120 function get_account_id(
121   I_ORG_ID		IN	NUMBER,
122   I_TXN_ID		IN 	NUMBER,
123   I_DEBIT_CREDIT	IN	NUMBER,
124   I_ACCT_LINE_TYPE	IN	NUMBER,
125   I_COST_ELEMENT_ID	IN	NUMBER,
126   I_RESOURCE_ID		IN	NUMBER,
127   I_SUBINV		IN	VARCHAR2,
128   I_EXP			IN	NUMBER,
129   I_SND_RCV_ORG		IN	NUMBER,
130   O_Err_Num		OUT NOCOPY	NUMBER,
131   O_Err_Code		OUT NOCOPY	VARCHAR2,
132   O_Err_Msg		OUT NOCOPY	VARCHAR2
133 )
134 return integer;
135 
136 -- FUNCTION
137 --  layer_hook                  This routine is a client extension that lets the
138 --                              user specify which layer to consume from.
139 --
140 --
141 -- RETURN VALUES
142 --  integer             >0      Hook has been used,return value is inv layer id.
143 --                      0       Hook has not been used.
144 --                      -1      Error in Hook.
145 
146 function layer_hook(
147   I_ORG_ID      IN      NUMBER,
148   I_TXN_ID      IN      NUMBER,
149   I_LAYER_ID    IN      NUMBER,
150   I_COST_METHOD IN      NUMBER,
151   I_USER_ID     IN      NUMBER,
152   I_LOGIN_ID    IN      NUMBER,
153   I_REQ_ID      IN      NUMBER,
154   I_PRG_APPL_ID IN      NUMBER,
155   I_PRG_ID      IN      NUMBER,
156   O_Err_Num     OUT NOCOPY     NUMBER,
157   O_Err_Code    OUT NOCOPY     VARCHAR2,
158   O_Err_Msg     OUT NOCOPY     VARCHAR2
159 )
160 return integer;
161 
162 -- PROCEDURE
163 --  layers_hook                 This routine is a client extension that lets the
164 --                              user specify multiple layers that a transaction
165 --                              should consume from.
166 --
167 -- PARAMETERS
168 --  i_txn_id                    Id of the inventory material transactions in
169 --                              MTL_MATERIAL_TRANSACTIONS
170 --  i_required_qty              The quantity in primary UOM that this transaction
171 --                              needs to consume
172 --  i_cost_method               The cost method of the organization. The possible
173 --                              values are 5 (FIFO) and 6 (LIFO).
174 --  o_custom_layers             A list of Ids of the inventory layers in CST_INV_LAYERS
175 --                              that should be consumed for the transaction and the
176 --                              quantity that should be consumed from each layer. The
177 --                              inventory layers must correspond to the organization,
178 --                              item and cost group of the transaction. The quantity
179 --                              must be positive and less than or equal to the available
180 --                              quantity in the specified layer
181 --  o_err_num                   0 indicates no error. Other values indicates errors.
182 --  o_err_code                  A short code to help identify errors.
183 --  o_err_msg                   A message to help identify errors.
184 
185 PROCEDURE layers_hook(
186    i_txn_id        IN            NUMBER,
187    i_required_qty  IN            NUMBER,
188    i_cost_method   IN            NUMBER,
189    o_custom_layers IN OUT NOCOPY inv_layer_tbl,
190    o_err_num       OUT NOCOPY    NUMBER,
191    o_err_code      OUT NOCOPY    VARCHAR2,
192    o_err_msg       OUT NOCOPY    VARCHAR2
193 );
194 
195 -- FUNCTION
196 --  LayerMerge_hook             This routine is a client extension that lets the
197 --                              user specify if layer merge should be attempted.
198 --
199 -- PARAMETERS
200 --  i_txn_id                    Id of the receipt transaction in
201 --                              MTL_MATERIAL_TRANSACTIONS
202 --  o_err_num                   0 indicates no error. Other values indicates errors.
203 --  o_err_code                  A short code to help identify errors.
204 --  o_err_msg                   A message to help identify errors.
205 --
206 -- RETURN VALUE
207 --  1                           Attempt to combine the quantity from the specified
208 --                              receipt transaction with an existing inventory layer
209 --  0                           Create a new inventory layer for the specified
210 --                              receipt transaction
211 
212 FUNCTION LayerMerge_hook(
213    i_txn_id        IN            NUMBER,
214    o_err_num       OUT NOCOPY    NUMBER,
215    o_err_code      OUT NOCOPY    VARCHAR2,
216    o_err_msg       OUT NOCOPY    VARCHAR2
217 )
218 RETURN INTEGER;
219 
220 function get_date(
221   I_ORG_ID              IN      NUMBER,
222   O_Error_Message       OUT NOCOPY     VARCHAR2
223 )
224 return date;
225 
226 -- FUNCTION
227 --  get_absorption_account_id
228 --    Cover routing to allow users to specify the resource absorption account
229 --    based on the resource instance and charge department
230 --
231 --  Return Values
232 --   integer            > 0     User selected account number
233 --                       -1     Use default account
234 --
235 function get_absorption_account_id (
236         I_ORG_ID                IN      NUMBER,
237         I_TXN_ID                IN      NUMBER,
238         I_CHARGE_DEPT_ID        IN      NUMBER,
239         I_RES_INSTANCE_ID       IN      NUMBER
240 ) return integer;
241 
242 
243 -- FUNCTION validate_job_est_status_hook
244 --  introduced as part of support for EAM Job Costing
245 --  This function can be modified to contain validations that allow/disallow
246 --  job cost re-estimation.
247 --  The Work Order Value summary form calls this function, to determine if the
248 --  re-estimation flag can be updated or not. If the function is not used, then
249 --  the default validations contained in cst_eamcost_pub.validate_for_reestimation
250 --  procedure will be implemented
251 -- RETURN VALUES
252 --   0          hook is not used or procedure raises exception
253 --   1          hook is used
254 -- VALUES for o_validate_flag
255 --   0          reestimation flag is not updateable
256 --   1          reestimation flag is updateable
257 
258 function validate_job_est_status_hook (
259         i_wip_entity_id         IN      NUMBER,
260         i_job_status            IN      NUMBER,
261         i_curr_est_status       IN      NUMBER,
262         o_validate_flag		OUT NOCOPY	NUMBER,
263         o_err_num               OUT NOCOPY     NUMBER,
264         o_err_code              OUT NOCOPY     VARCHAR2,
265         o_err_msg               OUT NOCOPY     VARCHAR2 )
266 return integer;
267 
268 --
269 -- OPM INVCONV umoogala  Process-Discrete Xfers Enh.
270 -- Hook to get transfer price
271 --
272 procedure Get_xfer_price_user_hook
273   ( p_api_version                       IN            NUMBER
274   , p_init_msg_list                     IN            VARCHAR2
275 
276   , p_transaction_uom                   IN            VARCHAR2
277   , p_inventory_item_id                 IN            NUMBER
278   , p_transaction_id                    IN            NUMBER
279   , p_from_organization_id              IN            NUMBER
280   , p_to_organization_id                IN            NUMBER
281   , p_from_ou                           IN            NUMBER
282   , p_to_ou                             IN            NUMBER
283 
284   , x_return_status                     OUT NOCOPY    NUMBER
285   , x_msg_data                          OUT NOCOPY    VARCHAR2
286   , x_msg_count                         OUT NOCOPY    NUMBER
287 
288   , x_transfer_price                    OUT NOCOPY    NUMBER
289   , x_currency_code                     OUT NOCOPY    VARCHAR2
290   )
291 ;
292 
293 END CSTPACHK;