DBA Data[Home] [Help]

PACKAGE: APPS.PO_AUTOSOURCE_SV

Source


1 PACKAGE PO_AUTOSOURCE_SV AS
2 /* $Header: POXSRCDS.pls 120.6 2006/02/08 05:04:55 arudas noship $*/
3 --<PKGCOMP R12 Start>
4 -------------------------------------------------------------------------------
5 --Start of Comments
6 --Name: AUTOSOURCE
7 --Function:
8 -- This is the overloaded procedure that will be called by all the routines,
9 -- which were already calling PO_AUTOSOURCE_SV.autosource without ASL_ID parameter.
10 --
11 -- This procedure in turn will call the autosource procedure, which has the
12 -- additional parameter x_asl_id with a NULL value.
13 --
14 -- No changes are been made in the specification of the procedure
15 --End of Comments
16  -------------------------------------------------------------------------------
17 PROCEDURE autosource(
18 		x_mode				IN	VARCHAR2,
19 		x_destination_doc_type		IN	VARCHAR2,
20 		x_item_id			IN	NUMBER,
21 		x_commodity_id			IN	NUMBER,
22 		x_dest_organization_id		IN	NUMBER,
23 		x_dest_subinventory		IN	VARCHAR2,
24 		x_autosource_date		IN	DATE,
25 		x_item_rev			IN	VARCHAR2,
26 		x_currency_code			IN	VARCHAR2,
27 		x_vendor_id			IN OUT NOCOPY  NUMBER,
28 		x_vendor_site_id		IN OUT NOCOPY  NUMBER,
29 		x_vendor_contact_id		IN OUT NOCOPY  NUMBER,
30 		x_source_organization_id	IN OUT	NOCOPY NUMBER,  -- for inv
31 		x_source_subinventory		IN OUT	NOCOPY VARCHAR2, -- for inv
32 		x_document_header_id		IN OUT NOCOPY  NUMBER,
33 		x_document_line_id		IN OUT	NOCOPY NUMBER,
34 		x_document_type_code		IN OUT NOCOPY  VARCHAR2,
35 		x_document_line_num		IN OUT	NOCOPY NUMBER,
36 		x_buyer_id			IN OUT NOCOPY  NUMBER,
37 		x_vendor_product_num		IN OUT NOCOPY  VARCHAR2,
38 		x_purchasing_uom		IN OUT NOCOPY  VARCHAR2
39                 --<R12 STYLES PHASE II START>
40                 ,p_purchase_basis   IN VARCHAR2 DEFAULT NULL,
41                  p_line_type_id     IN VARCHAR2 DEFAULT NULL,
42                  p_destination_type IN VARCHAR2 DEFAULT NULL,
43                  p_style_id         IN NUMBER DEFAULT NULL
44                 --<R12 STYLES PHASE II END>
45 );
46 
47 -------------------------------------------------------------------------------
48 --Start of Comments
49 --Name: AUTOSOURCE
50 --Function:
51 --  This procedure performs automatic document sourcing based on item/item category,
52 --  supplier/supplier site, and profile option settings
53 --
54 --  We need the value of the asl_id in the PO_AUTOSOURCE_SV.reqimport_sourcing. We
55 --  have to get it from the PO_AUTOSOURCE_SV.autosource. Added a new parameter
56 --  x_asl_id as IN OUT type so that we can pass this value back to the
57 --  calling procedure.
58 --  So we have overloaded the existing procedure
59 --End of Comments
60 -----------------------------------------------------------------------------*/
61 PROCEDURE autosource(
62 		     x_mode			IN	VARCHAR2,
63 		     x_destination_doc_type	IN	VARCHAR2,
64 		     x_item_id			IN	NUMBER,
65 		     x_commodity_id		IN	NUMBER,
66            	     x_dest_organization_id	IN	NUMBER,
67 		     x_dest_subinventory	IN	VARCHAR2,
68 		     x_autosource_date		IN	DATE,
69 		     x_item_rev			IN	VARCHAR2,
70 		     x_currency_code		IN	VARCHAR2,
71 		     x_vendor_id		IN OUT  NOCOPY  NUMBER,
72 		     x_vendor_site_id		IN OUT  NOCOPY  NUMBER,
73 		     x_vendor_contact_id	IN OUT  NOCOPY  NUMBER,
74 		     x_source_organization_id	IN OUT	NOCOPY NUMBER,
75 		     x_source_subinventory	IN OUT	NOCOPY VARCHAR2,
76 		     x_document_header_id	IN OUT  NOCOPY  NUMBER,
77 		     x_document_line_id		IN OUT	NOCOPY NUMBER,
78 		     x_document_type_code	IN OUT  NOCOPY  VARCHAR2,
79 		     x_document_line_num	IN OUT	NOCOPY NUMBER,
80 		     x_buyer_id			IN OUT  NOCOPY  NUMBER,
81 		     x_vendor_product_num	IN OUT  NOCOPY  VARCHAR2,
82 		     x_purchasing_uom		IN OUT  NOCOPY  VARCHAR2,
83                      x_asl_id           IN OUT  NOCOPY NUMBER
84                      --<R12 STYLES PHASE II START>
85                     ,p_purchase_basis   IN VARCHAR2 DEFAULT NULL,
86                      p_line_type_id     IN VARCHAR2 DEFAULT NULL,
87                      p_destination_type IN VARCHAR2 DEFAULT NULL,
88                      p_style_id         IN NUMBER DEFAULT NULL
89                      --<R12 STYLES PHASE II END>
90                     );
91 --<PKGCOMP R12 End>
92 PROCEDURE get_asl_info(
93 		x_item_id		IN 	NUMBER,
94 		x_vendor_id		IN 	NUMBER,
95 	        x_vendor_site_id	IN	NUMBER,
96 		x_using_organization_id	IN OUT	NOCOPY NUMBER,
97 		x_asl_id		IN OUT	NOCOPY NUMBER,
98 		x_vendor_product_num	IN OUT	NOCOPY VARCHAR2,
99 		x_purchasing_uom	IN OUT  NOCOPY VARCHAR2,
100                 p_category_id		IN	NUMBER default NULL --<Contract AutoSourcing FPJ>
101                 );
102 
103 /* CONSIGNED FPI */
104 PROCEDURE get_asl_info(
105 		x_item_id		        IN      NUMBER,
106 		x_vendor_id		        IN      NUMBER,
107 	        x_vendor_site_id	        IN      NUMBER,
108 		x_using_organization_id	        IN OUT  NOCOPY NUMBER,
109 		x_asl_id		        IN OUT  NOCOPY NUMBER,
110 		x_vendor_product_num	        IN OUT  NOCOPY VARCHAR2,
111 		x_purchasing_uom	        IN OUT  NOCOPY VARCHAR2,
112 		x_consigned_from_supplier_flag  OUT     NOCOPY VARCHAR2,
113                 x_enable_vmi_flag               OUT     NOCOPY VARCHAR2,
114 		x_last_billing_date             OUT     NOCOPY DATE,
115 		x_consigned_billing_cycle       OUT     NOCOPY NUMBER,
116 		x_vmi_min_qty                   OUT     NOCOPY NUMBER,
117                 x_vmi_max_qty                   OUT     NOCOPY NUMBER,
118 		x_vmi_auto_replenish_flag       OUT     NOCOPY VARCHAR2,
119 		x_vmi_replenishment_approval    OUT     NOCOPY VARCHAR2,
120                 p_category_id                   IN      NUMBER default NULL --<Contract AutoSourcing FPJ>
121                 );
122 
123 /* VMI FPH */
124 FUNCTION  vmi_enabled(
125                 x_item_id               IN      NUMBER,
126                 x_vendor_id             IN      NUMBER,
127                 x_vendor_site_id        IN      NUMBER,
128                 x_using_organization_id IN      NUMBER
129 ) RETURN VARCHAR2;
130 
131 --<PKGCOMP R12 Start>
132 -- Modifying the parameter type for x_asl_id from IN to IN OUT, in order to communicate the
133 -- ASL_ID back to PO_AUTOSOURCE_SV.autosource or PO_AUTOSOURCE_SV.reqimport_sourcing.
134 --<PKGCOMP R12 End>
135 
136 PROCEDURE document_sourcing(
137 		x_item_id		IN 	NUMBER,
138 		x_vendor_id		IN 	NUMBER,
139 		x_destination_doc_type	IN	VARCHAR2,
140 		x_organization_id	IN	NUMBER,
141 		x_currency_code		IN	VARCHAR2,
142 	        x_item_rev		IN	VARCHAR2,
143 		x_autosource_date	IN	DATE,
144 		x_vendor_site_id	IN OUT NOCOPY  NUMBER,
145 		x_document_header_id	IN OUT NOCOPY  NUMBER,
146 		x_document_type_code	IN OUT NOCOPY  VARCHAR2,
147 		x_document_line_num	IN OUT NOCOPY  NUMBER,
148 		x_document_line_id	IN OUT	NOCOPY NUMBER,
149 		x_vendor_contact_id	IN OUT NOCOPY  NUMBER,
150 		x_vendor_product_num	IN OUT	NOCOPY VARCHAR2,
151 		x_buyer_id		IN OUT NOCOPY  NUMBER,
152 		x_purchasing_uom	IN OUT NOCOPY  VARCHAR2,
153                 x_asl_id                IN OUT NOCOPY NUMBER, -- cto changes FPH
154         x_multi_org             IN      VARCHAR2 default 'N',
155         p_vendor_site_sourcing_flag IN  VARCHAR2 default 'N', --<Shared Proc FPJ>
156         p_vendor_site_code      IN      VARCHAR2 default NULL, --<Shared proc FPJ>
157         p_category_id           IN      NUMBER 	 default NULL --<Contract AutoSourcing FPJ>
158                 --<R12 STYLES PHASE II START>
159                ,p_purchase_basis   IN VARCHAR2 DEFAULT NULL,
160                 p_line_type_id     IN VARCHAR2 DEFAULT NULL,
161                 p_destination_type IN VARCHAR2 DEFAULT NULL,
162                 p_style_id         IN NUMBER DEFAULT NULL
163                 --<R12 STYLES PHASE II END>
164 );
165 
166 --<PKGCOMP R12 Start>
167 -- Added the parameter p_multi_dist_flag to get the Value of 'Multiple Distribution' provided
168 -- by the user during the requisition import request submission
169 --<PKGCOMP R12 End>
170 PROCEDURE reqimport_sourcing(
171 	x_mode			IN	VARCHAR2,
172 	x_request_id		IN	NUMBER,
173 	p_multi_dist_flag       IN      VARCHAR2);
174 
175 TYPE vendor_details_rec IS RECORD(
176                                   Vendor_id         number,
177                                   Vendor_site_id   number,
178                                   Asl_id               number,
179                                   Vendor_product_num  varchar2(25),
180                                   Purchasing_uom        varchar2(25));
181 
182 TYPE vendor_record_details IS TABLE OF vendor_details_rec index by BINARY_INTEGER;
183 
184 /*============================================================================
185      Name: Get_All_item_Asl
186      DESC:  Cto Changes FPH. For the given item id this procedure gives
187 	    all the valid vendor,vendor sites and Asl ids from the global Asl.
188      input parameters :
189 	x_item_id: Item id for which we get the global asl values
190         x_using_organization_id := -1 if we need for global or the organization
191 	id for which we need.
192      output parameters :
193 	x_return_status,x_msg_count,x_msg_data - Error messages if any returned
194 	in the api.
195 	x_vendor_details - This is a array of records with the vendor details.
196 ==============================================================================*/
197 
198 Procedure Get_All_item_Asl(
199                            x_item_id              IN   Mtl_system_items.inventory_item_id%type,
200                            x_using_organization_id      IN    Number, --will be -1
201                            x_vendor_details IN OUT NOCOPY PO_AUTOSOURCE_SV.vendor_record_details,
202                            x_return_status  OUT NOCOPY varchar2,
203                            x_msg_count     OUT NOCOPY Number,
204                            x_msg_data       OUT NOCOPY Varchar2);
205 
206 /*============================================================================
207      Name: blanket_document_sourcing
208      DESC:  Cto Changes FPH. Wrapper for the procedure document_sourcing
209 	    to give only the blanket PO information. Returns  x_doc_Return as Y
210             if there are any blankets.
211      input parameters : Same as the document_sourcing. There are two extra
212 			parameters x_asl_id and x_multi_org
213 			x_asl_id - The asl_id for which we get the blankets.
214 			x_multi_org - If need to source across multi org then
215 					value is Y.
216 					Default value is N which sources for
217 					that particular operating unit
218 					where the apps is running.
219      output parameters : Same as document sourcing.
220 			 x_return_status, x_msg_count, x_msg_date- returns
221 			any error messages in the api.
222 			x_doc_return: Returns Y if there is any blanket for
223 			for the asl_id.
224 
225 ==============================================================================*/
226 Procedure blanket_document_sourcing(
227                                         x_item_id               IN      NUMBER,
228                                         x_vendor_id             IN      NUMBER,
229                                         x_destination_doc_type  IN      VARCHAR2,
230                                         x_organization_id       IN      NUMBER,
231                                         x_currency_code         IN      VARCHAR2,
232                                         x_item_rev              IN      VARCHAR2,
233                                         x_autosource_date       IN      DATE,
234                                         x_vendor_site_id        IN OUT NOCOPY  NUMBER,
235                                         x_document_header_id    IN OUT NOCOPY  NUMBER,
236                                         x_document_type_code    IN OUT NOCOPY  VARCHAR2,
237                                         x_document_line_num     IN OUT NOCOPY  NUMBER,
238                                         x_document_line_id      IN OUT NOCOPY  NUMBER,
242                                         x_purchasing_uom        IN OUT NOCOPY  VARCHAR2,
239                                         x_vendor_contact_id     IN OUT NOCOPY  NUMBER,
240                                         x_vendor_product_num    IN OUT NOCOPY  VARCHAR2,
241                                         x_buyer_id              IN OUT NOCOPY  NUMBER,
243                                         x_return_status            OUT NOCOPY varchar2,
244                                         x_msg_count                OUT NOCOPY Number,
245                                         x_msg_data                 OUT NOCOPY Varchar2,
246 					x_doc_return		   OUT NOCOPY varchar2,
247                                         x_asl_id                IN      NUMBER default null,
248                                         x_multi_org             IN      VARCHAR2 default 'N'
249 					);
250 
251 --<Shared Proc FPJ START>
252 PROCEDURE asl_sourcing (
253    p_item_id                        	IN      NUMBER,
254    p_vendor_id                      	IN      NUMBER,
255    p_vendor_site_code               	IN      VARCHAR2,
256    p_item_rev				            IN		VARCHAR2,
257    p_item_rev_control			        IN		NUMBER,
258    p_sourcing_date			            IN 		DATE,
259    p_currency_code			            IN		VARCHAR2,
260    p_org_id				                IN		NUMBER,
261    p_using_organization_id          	IN  OUT NOCOPY    NUMBER,
262    x_asl_id                         	OUT NOCOPY      NUMBER,
263    x_vendor_product_num             	OUT NOCOPY      VARCHAR2,
264    x_purchasing_uom                 	OUT NOCOPY      VARCHAR2,
265    x_consigned_from_supplier_flag   	OUT NOCOPY      VARCHAR2,
266    x_enable_vmi_flag                	OUT NOCOPY      VARCHAR2,
267    x_sequence_num                   	OUT NOCOPY      NUMBER,
268    p_category_id                        IN  NUMBER default NULL --<Contract AutoSourcing FPJ>
269 );
270 
271 --<PKGCOMP R12 Start>
272 -- Modifying the parameter type for x_asl_id from IN to IN OUT, in order to communicate
273 -- the ASL_ID back to PO_AUTOSOURCE_SV.document_sourcing.
274 --<PKGCOMP R12 End>
275 Procedure get_document_from_asl(
276                 x_item_id             	  	  IN    NUMBER,
277                 x_vendor_id           	      IN	NUMBER,
278                 x_destination_doc_type 	      IN  	VARCHAR2,
279                 x_currency_code         	  IN    VARCHAR2,
280                 x_item_rev              	  IN	VARCHAR2,
281                 x_autosource_date       	  IN    DATE,
282                 x_vendor_site_id        	  IN OUT NOCOPY  NUMBER,
283                 x_document_header_id    	  IN OUT NOCOPY  NUMBER,
284                 x_document_type_code     	  IN OUT NOCOPY  VARCHAR2,
285                 x_document_line_num     	  IN OUT NOCOPY  NUMBER,
286                 x_document_line_id      	  IN OUT  NOCOPY NUMBER,
287                 x_vendor_contact_id     	  IN OUT NOCOPY  NUMBER,
288                 x_vendor_product_num     	  IN OUT  NOCOPY VARCHAR2,
289                 x_buyer_id              	  IN OUT NOCOPY  NUMBER,
290                 x_purchasing_uom        	  IN OUT NOCOPY  VARCHAR2,
291                 x_asl_id                          IN OUT NOCOPY NUMBER,
292                 x_multi_org        		      IN    VARCHAR2,
293 	            p_vendor_site_sourcing_flag   IN 	VARCHAR2,
294  	            p_vendor_site_code   	      IN  	VARCHAR2,
295                 p_org_id                      IN    NUMBER,
296                 p_item_rev_control            IN    NUMBER,
297                 p_using_organization_id       IN    NUMBER,
298                 p_category_id                 IN    NUMBER,  --<Contract AutoSourcing FPJ>
299                 p_return_contract             IN    VARCHAR2 --<Contract AutoSourcing FPJ>
300                 --<R12 STYLES PHASE II START>
301                ,p_purchase_basis   IN VARCHAR2 DEFAULT NULL,
302                 p_line_type_id     IN VARCHAR2 DEFAULT NULL,
303                 p_destination_type IN VARCHAR2 DEFAULT NULL,
304                 p_style_id         IN NUMBER DEFAULT NULL
305                 --<R12 STYLES PHASE II END>
306 );
307 Procedure get_latest_document(
308                 x_item_id             	  	  IN    NUMBER,
309                 x_vendor_id           	          IN	NUMBER,
310                 x_destination_doc_type 	          IN  	VARCHAR2,
311                 x_currency_code         	  IN    VARCHAR2,
312                 x_item_rev              	  IN	VARCHAR2,
313                 x_autosource_date       	  IN      	DATE,
314                 x_vendor_site_id        	  IN OUT NOCOPY  NUMBER,
315                 x_document_header_id    	  IN OUT NOCOPY  NUMBER,
316                 x_document_type_code     	  IN OUT NOCOPY  VARCHAR2,
317                 x_document_line_num     	  IN OUT NOCOPY  NUMBER,
318                 x_document_line_id      	  IN OUT  NOCOPY NUMBER,
319                 x_vendor_contact_id     	  IN OUT NOCOPY  NUMBER,
320                 x_vendor_product_num     	  IN OUT  NOCOPY VARCHAR2,
321                 x_buyer_id              	  IN OUT NOCOPY  NUMBER,
322                 x_purchasing_uom        	  IN OUT NOCOPY  VARCHAR2,
323                 x_asl_id                      IN OUT NOCOPY  NUMBER,  --<Bug#4936992>
324                 x_multi_org        		      IN    VARCHAR2,
325 	        p_vendor_site_sourcing_flag       IN 	VARCHAR2,
326  	        p_vendor_site_code   	          IN  	VARCHAR2,
327                 p_org_id                      IN    NUMBER,
328                 p_item_rev_control            IN    NUMBER,
329                 p_using_organization_id       IN    NUMBER,
333                ,p_purchase_basis   IN VARCHAR2 DEFAULT NULL,
330                 p_category_id                 IN    NUMBER default NULL, --<Contract AutoSourcing FPJ>
331                 p_return_contract             IN    VARCHAR2 default NULL --<Contract AutoSourcing FPJ>
332                 --<R12 STYLES PHASE II START>
334                 p_line_type_id     IN VARCHAR2 DEFAULT NULL,
335                 p_destination_type IN VARCHAR2 DEFAULT NULL,
336                 p_style_id         IN NUMBER DEFAULT NULL
337                 --<R12 STYLES PHASE II END>
338 );
339 
340 procedure get_site_id_if_item_on_doc_ok(p_document_header_id  IN NUMBER,
341                                         p_item_id  IN NUMBER,
342                                         p_vendor_site_sourcing_flag IN VARCHAR2,
343                                         p_global_agreement_flag  IN VARCHAR2,
344                                         p_document_org_id  IN NUMBER,
345                                         x_return_status    OUT NOCOPY VARCHAR2,
346                                         x_vendor_site_id  IN OUT  NOCOPY NUMBER,
347                                         x_vendor_contact_id IN OUT NOCOPY NUMBER,
348                                         p_destination_doc_type IN VARCHAR2, --<Bug 3356349>,
349 					p_multi_org IN VARCHAR2 --<CTO Bug 4222144>
350 );
351 --<Shared Proc FPJ END>
352 
353 -- SERVICES FPJ Start
354 PROCEDURE get_services_asl_list
355              (p_job_id                     IN         NUMBER,
356               p_category_id                IN         NUMBER,
357               p_line_type_id               IN         NUMBER,
358               p_start_date                 IN         DATE,
359               p_deliver_to_loc_id          IN         NUMBER,
360               p_destination_org_id         IN         NUMBER,
361               p_api_version                IN         NUMBER,
362               -- Bug# 3404477: Follow the API standards
363               p_init_msg_list              IN         VARCHAR2,
364               x_vendor_id                  OUT NOCOPY po_tbl_number,
365               x_vendor_site_id             OUT NOCOPY po_tbl_number,
369               x_src_doc_line_num           OUT NOCOPY po_tbl_number,
366               x_vendor_contact_id          OUT NOCOPY po_tbl_number,
367               x_src_doc_header_id          OUT NOCOPY po_tbl_number,
368               x_src_doc_line_id            OUT NOCOPY po_tbl_number,
370               x_src_doc_type_code          OUT NOCOPY po_tbl_varchar30,
371               x_base_price                 OUT NOCOPY po_tbl_number,
372               x_currency_price             OUT NOCOPY po_tbl_number,
373               x_currency_code              OUT NOCOPY po_tbl_varchar15,
374               x_unit_of_measure            OUT NOCOPY po_tbl_varchar25,
375               x_price_override_flag        OUT NOCOPY po_tbl_varchar1,
376               x_not_to_exceed_price        OUT NOCOPY po_tbl_number,
377               x_price_break_id             OUT NOCOPY po_tbl_number,
378               x_price_differential_flag    OUT NOCOPY po_tbl_varchar1,
379               x_rate_type                  OUT NOCOPY po_tbl_varchar30,
380               x_rate_date                  OUT NOCOPY po_tbl_date,
381               x_rate                       OUT NOCOPY po_tbl_number,
382               x_return_status              OUT NOCOPY VARCHAR2,
383               -- Bug# 3404477: Return msg count and data
384               x_msg_count                  OUT NOCOPY NUMBER,
385               x_msg_data                   OUT NOCOPY VARCHAR2
386 );
387 
388 PROCEDURE get_line_amount(p_source_document_header_id IN NUMBER
389 	           ,  p_source_document_line_id	             IN NUMBER
390 	           ,  x_base_amount		             OUT NOCOPY NUMBER
391 	           ,  x_currency_amount	    	             OUT NOCOPY NUMBER
392                    ,  x_currency_code                        OUT NOCOPY VARCHAR2
393                    ,  x_rate_type                            OUT NOCOPY VARCHAR2
394                    ,  x_rate_date                            OUT NOCOPY DATE
395                    ,  x_rate                                 OUT NOCOPY NUMBER );
396 
397 -- SERVICES FPJ End
398 
399 PROCEDURE get_source_info                                     -- <SERVICES FPJ>
400 (   p_po_line_id               IN          NUMBER
401 ,   x_from_header_id           OUT NOCOPY  NUMBER
402 ,   x_from_line_id             OUT NOCOPY  NUMBER
403 ,   x_from_line_location_id    OUT NOCOPY  NUMBER
404 );
405 
406 FUNCTION has_source_changed                                   -- <SERVICES FPJ>
407 (   p_po_line_id               IN          NUMBER
408 ,   p_from_header_id           IN          NUMBER
409 ,   p_from_line_id             IN          NUMBER
410 ,   p_from_line_location_id    IN          NUMBER
411 ) RETURN BOOLEAN;
412 
413 --<Contract AutoSourcing FPJ Start>
414 PROCEDURE should_return_contract(
415   p_destination_doc_type       IN         VARCHAR2,
416   p_document_type_code	       IN	  VARCHAR2,
417   p_document_subtype	       IN	  VARCHAR2,
418   x_return_contract            OUT NOCOPY VARCHAR2,
419   x_return_status              OUT NOCOPY VARCHAR2
420 );
421 --<Contract AutoSourcing FPJ End>
422 
423 --<Bug 3545698 mbhargav START>
424 PROCEDURE item_based_asl_sourcing (
425    p_item_id                        	IN      NUMBER,
426    p_vendor_id                      	IN      NUMBER,
427    p_vendor_site_code               	IN      VARCHAR2,
428    p_item_rev				            IN		VARCHAR2,
429    p_item_rev_control			        IN		NUMBER,
430    p_sourcing_date			            IN 		DATE,
431    p_currency_code			            IN		VARCHAR2,
432    p_org_id				                IN		NUMBER,
433    p_using_organization_id          	IN  OUT NOCOPY  NUMBER,
434    x_asl_id                         	OUT NOCOPY      NUMBER,
435    x_vendor_product_num             	OUT NOCOPY      VARCHAR2,
436    x_purchasing_uom                 	OUT NOCOPY      VARCHAR2,
437    x_consigned_from_supplier_flag   	OUT NOCOPY      VARCHAR2,
438    x_enable_vmi_flag                	OUT NOCOPY      VARCHAR2,
439    x_sequence_num                   	OUT NOCOPY      NUMBER,
440    p_category_id                        IN  NUMBER default NULL --<Contract AutoSourcing FPJ>
441 );
442 
443 PROCEDURE category_based_asl_sourcing (
444    p_item_id                        	IN      NUMBER,
445    p_vendor_id                      	IN      NUMBER,
446    p_vendor_site_code               	IN      VARCHAR2,
447    p_item_rev				            IN		VARCHAR2,
448    p_item_rev_control			        IN		NUMBER,
449    p_sourcing_date			            IN 		DATE,
450    p_currency_code			            IN		VARCHAR2,
451    p_org_id				                IN		NUMBER,
452    p_using_organization_id          	IN  OUT NOCOPY  NUMBER,
453    x_asl_id                         	OUT NOCOPY      NUMBER,
454    x_vendor_product_num             	OUT NOCOPY      VARCHAR2,
455    x_purchasing_uom                 	OUT NOCOPY      VARCHAR2,
456    x_consigned_from_supplier_flag   	OUT NOCOPY      VARCHAR2,
457    x_enable_vmi_flag                	OUT NOCOPY      VARCHAR2,
458    x_sequence_num                   	OUT NOCOPY      NUMBER,
459    p_category_id                        IN  NUMBER default NULL --<Contract AutoSourcing FPJ>
460 );
461 --<Bug 3545698 mbhargav END>
462 
463 --<PKGCOMP R12 Start>
464 -------------------------------------------------------------------------------
465 --Start of Comments
466 --Name: process_req_qty
467 --Function:
468 -- This procedure applies the order modifiers on the line level quantity
469 -- and pro-rates the change in the line level quantity to the distributions.
470 -- It converts the requisition quantity according the UOM conversion rate
471 -- passed as the parameter.
472 -- It also performs rounding operations on the line level quantity depending
473 -- on the rounding factor, passed as an argument.
474 --End of Comments
475 -----------------------------------------------------------------------------
476 PROCEDURE process_req_qty(p_mode                  IN VARCHAR2,
477                           p_request_id            IN NUMBER,
478                           p_multi_dist_flag       IN VARCHAR2,
479                           p_req_dist_sequence_id  IN NUMBER,
480                           p_min_order_qty         IN NUMBER,
481                           p_fixed_lot_multiple    IN NUMBER,
482                           p_uom_conversion_rate   IN NUMBER,
483                           p_rounding_factor       IN NUMBER,
484                           p_enforce_full_lot_qty  IN VARCHAR2,
485                           x_quantity              IN OUT NOCOPY NUMBER);
486 
487 END PO_AUTOSOURCE_SV;